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 fromBase.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 prefixUCIS_, e.g.DU_MODULEforUCIS_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#); withmergeInstances, 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 itstypestates: a design unit, an instance of one, or a scope of a coverage kind.CoverType: Kind of a<ux:bin>, as itstypestates.Language: Language of the source of a<ux:scope>, as itslangstates.HistoryNodeKind: Kind of a<ux:hnode>, as itstypestates.BinFlags: Flags of a<ux:bin>, as itsflagsstate 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 itReport: The root element<ux:ucdb>: the tool, which wrote it, its attributes, the history nodes, the scopes and theDocument: 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: aReportor aHistoryNode.~HistoryNodeParentType
- pyEDAA.Reports.CodeCoverage.AldecUCDB.ScopeParentType
A type variable for the parent of a
Scope: aReportor aScope.~ScopeParentType
Classes
- class pyEDAA.Reports.CodeCoverage.AldecUCDB.ScopeType(*values)[source]
Kind of a
<ux:scope>, as itstypestates: a design unit, an instance of one, or a scope of a coverage kind.Inheritance
- 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
alwaysblock.
- Block = 'BLOCK'
A block, e.g. a VHDL
blockstatement.
- Function = 'FUNCTION'
A function.
- ForkJoin = 'FORKJOIN'
A Verilog
fork ... joinblock.
- 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.Noneand the empty string mean no value was given.- Return type:
- Returns:
The member carrying that value. If no value was given:
DEFAULT, if the enumeration declares one, otherwiseNone.- Raises:
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 itstypestates.A kind Aldec’s export has no name for is stated by its value in hexadecimal, as the UCIS C API defines it.
Inheritance
- 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.Noneand the empty string mean no value was given.- Return type:
- Returns:
The member carrying that value. If no value was given:
DEFAULT, if the enumeration declares one, otherwiseNone.- Raises:
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 itslangstates.Inheritance
- 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.Noneand the empty string mean no value was given.- Return type:
- Returns:
The member carrying that value. If no value was given:
DEFAULT, if the enumeration declares one, otherwiseNone.- Raises:
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 itstypestates.Inheritance
- 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 itsflagsstate in hexadecimal; a flag not named here is kept.Inheritance
- 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:
intisint,doubleisfloat,strisstr.Inheritance
- __init__(attributes=None)[source]
Initialize the attributes.
- static _ParseAttributes(element)[source]
Parse the attributes an element states, from its
<ux:attr>elements.
- 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- class pyEDAA.Reports.CodeCoverage.AldecUCDB.Base(name)[source]
Base-class of the named elements below the report.
Scopes and bins are named elements.
Inheritance
- Parameters:
name (str)
- __init__(name)[source]
Initialize the name of the element.
- Parameters:
name (
str) – Name of the element.- Raises:
ValueError – If parameter
nameisNone.
- Return type:
None
- 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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __new__(**kwargs)
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- 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
- __init__(file, workDirectory, lineNumber, token)[source]
Initialize the source location.
- Parameters:
- Raises:
ValueError – If parameter
fileisNone.ValueError – If parameter
workDirectoryisNone.ValueError – If parameter
lineNumberisNone.ValueError – If parameter
lineNumberis negative.ValueError – If parameter
tokenisNone.ValueError – If parameter
tokenis negative.
- Return type:
None
- _file: Path
Path of the source file, relative to
_workDirectory, if not absolute.
- classmethod Parse(element)[source]
Parse a source location from its
<ux:src>element.- Parameters:
element (
_Element) – The<ux:src>element.- Return type:
- 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;
0for 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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- class pyEDAA.Reports.CodeCoverage.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
- 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:
ValueError – If parameter
nameisNone.TypeError – If parameter
attributesisn’t a mapping.TypeError – If parameter
attributescontains a key not of typestr.ValueError – If parameter
attributescontains an empty key.TypeError – If parameter
attributescontains a value not of typeint,floatorstr.ValueError – If parameter
coverTypeisNone.ValueError – If parameter
flagsisNone.ValueError – If parameter
countisNone.ValueError – If parameter
countis negative.ValueError – If parameter
sourceisNone.TypeError – If parameter
sourceisn’t of typeSourceLocation.
- Return type:
None
- _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:
- Return type:
- 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;
Noneif 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, ifFlagshas 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.
- 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __new__(**kwargs)
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- 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
- 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.counterfor a design unit oruutfor 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:
ValueError – If parameter
nameisNone.TypeError – If parameter
attributesisn’t a mapping.TypeError – If parameter
attributescontains a key not of typestr.ValueError – If parameter
attributescontains an empty key.TypeError – If parameter
attributescontains a value not of typeint,floatorstr.ValueError – If parameter
nameis empty.ValueError – If parameter
scopeTypeisNone.ValueError – If parameter
languageisNone.ValueError – If parameter
weightisNone.ValueError – If parameter
weightis negative.ValueError – If parameter
flagsisNone.ValueError – If parameter
flagsis negative.ValueError – If parameter
sourceisNone.TypeError – If parameter
sourceisn’t of typeSourceLocation.ValueError – If parameter
designUnitis empty.TypeError – If parameter
parentisn’t of typeReportorScope.
- Return type:
None
- _parent: ScopeParentType | None
The report or scope the scope belongs to.
- _source: SourceLocation
Where the scope is in the sources.
- 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:
- 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.
- property Parent: ScopeParentType | None
Read-only property to access the report or scope the scope belongs to (
_parent).
- 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;Nonefor 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.
- 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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.
- 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.
- 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.
- 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
- Parameters:
name (str)
physicalName (Path)
kind (HistoryNodeKind)
parent (Nullable[HistoryNodeParentType])
- __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:
ValueError – If parameter
nameisNone.TypeError – If parameter
attributesisn’t a mapping.TypeError – If parameter
attributescontains a key not of typestr.ValueError – If parameter
attributescontains an empty key.TypeError – If parameter
attributescontains a value not of typeint,floatorstr.ValueError – If parameter
nameis empty.ValueError – If parameter
physicalNameisNone.ValueError – If parameter
kindisNone.TypeError – If parameter
kindisn’t of typeHistoryNodeKind.TypeError – If parameter
parentisn’t of typeReportorHistoryNode.
- Return type:
None
- _parent: HistoryNodeParentType | None
The report or merge the history node belongs to.
- _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:
- 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
ReportorHistoryNode;Noneif 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.
- 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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.
- 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.
- 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.
- 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
- __init__(commandType, flags, data, index, *, parent=None)[source]
Initialize the command, and append it to the commands of its report.
- Parameters:
- Raises:
ValueError – If parameter
commandTypeisNone.ValueError – If parameter
flagsisNone.ValueError – If parameter
flagsis negative.ValueError – If parameter
dataisNone.ValueError – If parameter
indexisNone.ValueError – If parameter
indexis negative.
- Return type:
None
- property Parent: Report | None
Read-only property to access the report the command belongs to (
_parent).- Returns:
The report;
Noneif 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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- class pyEDAA.Reports.CodeCoverage.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
- classmethod GetMethodsWithAttributes(predicate=None)
Return the class’ methods that carry at least one matching attribute.
- Parameters:
predicate (
type[TAttr] |Iterable[type[TAttr]] |None) – Optional, an attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- __init__(file, lineNumber, index, bins)[source]
Initialize the statement, its count and whether it is excluded.
- Parameters:
- Raises:
ValueError – If parameter
fileisNone.ValueError – If parameter
lineNumberisNone.ValueError – If parameter
lineNumberis less than 1.ValueError – If parameter
indexisNone.ValueError – If parameter
indexis negative.ValueError – If parameter
binsisNone.TypeError – If parameter
binsisn’t iterable.TypeError – If parameter
binscontains an element not of typeBin.ValueError – If parameter
binsis empty.
- Return type:
None
- 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
- 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- static _ParseAttributes(element)
Parse the attributes an element states, from its
<ux:attr>elements.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- _toolVersion: CalendarVersion | None
Version of the tool, which wrote the report.
- _historyNodes: list[HistoryNode[Report]]
The history nodes.
- 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;Nonebefore 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;Nonebefore 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:
- Returns:
A generator of the statements, in the order of their first bin.
- Raises:
ValueError – If parameter
mergeInstancesisNone.CodeCoverageError – If a statement bin states no statement index.
- 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
- _toolVersion: CalendarVersion | None
Version of the tool, which wrote the report.
- _historyNodes: list[HistoryNode[Report]]
The history nodes.
- property AnalysisDuration: timedelta | None
Read-only property to access the duration of
Analyze(): reading, parsing and validating the file (_analysisDuration).- Returns:
The duration, or
Noneif 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 - orUCIS: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, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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:
- Returns:
A generator of the statements, in the order of their first bin.
- Raises:
ValueError – If parameter
mergeInstancesisNone.CodeCoverageError – If a statement bin states no statement index.
- property ModelConversionDuration: timedelta | None
Read-only property to access the duration of
Convert(): building the report format’s model (_conversionDuration).- Returns:
The duration, or
Noneif 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;Nonebefore 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;Nonebefore the report was converted.
- static _ParseAttributes(element)
Parse the attributes an element states, from its
<ux:attr>elements.
- __getstate__()
Return the object’s state for pickling, collecting every slot of the class hierarchy.
- __new__(**kwargs)
- __setstate__(state)
Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.
- __init__(xmlReportFile, analyzeAndConvert=False)[source]
Initialize the report, and optionally read it.
- Analyze()[source]
Parse the XML file, check its root element, and validate the file against the XML schema (
SCHEMA).- Raises:
CodeCoverageError – If the file doesn’t exist.
CodeCoverageError – If the file can’t be read.
CodeCoverageError – If the file isn’t well-formed XML.
CodeCoverageError – If the root element isn’t
<ux:ucdb>of namespacewww.aldec.com.CodeCoverageError – If the XML schema can’t be located or parsed.
CodeCoverageError – If the file isn’t valid according to the XML schema.
- Return type:
- 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:
- 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:
- 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:
ValueError – If parameter
mergeInstancesisNone.CodeCoverageError – If a statement bin states no statement index.
CodeCoverageError – If a file’s path runs through another file.