pyVHDLModel.PSLModel
This module contains an abstract document language model for PSL in VHDL.
Classes
PSLEntity: Represents the base-class of all PSL entities.PSLPrimaryUnit: Represents the base-class of all PSL primary units.VerificationUnit: Represents a PSL verification unit (vunit).VerificationProperty: Represents a PSL verification property (vprop).VerificationMode: Represents a PSL verification mode (vmode).DefaultClock: Represents a PSL default clock declaration.
Classes
- class pyVHDLModel.PSLModel.PSLEntity(parent=None)[source]
Represents the base-class of all PSL entities.
PSL (Property Specification Language) support is rudimentary: verification units are recognised and named, but their contents are not modelled.
See also
Inheritance
- Parameters:
parent (ModelEntity | None)
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- __init__(parent=None)
Initializes a VHDL model entity.
- Parameters:
parent (
ModelEntity|None) – The parent model entity of this entity.- Return type:
None
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyVHDLModel.PSLModel.PSLPrimaryUnit(identifier, contextItems=None, documentation=None, parent=None)[source]
Represents the base-class of all PSL primary units.
Inheritance
- Parameters:
identifier (str)
contextItems (Iterable[LibraryClause | UseClause | ContextReference] | None)
documentation (str | None)
parent (ModelEntity | None)
- property ContextItems: List[LibraryClause | UseClause | ContextReference]
Read-only property to access the sequence of all context items comprising library, use and context clauses (
_contextItems).- Returns:
Sequence of context items.
- property ContextReferences: List[ContextReference]
Read-only property to access the sequence of context clauses (
_contextReferences).- Returns:
Sequence of context clauses.
- property DependencyVertex: Vertex
Read-only property to access the corresponding dependency vertex (
_dependencyVertex).The dependency vertex references this design unit by its value field.
- Returns:
The corresponding dependency vertex.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 HierarchyVertex: Vertex
Read-only property to access the corresponding hierarchy vertex (
_hierarchyVertex).The hierarchy vertex references this design unit by its value field.
- Returns:
The corresponding hierarchy vertex.
- property Identifier: str
Read-only property to access the model entity’s identifier (
_identifier).- Returns:
Name of a model entity.
- property LibraryReferences: List[LibraryClause]
Read-only property to access the sequence of library clauses (
_libraryReferences).- Returns:
Sequence of library clauses.
- property NormalizedIdentifier: str
Read-only property to access the model entity’s normalized identifier (
_normalizedIdentifier).- Returns:
Normalized name of a model entity.
- property PackageReferences: List[UseClause]
Read-only property to access the sequence of use clauses (
_packageReferences).- Returns:
Sequence of use clauses.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property ReferencedContexts: Dict[str, Context]
Read-only property to access the referenced contexts (
_referencedContexts).- Returns:
Dictionary of referenced contexts, indexed by normalized identifier.
- property ReferencedLibraries: Dict[str, Library]
Read-only property to access the referenced libraries (
_referencedLibraries).- Returns:
Dictionary of referenced libraries, indexed by normalized identifier.
- property ReferencedPackages: Dict[str, Package]
Read-only property to access the referenced packages (
_referencedPackages).- Returns:
Dictionary of referenced packages, indexed by normalized identifier.
- __init__(identifier, contextItems=None, documentation=None, parent=None)
Initializes a design unit.
- Parameters:
identifier (
str) – Identifier (name) of the design unit.contextItems (
Iterable[LibraryClause|UseClause|ContextReference] |None) – A sequence of library, use or context clauses.documentation (
str|None) – Associated documentation of the design unit.parent (
ModelEntity|None) – Reference to the logical parent in the model hierarchy.
- Return type:
None
- __new__(**kwargs)
- __str__()
Formats the design unit.
Every concrete design unit renders itself, so this base-class provides no implementation.
- Return type:
- Returns:
Formatted design unit.
- _contextItems
List of all context items (library, use and context clauses).
- _contextReferences
List of context clauses.
- _continuesParentRegion = False
Trueif it continues its parent’s declarative region.
- _dependencyVertex
Reference to the vertex in the dependency graph representing the design unit.
This reference is set byCreateDependencyGraph().
- _document
The VHDL library, the design unit was analyzed into.
- _documentation
The associated documentation of a model entity.
- _hierarchyVertex
The vertex in the hierarchy graph
- _identifier
The identifier of a model entity.
- _libraryReferences
List of library clauses.
- _namespace
The namespace of this design unit’s declarative region.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _packageReferences
List of use clauses.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _referencedContexts
Referenced contexts based on explicit context references or implicit inheritance
- _referencedLibraries
Referenced libraries based on explicit library clauses or implicit inheritance
- _referencedPackages
Referenced packages based on explicit use clauses or implicit inheritance
- class pyVHDLModel.PSLModel.VerificationUnit(identifier)[source]
Represents a PSL verification unit (
vunit).Inheritance
- Parameters:
identifier (str)
- __init__(identifier)[source]
Initializes a PSL verification unit (
vunit).- Parameters:
identifier (
str) – The identifier of a model entity.- Return type:
None
- __str__()[source]
Formats the verification unit declaration.
Format:
vunit myUnit- Return type:
- Returns:
Formatted verification unit declaration.
- property ContextItems: List[LibraryClause | UseClause | ContextReference]
Read-only property to access the sequence of all context items comprising library, use and context clauses (
_contextItems).- Returns:
Sequence of context items.
- property ContextReferences: List[ContextReference]
Read-only property to access the sequence of context clauses (
_contextReferences).- Returns:
Sequence of context clauses.
- property DependencyVertex: Vertex
Read-only property to access the corresponding dependency vertex (
_dependencyVertex).The dependency vertex references this design unit by its value field.
- Returns:
The corresponding dependency vertex.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 HierarchyVertex: Vertex
Read-only property to access the corresponding hierarchy vertex (
_hierarchyVertex).The hierarchy vertex references this design unit by its value field.
- Returns:
The corresponding hierarchy vertex.
- property Identifier: str
Read-only property to access the model entity’s identifier (
_identifier).- Returns:
Name of a model entity.
- property LibraryReferences: List[LibraryClause]
Read-only property to access the sequence of library clauses (
_libraryReferences).- Returns:
Sequence of library clauses.
- property NormalizedIdentifier: str
Read-only property to access the model entity’s normalized identifier (
_normalizedIdentifier).- Returns:
Normalized name of a model entity.
- property PackageReferences: List[UseClause]
Read-only property to access the sequence of use clauses (
_packageReferences).- Returns:
Sequence of use clauses.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property ReferencedContexts: Dict[str, Context]
Read-only property to access the referenced contexts (
_referencedContexts).- Returns:
Dictionary of referenced contexts, indexed by normalized identifier.
- property ReferencedLibraries: Dict[str, Library]
Read-only property to access the referenced libraries (
_referencedLibraries).- Returns:
Dictionary of referenced libraries, indexed by normalized identifier.
- property ReferencedPackages: Dict[str, Package]
Read-only property to access the referenced packages (
_referencedPackages).- Returns:
Dictionary of referenced packages, indexed by normalized identifier.
- __new__(**kwargs)
- _contextItems
List of all context items (library, use and context clauses).
- _contextReferences
List of context clauses.
- _continuesParentRegion = False
Trueif it continues its parent’s declarative region.
- _dependencyVertex
Reference to the vertex in the dependency graph representing the design unit.
This reference is set byCreateDependencyGraph().
- _document
The VHDL library, the design unit was analyzed into.
- _documentation
The associated documentation of a model entity.
- _hierarchyVertex
The vertex in the hierarchy graph
- _identifier
The identifier of a model entity.
- _libraryReferences
List of library clauses.
- _namespace
The namespace of this design unit’s declarative region.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _packageReferences
List of use clauses.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _referencedContexts
Referenced contexts based on explicit context references or implicit inheritance
- _referencedLibraries
Referenced libraries based on explicit library clauses or implicit inheritance
- _referencedPackages
Referenced packages based on explicit use clauses or implicit inheritance
- class pyVHDLModel.PSLModel.VerificationProperty(identifier)[source]
Represents a PSL verification property (
vprop).Inheritance
- Parameters:
identifier (str)
- __init__(identifier)[source]
Initializes a PSL verification property (
vprop).- Parameters:
identifier (
str) – The identifier of a model entity.- Return type:
None
- __str__()[source]
Formats the verification property declaration.
Format:
vprop myUnit- Return type:
- Returns:
Formatted verification property declaration.
- property ContextItems: List[LibraryClause | UseClause | ContextReference]
Read-only property to access the sequence of all context items comprising library, use and context clauses (
_contextItems).- Returns:
Sequence of context items.
- property ContextReferences: List[ContextReference]
Read-only property to access the sequence of context clauses (
_contextReferences).- Returns:
Sequence of context clauses.
- property DependencyVertex: Vertex
Read-only property to access the corresponding dependency vertex (
_dependencyVertex).The dependency vertex references this design unit by its value field.
- Returns:
The corresponding dependency vertex.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 HierarchyVertex: Vertex
Read-only property to access the corresponding hierarchy vertex (
_hierarchyVertex).The hierarchy vertex references this design unit by its value field.
- Returns:
The corresponding hierarchy vertex.
- property Identifier: str
Read-only property to access the model entity’s identifier (
_identifier).- Returns:
Name of a model entity.
- property LibraryReferences: List[LibraryClause]
Read-only property to access the sequence of library clauses (
_libraryReferences).- Returns:
Sequence of library clauses.
- property NormalizedIdentifier: str
Read-only property to access the model entity’s normalized identifier (
_normalizedIdentifier).- Returns:
Normalized name of a model entity.
- property PackageReferences: List[UseClause]
Read-only property to access the sequence of use clauses (
_packageReferences).- Returns:
Sequence of use clauses.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property ReferencedContexts: Dict[str, Context]
Read-only property to access the referenced contexts (
_referencedContexts).- Returns:
Dictionary of referenced contexts, indexed by normalized identifier.
- property ReferencedLibraries: Dict[str, Library]
Read-only property to access the referenced libraries (
_referencedLibraries).- Returns:
Dictionary of referenced libraries, indexed by normalized identifier.
- property ReferencedPackages: Dict[str, Package]
Read-only property to access the referenced packages (
_referencedPackages).- Returns:
Dictionary of referenced packages, indexed by normalized identifier.
- __new__(**kwargs)
- _contextItems
List of all context items (library, use and context clauses).
- _contextReferences
List of context clauses.
- _continuesParentRegion = False
Trueif it continues its parent’s declarative region.
- _dependencyVertex
Reference to the vertex in the dependency graph representing the design unit.
This reference is set byCreateDependencyGraph().
- _document
The VHDL library, the design unit was analyzed into.
- _documentation
The associated documentation of a model entity.
- _hierarchyVertex
The vertex in the hierarchy graph
- _identifier
The identifier of a model entity.
- _libraryReferences
List of library clauses.
- _namespace
The namespace of this design unit’s declarative region.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _packageReferences
List of use clauses.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _referencedContexts
Referenced contexts based on explicit context references or implicit inheritance
- _referencedLibraries
Referenced libraries based on explicit library clauses or implicit inheritance
- _referencedPackages
Referenced packages based on explicit use clauses or implicit inheritance
- class pyVHDLModel.PSLModel.VerificationMode(identifier)[source]
Represents a PSL verification mode (
vmode).Inheritance
- Parameters:
identifier (str)
- __init__(identifier)[source]
Initializes a PSL verification mode (
vmode).- Parameters:
identifier (
str) – The identifier of a model entity.- Return type:
None
- __str__()[source]
Formats the verification mode declaration.
Format:
vmode myUnit- Return type:
- Returns:
Formatted verification mode declaration.
- property ContextItems: List[LibraryClause | UseClause | ContextReference]
Read-only property to access the sequence of all context items comprising library, use and context clauses (
_contextItems).- Returns:
Sequence of context items.
- property ContextReferences: List[ContextReference]
Read-only property to access the sequence of context clauses (
_contextReferences).- Returns:
Sequence of context clauses.
- property DependencyVertex: Vertex
Read-only property to access the corresponding dependency vertex (
_dependencyVertex).The dependency vertex references this design unit by its value field.
- Returns:
The corresponding dependency vertex.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 HierarchyVertex: Vertex
Read-only property to access the corresponding hierarchy vertex (
_hierarchyVertex).The hierarchy vertex references this design unit by its value field.
- Returns:
The corresponding hierarchy vertex.
- property Identifier: str
Read-only property to access the model entity’s identifier (
_identifier).- Returns:
Name of a model entity.
- property LibraryReferences: List[LibraryClause]
Read-only property to access the sequence of library clauses (
_libraryReferences).- Returns:
Sequence of library clauses.
- property NormalizedIdentifier: str
Read-only property to access the model entity’s normalized identifier (
_normalizedIdentifier).- Returns:
Normalized name of a model entity.
- property PackageReferences: List[UseClause]
Read-only property to access the sequence of use clauses (
_packageReferences).- Returns:
Sequence of use clauses.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property ReferencedContexts: Dict[str, Context]
Read-only property to access the referenced contexts (
_referencedContexts).- Returns:
Dictionary of referenced contexts, indexed by normalized identifier.
- property ReferencedLibraries: Dict[str, Library]
Read-only property to access the referenced libraries (
_referencedLibraries).- Returns:
Dictionary of referenced libraries, indexed by normalized identifier.
- property ReferencedPackages: Dict[str, Package]
Read-only property to access the referenced packages (
_referencedPackages).- Returns:
Dictionary of referenced packages, indexed by normalized identifier.
- __new__(**kwargs)
- _contextItems
List of all context items (library, use and context clauses).
- _contextReferences
List of context clauses.
- _continuesParentRegion = False
Trueif it continues its parent’s declarative region.
- _dependencyVertex
Reference to the vertex in the dependency graph representing the design unit.
This reference is set byCreateDependencyGraph().
- _document
The VHDL library, the design unit was analyzed into.
- _documentation
The associated documentation of a model entity.
- _hierarchyVertex
The vertex in the hierarchy graph
- _identifier
The identifier of a model entity.
- _libraryReferences
List of library clauses.
- _namespace
The namespace of this design unit’s declarative region.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _packageReferences
List of use clauses.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _referencedContexts
Referenced contexts based on explicit context references or implicit inheritance
- _referencedLibraries
Referenced libraries based on explicit library clauses or implicit inheritance
- _referencedPackages
Referenced packages based on explicit use clauses or implicit inheritance
- class pyVHDLModel.PSLModel.DefaultClock(identifier, documentation=None)[source]
Represents a PSL default clock declaration.
It names the clock expression used by PSL directives that do not state one themselves.
Inheritance
- __str__()[source]
Formats the default clock declaration.
Format:
default clock myClock- Return type:
- Returns:
Formatted default clock declaration.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – 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 Identifier: str
Read-only property to access the model entity’s identifier (
_identifier).- Returns:
Name of a model entity.
- property NormalizedIdentifier: str
Read-only property to access the model entity’s normalized identifier (
_normalizedIdentifier).- Returns:
Normalized name of a model entity.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.