pyEDAA.Reports.CodeCoverage.UCIS.Instances

The instances of the UCIS XML interchange format, each with its coverage of each kind, and the source files the report’s statement identifiers name by their ID.

Classes

  • SourceFile: A <sourceFiles> of the report: a source file’s path and the ID, by which statement identifiers name it.

  • InstanceCoverage: An <instanceCoverages> of the report: an instance of a design unit, where it is instantiated, its parameters, and


Classes

class pyEDAA.Reports.CodeCoverage.UCIS.Instances.SourceFile(path, sourceFileID, *, parent=None)[source]

A <sourceFiles> of the report: a source file’s path and the ID, by which statement identifiers name it.

Inheritance

Inheritance diagram of SourceFile

Parameters:
__init__(path, sourceFileID, *, parent=None)[source]

Initialize the source file, and add it to the source files of its report.

Parameters:
  • path (Path) – Path of the source file, as the tool states it.

  • sourceFileID (int) – ID of the source file, counted from 1.

  • parent (Report | None) – Optional, the report the source file belongs to; the source file is added to its source files. Default: None.

Raises:
Return type:

None

_parent: Report | None

The report the source file belongs to.

_path: Path

Path of the source file.

_sourceFileID: int

ID of the source file.

classmethod Parse(element, *, parent=None)[source]

Parse a source file from its <sourceFiles> element.

Parameters:
  • element (_Element) – The <sourceFiles> element.

  • parent (Report | None) – Optional, the report the source file belongs to. Default: None.

Return type:

Self

Returns:

The source file.

property Parent: Report | None

Read-only property to access the report the source file belongs to (_parent).

Returns:

The report; None, if the source file belongs to none.

property Path: Path

Read-only property to access the path of the source file (_path).

Returns:

The path, as the tool states it: absolute, or relative to the directory it ran in.

property SourceFileID: int

Read-only property to access the ID of the source file (_sourceFileID).

Returns:

The ID, by which statement identifiers name the file.

classmethod GetMethodsWithAttributes(predicate=None)

Return the class’ methods that carry at least one matching attribute.

Parameters:

predicate (type[TAttr] | Iterable[type[TAttr]] | None) – Optional, an attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

dict[Callable[..., Any], tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

__getstate__()

Return the object’s state for pickling, collecting every slot of the class hierarchy.

Return type:

dict[str, Any]

Returns:

Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If a slot was never assigned, so it has no value to serialize.

__setstate__(state)

Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.

Parameters:

state (dict[str, Any]) – Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If the given state misses a slot or carries an unexpected one.

Return type:

None

class pyEDAA.Reports.CodeCoverage.UCIS.Instances.InstanceCoverage(name, key, statementID, instanceID=None, alias=None, moduleName=None, parentInstanceID=None, designParameters=None, userAttributes=None, *, parent=None)[source]

An <instanceCoverages> of the report: an instance of a design unit, where it is instantiated, its parameters, and its coverage of each kind.

An instance names the instance it is instantiated in by that instance’s ID.

Inheritance

Inheritance diagram of InstanceCoverage

Parameters:
  • name (str)

  • key (str)

  • statementID (StatementID)

  • instanceID (Nullable[int])

  • alias (Nullable[str])

  • moduleName (Nullable[str])

  • parentInstanceID (Nullable[int])

  • designParameters (Nullable[Mapping[str, str]])

  • userAttributes (Nullable[Iterable[UserAttribute]])

  • parent (Nullable[Report])

__init__(name, key, statementID, instanceID=None, alias=None, moduleName=None, parentInstanceID=None, designParameters=None, userAttributes=None, *, parent=None)[source]

Initialize the instance, and append it to the instances of its report.

Its coverage of each kind is added by creating it with this instance as its parent.

Parameters:
  • name (str) – Name of the instance, e.g. top.dut.

  • key (str) – UCIS key of the instance.

  • statementID (StatementID) – Where the instance is instantiated.

  • instanceID (int | None) – Optional, ID of the instance. Default: None.

  • alias (str | None) – Optional, an alias of the instance’s name. Default: None.

  • moduleName (str | None) – Optional, name of the design unit the instance instantiates. Default: None.

  • parentInstanceID (int | None) – Optional, ID of the instance this one is instantiated in. Default: None.

  • designParameters (Mapping[str, str] | None) – Optional, the design parameters of the instance, by name, e.g. {"WIDTH": "8"}. Default: None.

  • userAttributes (Iterable[UserAttribute] | None) – Optional, the user-defined attributes. Default: None.

  • parent (Report | None) – Optional, the report the instance belongs to; the instance is appended to its instances. Default: None.

Raises:
Return type:

None

_parent: Report | None

The report the instance belongs to.

_name: str

Name of the instance.

_key: str

UCIS key of the instance.

_id: StatementID

Where the instance is instantiated.

_instanceID: int | None

ID of the instance.

_alias: str | None

An alias of the instance’s name.

_moduleName: str | None

Name of the design unit the instance instantiates.

_parentInstanceID: int | None

ID of the instance this one is instantiated in.

_designParameters: dict[str, str]

The design parameters of the instance, by name.

_toggleCoverages: list[ToggleCoverage]

The toggle coverage, per metric mode.

_blockCoverages: list[BlockCoverage]

The statement and block coverage, per metric mode.

_conditionCoverages: list[ConditionCoverage]

The condition and expression coverage, per metric mode.

_branchCoverages: list[BranchCoverage]

The branch coverage, per metric mode.

_fsmCoverages: list[FSMCoverage]

The FSM coverage, per metric mode.

_assertionCoverages: list[AssertionCoverage]

The assertion coverage, per metric mode.

classmethod GetMethodsWithAttributes(predicate=None)

Return the class’ methods that carry at least one matching attribute.

Parameters:

predicate (type[TAttr] | Iterable[type[TAttr]] | None) – Optional, an attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

dict[Callable[..., Any], tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property UserAttributes: list[UserAttribute]

Read-only property to access the user-defined attributes (_userAttributes).

Returns:

The user-defined attributes, in the order the report lists them.

static _ParseBoolean(value)

Parse an attribute’s value of XML Schema type boolean.

Parameters:

value (str) – The value: true, 1, false or 0.

Return type:

bool

Returns:

The boolean.

static _ParseUserAttributes(element)

Parse the user-defined attributes of an element, its <userAttr> elements.

Parameters:

element (_Element) – The element.

Return type:

list[UserAttribute]

Returns:

The user-defined attributes, in the order the report lists them.

Raises:

CodeCoverageError – If a value isn’t of the type its attribute states.

__getstate__()

Return the object’s state for pickling, collecting every slot of the class hierarchy.

Return type:

dict[str, Any]

Returns:

Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If a slot was never assigned, so it has no value to serialize.

__new__(**kwargs)
__setstate__(state)

Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.

Parameters:

state (dict[str, Any]) – Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If the given state misses a slot or carries an unexpected one.

Return type:

None

_userAttributes: list[UserAttribute]

The user-defined attributes.

_covergroupCoverages: list[CovergroupCoverage]

The covergroup coverage, per metric mode.

classmethod Parse(element, *, parent=None)[source]

Parse an instance and its coverage of each kind from its <instanceCoverages> element.

Parameters:
  • element (_Element) – The <instanceCoverages> element.

  • parent (Report | None) – Optional, the report the instance belongs to. Default: None.

Return type:

Self

Returns:

The instance.

Raises:

CodeCoverageError – If a user-defined attribute’s value isn’t of the type the attribute states.

property Parent: Report | None

Read-only property to access the report the instance belongs to (_parent).

Returns:

The report; None, if the instance belongs to none.

property Name: str

Read-only property to access the name of the instance (_name).

Returns:

The name, as stated.

property Key: str

Read-only property to access the UCIS key of the instance (_key).

Returns:

The key, as stated.

property ID: StatementID

Read-only property to access where the instance is instantiated (_id).

Returns:

The source statement identifier.

property InstanceID: int | None

Read-only property to access the ID of the instance (_instanceID).

Returns:

The ID; None, if the report states none.

property Alias: str | None

Read-only property to access the alias of the instance’s name (_alias).

Returns:

The alias; None, if the report states none.

property ModuleName: str | None

Read-only property to access the name of the design unit the instance instantiates (_moduleName).

Returns:

The design unit’s name; None, if the report states none.

property ParentInstanceID: int | None

Read-only property to access the ID of the instance this one is instantiated in (_parentInstanceID).

Returns:

The ID; None for a top-level instance, or if the report states none.

property DesignParameters: dict[str, str]

Read-only property to access the design parameters of the instance (_designParameters).

Returns:

The parameters’ values, by name.

property BlockCoverages: list[BlockCoverage]

Read-only property to access the statement and block coverage (_blockCoverages).

Returns:

The block coverages, one per metric mode, in the order the report lists them.

property BranchCoverages: list[BranchCoverage]

Read-only property to access the branch coverage (_branchCoverages).

Returns:

The branch coverages, one per metric mode, in the order the report lists them.

property ToggleCoverages: list[ToggleCoverage]

Read-only property to access the toggle coverage (_toggleCoverages).

Returns:

The toggle coverages, one per metric mode, in the order the report lists them.

property ConditionCoverages: list[ConditionCoverage]

Read-only property to access the condition and expression coverage (_conditionCoverages).

Returns:

The condition coverages, one per metric mode, in the order the report lists them.

property FSMCoverages: list[FSMCoverage]

Read-only property to access the FSM coverage (_fsmCoverages).

Returns:

The FSM coverages, one per metric mode, in the order the report lists them.

property AssertionCoverages: list[AssertionCoverage]

Read-only property to access the assertion coverage (_assertionCoverages).

Returns:

The assertion coverages, one per metric mode, in the order the report lists them.

property CovergroupCoverages: list[CovergroupCoverage]

Read-only property to access the covergroup coverage (_covergroupCoverages).

Returns:

The covergroup coverages, one per metric mode, in the order the report lists them.