pyEDAA.Reports.CodeCoverage.AldecUCDB

Aldec’s UCDB XML code coverage format: a model of the format, read from a report and converted to the common model.

Aldec’s simulators Riviera-PRO and Active-HDL keep code coverage in a coverage database (ACDB), which the tool acdb2xml exports as XML: acdb2xml -i aggregate.acdb -o ucdb.xml. The XML names its namespace www.aldec.com and its root <ux:ucdb>; it is a dump of the database’s UCIS data model - scopes, coverage items (bins) and history nodes -, not the XML interchange format of the UCIS standard. A report states no format version, only the tool’s name and version, e.g. Riviera-PRO 2022.04; it is validated against Aldec-UCDB.xsd (SCHEMA), reverse-engineered from reports of Riviera-PRO.

The format’s model keeps what the report states: a Document holds its attributes, HistoryNode elements - nested, a merge holds the tests it merged -, Scope elements - nested, e.g. design units, their instances, processes and branching statements - with their Bin elements, and Command elements. Each element’s constructor takes typed values, so the model can be built by hand: an element below the report names its parent with the keyword parameter parent and is added to it. Its class method Parse reads the element’s XML element.

  • The scopes are the design units and their instances; the bins are the coverage items - e.g. statements and branches - with their counts, and where they are in the sources (SourceLocation).

  • Every element may state attributes (AttributesMixin); the named elements derive from Base.

  • The kinds of scopes (ScopeType), bins (CoverType) and source languages (Language) are named as the UCIS standard names them in its C API, without the prefix UCIS_, e.g. DU_MODULE for UCIS_DU_MODULE.

Document.ToCoverageSummary() converts the statement coverage to the common model of pyEDAA.Reports.CodeCoverage:

  • The statements are the statement bins (STMTBIN) of the instances: the bins of the scopes below each top-level scope, which isn’t a design unit. A statement is identified by its file, its line and its index in the line (attribute #SINDEX#); with mergeInstances, the statements of all instances of a design unit are merged into one, which ran as often as in all instances together (Report.IterateStatements()).

  • A file’s path is the one a statement bin’s source location states, relative to the directory the tool ran in; these directories are the summary’s source directories.

  • A line ran as often as its least often run statement: it is covered, if all its statements ran. A line, whose statements are all excluded, is excluded; an excluded statement doesn’t count for its line.

  • The branches, the blocks and the other kinds of coverage aren’t converted, and the format names no units.

Example

from pathlib import Path
from pyEDAA.Reports.CodeCoverage.AldecUCDB import Document

report = Document(Path("ucdb.xml"), analyzeAndConvert=True)
summary = report.ToCoverageSummary(mergeInstances=True)
for file in summary.IterateFiles():
  print(f"{file.Path}: {file.LineCoverage:.1%}")

Variables

Classes

  • ScopeType: Kind of a <ux:scope>, as its type states: a design unit, an instance of one, or a scope of a coverage kind.

  • CoverType: Kind of a <ux:bin>, as its type states.

  • Language: Language of the source of a <ux:scope>, as its lang states.

  • HistoryNodeKind: Kind of a <ux:hnode>, as its type states.

  • BinFlags: Flags of a <ux:bin>, as its flags state in hexadecimal; a flag not named here is kept.

  • AttributesMixin: A mixin-class adding the attributes an element states: its <ux:attr> elements, each a key and a typed value.

  • Base: Base-class of the named elements below the report.

  • SourceLocation: A <ux:src> of a scope or bin: the source file, the directory its name is relative to, the line and the token.

  • Bin: A <ux:bin> of a scope: a coverage item, how often it was hit, its flags, and where it is in the sources.

  • Scope: A <ux:scope> of the report or of a scope: its bins and the scopes below it.

  • HistoryNode: A <ux:hnode> of the report or of a merge: a test or a merge of databases, its attributes and merged nodes.

  • Command: A <ux:command> of the report: a record of a command applied to the coverage database.

  • Statement: A statement of a source line: its statement bins - of one instance, or merged, of all instances -, and how often it

  • Report: The root element <ux:ucdb>: the tool, which wrote it, its attributes, the history nodes, the scopes and the

  • Document: An Aldec UCDB XML code coverage report: read into the format’s model, and converted to the common model.


Variables

pyEDAA.Reports.CodeCoverage.AldecUCDB.SCHEMA

The XML schema a report is validated against.

'Aldec-UCDB.xsd'
pyEDAA.Reports.CodeCoverage.AldecUCDB.NAMESPACE

The XML namespace of the format’s elements.

'www.aldec.com'
pyEDAA.Reports.CodeCoverage.AldecUCDB.NAMESPACES

The XML namespaces of the format by their prefix, for finding elements.

{'ux': 'www.aldec.com'}
pyEDAA.Reports.CodeCoverage.AldecUCDB.HistoryNodeParentType

A type variable for the parent of a HistoryNode: a Report or a HistoryNode.

~HistoryNodeParentType
pyEDAA.Reports.CodeCoverage.AldecUCDB.ScopeParentType

A type variable for the parent of a Scope: a Report or a Scope.

~ScopeParentType

Classes

class pyEDAA.Reports.CodeCoverage.AldecUCDB.ScopeType(*values)[source]

Kind of a <ux:scope>, as its type states: a design unit, an instance of one, or a scope of a coverage kind.

Inheritance

Inheritance diagram of ScopeType

Toggle = 'TOGGLE'

Toggle coverage of a signal.

Branch = 'BRANCH'

Branch coverage of a branching statement.

Expression = 'EXPR'

Expression coverage.

Condition = 'COND'

Condition coverage.

Instance = 'INSTANCE'

An instance of a design unit, e.g. of a Verilog module.

Process = 'PROCESS'

A process, e.g. a Verilog always block.

Block = 'BLOCK'

A block, e.g. a VHDL block statement.

Function = 'FUNCTION'

A function.

ForkJoin = 'FORKJOIN'

A Verilog fork ... join block.

Generate = 'GENERATE'

A generate block.

Generic = 'GENERIC'

A scope of a generic kind.

Class = 'CLASS'

A SystemVerilog class.

CoverGroup = 'COVERGROUP'

A SystemVerilog covergroup type.

CoverInstance = 'COVERINSTANCE'

An instance of a SystemVerilog covergroup.

CoverPoint = 'COVERPOINT'

A SystemVerilog coverpoint.

Cross = 'CROSS'

A SystemVerilog cross coverage.

Cover = 'COVER'

A cover directive.

Assert = 'ASSERT'

An assertion.

Program = 'PROGRAM'

An instance of a SystemVerilog program.

Package = 'PACKAGE'

An instance of a package.

Task = 'TASK'

A Verilog task.

Interface = 'INTERFACE'

An instance of a SystemVerilog interface.

FSM = 'FSM'

A finite state machine.

DesignUnitModule = 'DU_MODULE'

Design unit: a Verilog module.

DesignUnitArchitecture = 'DU_ARCH'

Design unit: a VHDL architecture.

DesignUnitPackage = 'DU_PACKAGE'

Design unit: a package.

DesignUnitProgram = 'DU_PROGRAM'

Design unit: a SystemVerilog program.

DesignUnitInterface = 'DU_INTERFACE'

Design unit: a SystemVerilog interface.

FSMStates = 'FSM_STATES'

The states of a finite state machine.

FSMTransitions = 'FSM_TRANS'

The transitions of a finite state machine.

CoverBlock = 'COVBLOCK'

A block of coverage items.

CoverGroupBinScope = 'CVGBINSCOPE'

A scope of covergroup bins.

IllegalBinScope = 'ILLEGALBINSCOPE'

A scope of illegal covergroup bins.

IgnoreBinScope = 'IGNOREBINSCOPE'

A scope of ignored covergroup bins.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

classmethod Parse(value)

Convert a string to the member carrying that value.

Parameters:

value (str | None) – The string to convert. None and the empty string mean no value was given.

Return type:

Self | None

Returns:

The member carrying that value. If no value was given: DEFAULT, if the enumeration declares one, otherwise None.

Raises:
  • TypeError – If parameter ‘value’ is not of type str.

  • ValueError – If no member of this enumeration carries that value.
    The note lists the values it accepts.

__str__()

Return str(self).

__format__(format_spec, /)

Return a formatted version of the string as described by format_spec.

__new__(value)
__repr__()

Return repr(self).

__new_member__(*values)

values must already be of type str

__hash__()

Return hash(self).

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__iter__()

Implement iter(self).

__mod__(value, /)

Return self%value.

__rmod__(value, /)

Return value%self.

__len__()

Return len(self).

__getitem__(key, /)

Return self[key].

__add__(value, /)

Return self+value.

__mul__(value, /)

Return self*value.

__rmul__(value, /)

Return value*self.

__contains__(key, /)

Return bool(key in self).

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

replace(old, new, /, count=-1)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If count is given, only the first count occurrences are replaced. If count is not specified or -1, then all occurrences are replaced.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count()

Return the number of non-overlapping occurrences of substring sub in string S[start:end].

Optional arguments start and end are interpreted as in slice notation.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

index()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

rfind()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

rindex()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

startswith()

Return True if the string starts with the specified prefix, False otherwise.

prefix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

endswith()

Return True if the string ends with the specified suffix, False otherwise.

suffix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

isprintable()

Return True if all characters in the string are printable, False otherwise.

A character is printable if repr() may use it in its output.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

format(*args, **kwargs)

Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping, /)

Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

__sizeof__()

Return the size of the string in memory, in bytes.

__dir__()

Returns public methods and other interesting attributes.

__reduce_ex__(proto)

Helper for pickle.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.CoverType(*values)[source]

Kind of a <ux:bin>, as its type states.

A kind Aldec’s export has no name for is stated by its value in hexadecimal, as the UCIS C API defines it.

Inheritance

Inheritance diagram of CoverType

CoverGroupBin = 'CVGBIN'

A bin of a SystemVerilog covergroup.

CoverBin = 'COVERBIN'

A cover directive’s pass.

AssertBin = 'ASSERTBIN'

An assertion’s failure.

StatementBin = 'STMTBIN'

A statement.

BranchBin = 'BRANCHBIN'

A branch of a branching statement.

ExpressionBin = 'EXPRBIN'

A row of an expression’s truth table.

ConditionBin = 'CONDBIN'

A row of a condition’s truth table.

ToggleBin = 'TOGGLEBIN'

A transition of a signal’s toggle coverage.

PassBin = 'PASSBIN'

An assertion’s pass.

FSMBin = 'FSMBIN'

A state or transition of a finite state machine.

UserBin = 'USERBIN'

A bin defined by the user.

Count = 'COUNT'

A counter.

FailBin = 'FAILBIN'

A cover directive’s failure.

VacuousBin = 'VACUOUSBIN'

An assertion’s vacuous pass.

DisabledBin = 'DISABLEDBIN'

An assertion’s or cover directive’s disabled attempt.

AttemptBin = 'ATTEMPTBIN'

An assertion’s or cover directive’s attempt.

ActiveBin = 'ACTIVEBIN'

An assertion’s or cover directive’s active thread.

IgnoreBin = 'IGNOREBIN'

An ignored bin of a SystemVerilog covergroup.

IllegalBin = 'ILLEGALBIN'

An illegal bin of a SystemVerilog covergroup.

DefaultBin = 'DEFAULTBIN'

The default bin of a SystemVerilog covergroup.

PeakActiveBin = 'PEAKACTIVEBIN'

The peak number of an assertion’s or cover directive’s active threads.

BlockBin = '1000000'

A block of statements, stated by its value UCIS_BLOCKBIN: 0x1000000.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

classmethod Parse(value)

Convert a string to the member carrying that value.

Parameters:

value (str | None) – The string to convert. None and the empty string mean no value was given.

Return type:

Self | None

Returns:

The member carrying that value. If no value was given: DEFAULT, if the enumeration declares one, otherwise None.

Raises:
  • TypeError – If parameter ‘value’ is not of type str.

  • ValueError – If no member of this enumeration carries that value.
    The note lists the values it accepts.

__str__()

Return str(self).

__format__(format_spec, /)

Return a formatted version of the string as described by format_spec.

__new__(value)
__repr__()

Return repr(self).

__new_member__(*values)

values must already be of type str

__hash__()

Return hash(self).

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__iter__()

Implement iter(self).

__mod__(value, /)

Return self%value.

__rmod__(value, /)

Return value%self.

__len__()

Return len(self).

__getitem__(key, /)

Return self[key].

__add__(value, /)

Return self+value.

__mul__(value, /)

Return self*value.

__rmul__(value, /)

Return value*self.

__contains__(key, /)

Return bool(key in self).

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

replace(old, new, /, count=-1)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If count is given, only the first count occurrences are replaced. If count is not specified or -1, then all occurrences are replaced.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count()

Return the number of non-overlapping occurrences of substring sub in string S[start:end].

Optional arguments start and end are interpreted as in slice notation.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

index()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

rfind()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

rindex()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

startswith()

Return True if the string starts with the specified prefix, False otherwise.

prefix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

endswith()

Return True if the string ends with the specified suffix, False otherwise.

suffix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

isprintable()

Return True if all characters in the string are printable, False otherwise.

A character is printable if repr() may use it in its output.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

format(*args, **kwargs)

Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping, /)

Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

__sizeof__()

Return the size of the string in memory, in bytes.

__dir__()

Returns public methods and other interesting attributes.

__reduce_ex__(proto)

Helper for pickle.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.Language(*values)[source]

Language of the source of a <ux:scope>, as its lang states.

Inheritance

Inheritance diagram of Language

VHDL = 'VHDL'

VHDL.

Verilog = 'VLOG'

Verilog.

SystemVerilog = 'SV'

SystemVerilog.

SystemC = 'SYSTEMC'

SystemC.

PSLInVHDL = 'PSL_VHDL'

PSL embedded in VHDL.

PSLInVerilog = 'PSL_VLOG'

PSL embedded in Verilog.

PSLInSystemVerilog = 'PSL_SV'

PSL embedded in SystemVerilog.

PSLInSystemC = 'PSL_SYSTEMC'

PSL embedded in SystemC.

E = 'E'

The verification language e.

Vera = 'VERA'

The verification language OpenVera.

NoLanguage = 'NONE'

No source language.

Other = 'OTHER'

Another source language.

static _generate_next_value_(name, start, count, last_values)

Return the lower-cased version of the member name.

classmethod Parse(value)

Convert a string to the member carrying that value.

Parameters:

value (str | None) – The string to convert. None and the empty string mean no value was given.

Return type:

Self | None

Returns:

The member carrying that value. If no value was given: DEFAULT, if the enumeration declares one, otherwise None.

Raises:
  • TypeError – If parameter ‘value’ is not of type str.

  • ValueError – If no member of this enumeration carries that value.
    The note lists the values it accepts.

__str__()

Return str(self).

__format__(format_spec, /)

Return a formatted version of the string as described by format_spec.

__new__(value)
__repr__()

Return repr(self).

__new_member__(*values)

values must already be of type str

__hash__()

Return hash(self).

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__iter__()

Implement iter(self).

__mod__(value, /)

Return self%value.

__rmod__(value, /)

Return value%self.

__len__()

Return len(self).

__getitem__(key, /)

Return self[key].

__add__(value, /)

Return self+value.

__mul__(value, /)

Return self*value.

__rmul__(value, /)

Return value*self.

__contains__(key, /)

Return bool(key in self).

encode(encoding='utf-8', errors='strict')

Encode the string using the codec registered for encoding.

encoding

The encoding in which to encode the string.

errors

The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

replace(old, new, /, count=-1)

Return a copy with all occurrences of substring old replaced by new.

count

Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If count is given, only the first count occurrences are replaced. If count is not specified or -1, then all occurrences are replaced.

split(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

rsplit(sep=None, maxsplit=-1)

Return a list of the substrings in the string, using sep as the separator string.

sep

The separator used to split the string.

When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

maxsplit

Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

join(iterable, /)

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold()

Return a version of the string suitable for caseless comparisons.

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

center(width, fillchar=' ', /)

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count()

Return the number of non-overlapping occurrences of substring sub in string S[start:end].

Optional arguments start and end are interpreted as in slice notation.

expandtabs(tabsize=8)

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

partition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

index()

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

ljust(width, fillchar=' ', /)

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower()

Return a copy of the string converted to lowercase.

lstrip(chars=None, /)

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

rfind()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Return -1 on failure.

rindex()

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end].

Optional arguments start and end are interpreted as in slice notation. Raises ValueError when the substring is not found.

rjust(width, fillchar=' ', /)

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rstrip(chars=None, /)

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

rpartition(sep, /)

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

splitlines(keepends=False)

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

strip(chars=None, /)

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

translate(table, /)

Replace each character in the string using the given translation table.

table

Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper()

Return a copy of the string converted to uppercase.

startswith()

Return True if the string starts with the specified prefix, False otherwise.

prefix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

endswith()

Return True if the string ends with the specified suffix, False otherwise.

suffix

A string or a tuple of strings to try.

start

Optional start position. Default: start of the string.

end

Optional stop position. Default: end of the string.

removeprefix(prefix, /)

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix(suffix, /)

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

isprintable()

Return True if all characters in the string are printable, False otherwise.

A character is printable if repr() may use it in its output.

zfill(width, /)

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

format(*args, **kwargs)

Return a formatted version of the string, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map(mapping, /)

Return a formatted version of the string, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

static maketrans()

Return a translation table usable for str.translate().

If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

__sizeof__()

Return the size of the string in memory, in bytes.

__dir__()

Returns public methods and other interesting attributes.

__reduce_ex__(proto)

Helper for pickle.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.HistoryNodeKind(*values)[source]

Kind of a <ux:hnode>, as its type states.

Inheritance

Inheritance diagram of HistoryNodeKind

Test = 1

A test: a simulation run, which wrote a coverage database.

Merge = 2

A merge of coverage databases.

__format__(format_spec, /)

Convert to a string according to format_spec.

__str__()

Return repr(self).

__repr__()

Return repr(self).

__new__(value)
__hash__()

Return hash(self).

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__add__(value, /)

Return self+value.

__radd__(value, /)

Return value+self.

__sub__(value, /)

Return self-value.

__rsub__(value, /)

Return value-self.

__mul__(value, /)

Return self*value.

__rmul__(value, /)

Return value*self.

__mod__(value, /)

Return self%value.

__rmod__(value, /)

Return value%self.

__divmod__(value, /)

Return divmod(self, value).

__rdivmod__(value, /)

Return divmod(value, self).

__pow__(value, mod=None, /)

Return pow(self, value, mod).

__rpow__(value, mod=None, /)

Return pow(value, self, mod).

__neg__()

-self

__pos__()

+self

__abs__()

abs(self)

__bool__()

True if self else False

__invert__()

~self

__lshift__(value, /)

Return self<<value.

__rlshift__(value, /)

Return value<<self.

__rshift__(value, /)

Return self>>value.

__rrshift__(value, /)

Return value>>self.

__and__(value, /)

Return self&value.

__rand__(value, /)

Return value&self.

__xor__(value, /)

Return self^value.

__rxor__(value, /)

Return value^self.

__or__(value, /)

Return self|value.

__ror__(value, /)

Return value|self.

__int__()

int(self)

__float__()

float(self)

__floordiv__(value, /)

Return self//value.

__rfloordiv__(value, /)

Return value//self.

__truediv__(value, /)

Return self/value.

__rtruediv__(value, /)

Return value/self.

__index__()

Return self converted to an integer, if self is suitable for use as an index into a list.

conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
to_bytes(length=1, byteorder='big', *, signed=False)

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

classmethod from_bytes(bytes, byteorder='big', *, signed=False)

Return the integer represented by the given array of bytes.

bytes

Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Indicates whether two’s complement is used to represent the integer.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
__trunc__()

Truncating an Integral returns itself.

__floor__()

Flooring an Integral returns itself.

__ceil__()

Ceiling of an Integral returns itself.

__round__(ndigits=None, /)

Rounding an Integral returns itself.

Rounding with an ndigits argument also returns an integer.

__sizeof__()

Returns size in memory, in bytes.

is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

__dir__()

Returns public methods and other interesting attributes.

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

__reduce_ex__(proto)

Helper for pickle.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.BinFlags(*values)[source]

Flags of a <ux:bin>, as its flags state in hexadecimal; a flag not named here is kept.

Inheritance

Inheritance diagram of BinFlags

Is32Bit = 1

The count is a 32-bit number.

Is64Bit = 2

The count is a 64-bit number.

IsVector = 4

The bin is a vector of counts.

HasGoal = 8

The bin states a goal.

HasWeight = 16

The bin states a weight.

ExcludePragma = 32

Excluded by a pragma in the source.

ExcludeFile = 64

Excluded by an exclusion file.

ExcludeInstance = 128

Excluded in this instance.

ExcludeAuto = 256

Excluded automatically by the tool.

HasLimit = 1024

The count saturates at a limit.

HasCount = 2048

The bin states a count.

IsCovered = 4096

The bin reached its goal.

Excluded = 480

Any of the exclusion flags.

static _generate_next_value_(name, start, count, last_values)

Generate the next value when not given.

name: the name of the member start: the initial start value or None count: the number of existing members last_values: the last value assigned or None

__format__(format_spec, /)

Convert to a string according to format_spec.

__str__()

Return repr(self).

__repr__()

Return repr(self).

__or__(other)

Return self|value.

__and__(other)

Return self&value.

__xor__(other)

Return self^value.

__ror__(other)

Return value|self.

__rand__(other)

Return value&self.

__rxor__(other)

Return value^self.

__invert__()

~self

__new__(value)
__hash__()

Return hash(self).

__lt__(value, /)

Return self<value.

__le__(value, /)

Return self<=value.

__eq__(value, /)

Return self==value.

__ne__(value, /)

Return self!=value.

__gt__(value, /)

Return self>value.

__ge__(value, /)

Return self>=value.

__add__(value, /)

Return self+value.

__radd__(value, /)

Return value+self.

__sub__(value, /)

Return self-value.

__rsub__(value, /)

Return value-self.

__mul__(value, /)

Return self*value.

__rmul__(value, /)

Return value*self.

__mod__(value, /)

Return self%value.

__rmod__(value, /)

Return value%self.

__divmod__(value, /)

Return divmod(self, value).

__rdivmod__(value, /)

Return divmod(value, self).

__pow__(value, mod=None, /)

Return pow(self, value, mod).

__rpow__(value, mod=None, /)

Return pow(value, self, mod).

__neg__()

-self

__pos__()

+self

__abs__()

abs(self)

__bool__()

True if self else False

__lshift__(value, /)

Return self<<value.

__rlshift__(value, /)

Return value<<self.

__rshift__(value, /)

Return self>>value.

__rrshift__(value, /)

Return value>>self.

__int__()

int(self)

__float__()

float(self)

__floordiv__(value, /)

Return self//value.

__rfloordiv__(value, /)

Return value//self.

__truediv__(value, /)

Return self/value.

__rtruediv__(value, /)

Return value/self.

__index__()

Return self converted to an integer, if self is suitable for use as an index into a list.

conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
to_bytes(length=1, byteorder='big', *, signed=False)

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

classmethod from_bytes(bytes, byteorder='big', *, signed=False)

Return the integer represented by the given array of bytes.

bytes

Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Indicates whether two’s complement is used to represent the integer.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
__trunc__()

Truncating an Integral returns itself.

__floor__()

Flooring an Integral returns itself.

__ceil__()

Ceiling of an Integral returns itself.

__round__(ndigits=None, /)

Rounding an Integral returns itself.

Rounding with an ndigits argument also returns an integer.

__sizeof__()

Returns size in memory, in bytes.

is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

_numeric_repr_(obj, /)

Return the canonical string representation of the object.

For many object types, including most builtins, eval(repr(obj)) == obj.

classmethod _iter_member_by_value_(value)

Extract all members from the value in definition (i.e. increasing value) order.

classmethod _iter_member_(value)

Extract all members from the value in definition (i.e. increasing value) order.

classmethod _iter_member_by_def_(value)

Extract all members from the value in definition order.

classmethod _missing_(value)

Create a composite member containing all canonical members present in value.

If non-member values are present, result depends on _boundary_ setting.

__contains__(other)

Returns True if self has at least the same flags set as other.

__iter__()

Returns flags in definition order.

__len__()

Return the number of members (no aliases)

__dir__()

Returns public methods and other interesting attributes.

classmethod __getitem__(name)

Return the member matching name.

__reduce_ex__(proto)

Helper for pickle.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.AttributesMixin(attributes=None)[source]

A mixin-class adding the attributes an element states: its <ux:attr> elements, each a key and a typed value.

An attribute’s type is its value’s type: int is int, double is float, str is str.

Inheritance

Inheritance diagram of AttributesMixin

Parameters:

attributes (Nullable[Mapping[str, int | float | str]])

__init__(attributes=None)[source]

Initialize the attributes.

Parameters:

attributes (Mapping[str, int | float | str] | None) – Optional, the attributes by key, e.g. {"#SINDEX#": 1}. Default: None.

Raises:
  • TypeError – If parameter attributes isn’t a mapping.

  • TypeError – If parameter attributes contains a key not of type str.

  • ValueError – If parameter attributes contains an empty key.

  • TypeError – If parameter attributes contains a value not of type int, float or str.

Return type:

None

_attributes: dict[str, int | float | str]

The attributes, by key.

static _ParseAttributes(element)[source]

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

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.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.Base(name)[source]

Base-class of the named elements below the report.

Scopes and bins are named elements.

Inheritance

Inheritance diagram of Base

Parameters:

name (str)

__init__(name)[source]

Initialize the name of the element.

Parameters:

name (str) – Name of the element.

Raises:
Return type:

None

_name: str

Name of the element.

property Name: str

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

Returns:

The name.

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.

__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

class pyEDAA.Reports.CodeCoverage.AldecUCDB.SourceLocation(file, workDirectory, lineNumber, token)[source]

A <ux:src> of a scope or bin: the source file, the directory its name is relative to, the line and the token.

It is a value, as a path is: it names no parent.

Inheritance

Inheritance diagram of SourceLocation

Parameters:
__init__(file, workDirectory, lineNumber, token)[source]

Initialize the source location.

Parameters:
  • file (Path) – Path of the source file, e.g. src/counter.sv.

  • workDirectory (Path) – The directory the tool ran in.

  • lineNumber (int) – Line number, counted from 1; 0 for a scope without a line.

  • token (int) – Number of the token in the line.

Raises:
Return type:

None

_file: Path

Path of the source file, relative to _workDirectory, if not absolute.

_workDirectory: Path

The directory the tool ran in.

_lineNumber: int

Line number, counted from 1; 0 for a scope without a line.

_token: int

Number of the token in the line.

classmethod Parse(element)[source]

Parse a source location from its <ux:src> element.

Parameters:

element (_Element) – The <ux:src> element.

Return type:

Self

Returns:

The source location.

property File: Path

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

Returns:

The path, relative to WorkDirectory, if not absolute.

property WorkDirectory: Path

Read-only property to access the directory the tool ran in (_workDirectory).

It is a path on the machine the coverage was measured on, so it may not exist where the report is read.

Returns:

The directory.

property LineNumber: int

Read-only property to access the line number (_lineNumber).

Returns:

The line number, counted from 1; 0 for a scope without a line.

property Token: int

Read-only property to access the number of the token in the line (_token).

Returns:

The token’s number.

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.AldecUCDB.Bin(name, coverType, flags, count, source, attributes=None, *, parent=None)[source]

A <ux:bin> of a scope: a coverage item, how often it was hit, its flags, and where it is in the sources.

Statements and branches are coverage items.

Inheritance

Inheritance diagram of Bin

Parameters:
__init__(name, coverType, flags, count, source, attributes=None, *, parent=None)[source]

Initialize the bin, and append it to the bins of its scope.

Parameters:
  • name (str) – Name of the bin, e.g. true_branch; empty for a statement.

  • coverType (CoverType) – Kind of the bin.

  • flags (BinFlags) – Flags of the bin.

  • count (int) – How often the coverage item was hit.

  • source (SourceLocation) – Where the coverage item is in the sources.

  • attributes (Mapping[str, int | float | str] | None) – Optional, the attributes by key, e.g. {"#SINDEX#": 1}. Default: None.

  • parent (Scope | None) – Optional, the scope the bin belongs to; the bin is appended to its bins. Default: None.

Raises:
Return type:

None

_parent: Scope | None

The scope the bin belongs to.

_type: CoverType

Kind of the bin.

_flags: BinFlags

Flags of the bin, e.g. whether it is excluded.

_count: int

How often the coverage item was hit.

_source: SourceLocation

Where the coverage item is in the sources.

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

Parse a bin, its count, source location and attributes from its <ux:bin> element.

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

  • parent (Scope | None) – Optional, the scope the bin belongs to. Default: None.

Return type:

Self

Returns:

The bin.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

property Parent: Scope | None

Read-only property to access the scope the bin belongs to (_parent).

Returns:

The scope; None if the bin belongs to no scope.

property Type: CoverType

Read-only property to access the kind of the bin (_type).

Returns:

The kind, e.g. a statement.

property Flags: BinFlags

Read-only property to access the flags of the bin (_flags).

Returns:

The flags.

property IsExcluded: bool

Read-only property to return whether the bin is excluded from the measurement.

Returns:

True, if Flags has one of the exclusion flags (BinFlags.Excluded).

property Count: int

Read-only property to access how often the coverage item was hit (_count).

Returns:

The count, e.g. how often a statement ran.

property Source: SourceLocation

Read-only property to access where the coverage item is in the sources (_source).

Returns:

The source location.

_attributes: dict[str, int | float | str]

The attributes, by key.

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

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 Name: str

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

Returns:

The name.

static _ParseAttributes(element)

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the 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

_name: str

Name of the element.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.Scope[ScopeParentType: Report | Scope](name, scopeType, language, weight, flags, source, designUnit=None, attributes=None, *, parent=None)[source]

A <ux:scope> of the report or of a scope: its bins and the scopes below it.

Design units, their instances, processes and branching statements are scopes.

Inheritance

Inheritance diagram of Scope

Parameters:
__init__(name, scopeType, language, weight, flags, source, designUnit=None, attributes=None, *, parent=None)[source]

Initialize the scope, and append it to the scopes of its report or scope.

Its scopes and bins are added by creating them with this scope as their parent.

Parameters:
  • name (str) – Name of the scope, e.g. work.counter for a design unit or uut for an instance.

  • scopeType (ScopeType) – Kind of the scope.

  • language (Language) – Language of the scope’s source.

  • weight (int) – Weight of the scope.

  • flags (int) – Flags of the scope.

  • source (SourceLocation) – Where the scope is in the sources.

  • designUnit (str | None) – Optional, name of the design unit an instance instantiates, e.g. work.counter. Default: None.

  • attributes (Mapping[str, int | float | str] | None) – Optional, the attributes by key, e.g. {"#GOAL#": 100}. Default: None.

  • parent (ScopeParentType | None) – Optional, the report or scope the scope belongs to; the scope is appended to its scopes. Default: None.

Raises:
Return type:

None

_parent: ScopeParentType | None

The report or scope the scope belongs to.

_type: ScopeType

Kind of the scope.

_language: Language

Language of the scope’s source.

_weight: int

Weight of the scope.

_flags: int

Flags of the scope.

_source: SourceLocation

Where the scope is in the sources.

_designUnit: str | None

Name of the design unit an instance instantiates.

_scopes: list[Scope[Scope]]

The scopes below this one.

_bins: list[Bin]

The bins of this scope.

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

Parse a scope, its attributes, bins and the scopes below it from its <ux:scope> element.

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

  • parent (ScopeParentType | None) – Optional, the report or scope the scope belongs to. Default: None.

Return type:

Self

Returns:

The scope.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

IterateBins()[source]

Iterate the bins of this scope, then those of the scopes below it, depth-first.

Return type:

Generator[Bin]

Returns:

A generator of the bins.

property Parent: ScopeParentType | None

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

Returns:

The Report or Scope; None if the scope belongs to none.

property Type: ScopeType

Read-only property to access the kind of the scope (_type).

Returns:

The kind, e.g. a design unit or an instance.

property Language: Language

Read-only property to access the language of the scope’s source (_language).

Returns:

The language.

property Weight: int

Read-only property to access the weight of the scope (_weight).

Returns:

The weight.

property Flags: int

Read-only property to access the flags of the scope (_flags).

Returns:

The flags, as stated.

property Source: SourceLocation

Read-only property to access where the scope is in the sources (_source).

Returns:

The source location.

property DesignUnit: str | None

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

Returns:

The design unit’s name, e.g. work.counter; None for a scope, which isn’t an instance.

property Scopes: list[Scope[Scope]]

Read-only property to access the scopes below this one (_scopes).

Returns:

The scopes, in the order the report lists them.

property Bins: list[Bin]

Read-only property to access the bins of this scope (_bins).

Returns:

The bins, in the order the report lists them.

_attributes: dict[str, int | float | str]

The attributes, by key.

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

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 Name: str

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

Returns:

The name.

static _ParseAttributes(element)

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

classmethod __class_getitem__()

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….

__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.

classmethod __init_subclass__()

Function to initialize subclasses.

__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

_name: str

Name of the element.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.HistoryNode[HistoryNodeParentType: Report | HistoryNode](name, physicalName, kind, attributes=None, *, parent=None)[source]

A <ux:hnode> of the report or of a merge: a test or a merge of databases, its attributes and merged nodes.

A test wrote a coverage database, a merge merged databases. The attributes state e.g. the tool, the date and the command line.

Inheritance

Inheritance diagram of HistoryNode

Parameters:
__init__(name, physicalName, kind, attributes=None, *, parent=None)[source]

Initialize the history node, and append it to the history nodes of its report or merge.

The history nodes it merged are added by creating them with this history node as their parent.

Parameters:
  • name (str) – Logical name of the history node, e.g. of the test.

  • physicalName (Path) – Path of the coverage database, e.g. cov/aggregate/aggregate.acdb.

  • kind (HistoryNodeKind) – Kind of the history node.

  • attributes (Mapping[str, int | float | str] | None) – Optional, the attributes by key, e.g. {"UCIS:tool": "Riviera-PRO"}. Default: None.

  • parent (HistoryNodeParentType | None) – Optional, the report or merge the history node belongs to; the history node is appended to its history nodes. Default: None.

Raises:
Return type:

None

_parent: HistoryNodeParentType | None

The report or merge the history node belongs to.

_physicalName: Path

Path of the coverage database.

_kind: HistoryNodeKind

Kind of the history node.

_historyNodes: list[HistoryNode[HistoryNode]]

The history nodes merged by this one.

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

Parse a history node, its attributes and the history nodes it merged from its <ux:hnode> element.

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

  • parent (HistoryNodeParentType | None) – Optional, the report or merge the history node belongs to. Default: None.

Return type:

Self

Returns:

The history node.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

property Parent: HistoryNodeParentType | None

Read-only property to access the report or merge the history node belongs to (_parent).

Returns:

The Report or HistoryNode; None if the history node belongs to none.

property PhysicalName: Path

Read-only property to access the path of the coverage database (_physicalName).

Returns:

The path, as the tool stated it, e.g. relative to the directory it ran in.

property Kind: HistoryNodeKind

Read-only property to access the kind of the history node (_kind).

Returns:

The kind: a test or a merge.

property HistoryNodes: list[HistoryNode[HistoryNode]]

Read-only property to access the history nodes merged by this one (_historyNodes).

Returns:

The history nodes, in the order the report lists them; empty for a test.

_attributes: dict[str, int | float | str]

The attributes, by key.

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

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 Name: str

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

Returns:

The name.

static _ParseAttributes(element)

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

classmethod __class_getitem__()

Parameterizes a generic class.

At least, parameterizing a generic class is the main thing this method does. For example, for some generic class Foo, this is called when we do Foo[int] - there, with cls=Foo and params=int.

However, note that this method is also called when defining generic classes in the first place with class Foo[T]: ….

__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.

classmethod __init_subclass__()

Function to initialize subclasses.

__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

_name: str

Name of the element.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.Command(commandType, flags, data, index, *, parent=None)[source]

A <ux:command> of the report: a record of a command applied to the coverage database.

An exclusion is such a command. Its fields are kept as stated, not interpreted.

Inheritance

Inheritance diagram of Command

Parameters:
__init__(commandType, flags, data, index, *, parent=None)[source]

Initialize the command, and append it to the commands of its report.

Parameters:
  • commandType (int) – Kind of the command.

  • flags (int) – Flags of the command.

  • data (str) – Data of the command.

  • index (int) – Index of the command.

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

Raises:
Return type:

None

_parent: Report | None

The report the command belongs to.

_type: int

Kind of the command.

_flags: int

Flags of the command.

_data: str

Data of the command, e.g. a list of values separated by ;.

_index: int

Index of the command.

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

Parse a command from its <ux:command> element.

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

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

Return type:

Self

Returns:

The command.

property Parent: Report | None

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

Returns:

The report; None if the command belongs to no report.

property Type: int

Read-only property to access the kind of the command (_type).

Returns:

The kind, as stated.

property Flags: int

Read-only property to access the flags of the command (_flags).

Returns:

The flags, as stated.

property Data: str

Read-only property to access the data of the command (_data).

Returns:

The data, as stated, e.g. 3;1;10;dut.sv;63;/project;0;0;.

property Index: int

Read-only property to access the index of the command (_index).

Returns:

The index, as stated.

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.AldecUCDB.Statement(file, lineNumber, index, bins)[source]

A statement of a source line: its statement bins - of one instance, or merged, of all instances -, and how often it ran.

A statement isn’t an element of the format: Report.IterateStatements() computes it from the bins.

Inheritance

Inheritance diagram of Statement

Parameters:
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

__init__(file, lineNumber, index, bins)[source]

Initialize the statement, its count and whether it is excluded.

Parameters:
  • file (Path) – Path of the source file, as the bins’ source locations state it.

  • lineNumber (int) – Line number, counted from 1.

  • index (int) – Index of the statement in its line, counted from 1.

  • bins (Iterable[Bin]) – The statement bins of the statement: one, or of all instances, if merged.

Raises:
Return type:

None

_file: Path

Path of the source file.

_lineNumber: int

Line number, counted from 1.

_index: int

Index of the statement in its line.

_bins: list[Bin]

The statement bins of the statement.

_count: int

How often the statement ran: the sum of its bins’ counts, without the excluded ones.

_isExcluded: bool

Whether all the statement’s bins are excluded.

property File: Path

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

Returns:

The path, as the bins’ source locations state it.

property LineNumber: int

Read-only property to access the line number (_lineNumber).

Returns:

The line number, counted from 1.

property Index: int

Read-only property to access the index of the statement in its line (_index).

Returns:

The index, counted from 1.

property Bins: list[Bin]

Read-only property to access the statement bins of the statement (_bins).

Returns:

The bins: one, or of all instances, if merged.

property Count: int

Read-only property to access how often the statement ran (_count).

Returns:

The sum of the counts of the bins, which aren’t excluded.

property IsExcluded: bool

Read-only property to access whether the statement is excluded from the measurement (_isExcluded).

Returns:

True, if all its bins are excluded.

class pyEDAA.Reports.CodeCoverage.AldecUCDB.Report[source]

The root element <ux:ucdb>: the tool, which wrote it, its attributes, the history nodes, the scopes and the commands.

The root of the format’s model: a history node, a scope or a command names it as its parent.

Inheritance

Inheritance diagram of Report

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

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.

static _ParseAttributes(element)

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the 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.

__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

_attributes: dict[str, int | float | str]

The attributes, by key.

__init__()[source]

Initialize an empty report.

Return type:

None

_tool: str | None

Name of the tool, which wrote the report.

_toolVersion: CalendarVersion | None

Version of the tool, which wrote the report.

_historyNodes: list[HistoryNode[Report]]

The history nodes.

_scopes: list[Scope[Report]]

The top-level scopes.

_commands: list[Command]

The commands.

property Tool: str | None

Read-only property to access the name of the tool, which wrote the report (_tool).

Returns:

The tool’s name, e.g. Riviera-PRO; None before the report was converted.

property ToolVersion: CalendarVersion | None

Read-only property to access the version of the tool, which wrote the report (_toolVersion).

Returns:

The tool’s version, e.g. 2022.04; None before the report was converted.

property HistoryNodes: list[HistoryNode[Report]]

Read-only property to access the history nodes (_historyNodes).

Returns:

The history nodes, in the order the report lists them: the tests, or the merge of the tests.

property Scopes: list[Scope[Report]]

Read-only property to access the top-level scopes (_scopes).

Returns:

The scopes, in the order the report lists them: e.g. the design units and the top-level instances.

property Commands: list[Command]

Read-only property to access the commands (_commands).

Returns:

The commands, in the order the report lists them.

IterateStatements(mergeInstances=False)[source]

Iterate the statements: the statement bins of the instances.

The statement bins are those of the scopes below each top-level scope, which isn’t a design unit. A statement is identified by its file, its line and its index in the line - attribute #SINDEX# of its bin.

Parameters:

mergeInstances (bool) – Optional, if true, merge the bins of all instances, which identify the same statement, into one statement; otherwise each bin is a statement. Default: False.

Return type:

Generator[Statement]

Returns:

A generator of the statements, in the order of their first bin.

Raises:
class pyEDAA.Reports.CodeCoverage.AldecUCDB.Document(xmlReportFile, analyzeAndConvert=False)[source]

An Aldec UCDB XML code coverage report: read into the format’s model, and converted to the common model.

Inheritance

Inheritance diagram of Document

Parameters:
  • xmlReportFile (Path)

  • analyzeAndConvert (bool)

_attributes: dict[str, int | float | str]

The attributes, by key.

_tool: str | None

Name of the tool, which wrote the report.

_toolVersion: CalendarVersion | None

Version of the tool, which wrote the report.

_historyNodes: list[HistoryNode[Report]]

The history nodes.

_scopes: list[Scope[Report]]

The top-level scopes.

_commands: list[Command]

The commands.

property AnalysisDuration: timedelta | None

Read-only property to access the duration of Analyze(): reading, parsing and validating the file (_analysisDuration).

Returns:

The duration, or None if the file wasn’t analyzed yet.

property Attributes: dict[str, int | float | str]

Read-only property to access the attributes (_attributes).

Returns:

The attributes by key, e.g. #SINDEX# - a statement’s index in its line - or UCIS:tool.

property Commands: list[Command]

Read-only property to access the commands (_commands).

Returns:

The commands, in the order the report lists them.

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 HistoryNodes: list[HistoryNode[Report]]

Read-only property to access the history nodes (_historyNodes).

Returns:

The history nodes, in the order the report lists them: the tests, or the merge of the tests.

IterateStatements(mergeInstances=False)

Iterate the statements: the statement bins of the instances.

The statement bins are those of the scopes below each top-level scope, which isn’t a design unit. A statement is identified by its file, its line and its index in the line - attribute #SINDEX# of its bin.

Parameters:

mergeInstances (bool) – Optional, if true, merge the bins of all instances, which identify the same statement, into one statement; otherwise each bin is a statement. Default: False.

Return type:

Generator[Statement]

Returns:

A generator of the statements, in the order of their first bin.

Raises:
property ModelConversionDuration: timedelta | None

Read-only property to access the duration of Convert(): building the report format’s model (_conversionDuration).

Returns:

The duration, or None if the content wasn’t converted yet.

property ReportFile: Path

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

Returns:

The report file’s path.

property Scopes: list[Scope[Report]]

Read-only property to access the top-level scopes (_scopes).

Returns:

The scopes, in the order the report lists them: e.g. the design units and the top-level instances.

property Tool: str | None

Read-only property to access the name of the tool, which wrote the report (_tool).

Returns:

The tool’s name, e.g. Riviera-PRO; None before the report was converted.

property ToolVersion: CalendarVersion | None

Read-only property to access the version of the tool, which wrote the report (_toolVersion).

Returns:

The tool’s version, e.g. 2022.04; None before the report was converted.

static _ParseAttributes(element)

Parse the attributes an element states, from its <ux:attr> elements.

Parameters:

element (_Element) – The element stating the attributes.

Return type:

dict[str, int | float | str]

Returns:

The attributes by key, each value of the type the attribute states.

Raises:

CodeCoverageError – If an attribute’s value isn’t of the type the 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

_analysisDuration: timedelta | None

Duration of Analyze(), or None before it ran.

_conversionDuration: timedelta | None

Duration of Convert(), or None before it ran.

_path: Path

Path to the report file.

__init__(xmlReportFile, analyzeAndConvert=False)[source]

Initialize the report, and optionally read it.

Parameters:
  • xmlReportFile (Path) – Path to the UCDB XML file.

  • analyzeAndConvert (bool) – Optional, if true, analyze the file and convert its content. Default: False.

Return type:

None

_xmlDocument: _ElementTree | None

The parsed and validated XML document, after Analyze().

Analyze()[source]

Parse the XML file, check its root element, and validate the file against the XML schema (SCHEMA).

Raises:
Return type:

None

Convert()[source]

Convert the parsed and validated XML document to the format’s model.

Raises:
  • CodeCoverageError – If the XML file was not analyzed before.
    Call ‘Document.Analyze()’ or create the document using ‘Document(path, analyzeAndConvert=True)’.

  • CodeCoverageError – If an attribute’s value isn’t of the type the attribute states.

Return type:

None

ToCoverageSummary(mergeInstances=False)[source]

Convert the statement coverage of the format’s model to the common model, and aggregate it.

A line ran as often as its least often run statement (IterateStatements()): it is covered, if all its statements ran, otherwise uncovered. A line, whose statements are all excluded, is excluded.

Parameters:

mergeInstances (bool) – Optional, if true, merge the statements of all instances of a design unit. Default: False.

Return type:

CoverageSummary

Returns:

The report’s root of the common model, named after the report file. Its source directories are the directories the tool ran in.

Raises: