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
- __init__(path, sourceFileID, *, parent=None)[source]
Initialize the source file, and add it to the source files of its report.
- Parameters:
- Raises:
ValueError – If parameter
pathisNone.ValueError – If parameter
sourceFileIDisNone.ValueError – If parameter
sourceFileIDis less than 1.
- Return type:
None
- classmethod Parse(element, *, parent=None)[source]
Parse a source file from its
<sourceFiles>element.
- 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, orNoneto accept every attribute.- Return type:
- 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.
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- 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
- Parameters:
- __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:
TypeError – If parameter
userAttributesisn’t iterable.TypeError – If parameter
userAttributescontains an element not of typeUserAttribute.ValueError – If parameter
nameisNone.ValueError – If parameter
keyisNone.ValueError – If parameter
statementIDisNone.TypeError – If parameter
statementIDisn’t of typeStatementID.TypeError – If parameter
parentInstanceIDisn’t of typeint.TypeError – If parameter
designParametersisn’t a mapping.TypeError – If parameter
designParameterscontains a name or value not of typestr.
- Return type:
None
- _id: StatementID
Where the instance is instantiated.
- _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, orNoneto accept every attribute.- Return type:
- 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.
- static _ParseUserAttributes(element)
Parse the user-defined attributes of an element, its
<userAttr>elements.- Parameters:
element (
_Element) – The element.- Return type:
- 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.
- __new__(**kwargs)
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- _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:
- Return type:
- 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;
Nonefor 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.