pyVHDLModel.PSLModel

This module contains an abstract document language model for PSL in VHDL.

Classes


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

Inheritance diagram of PSLEntity

Parameters:

parent (ModelEntity | None)

GetAncestor(type)

Return the closest ancestor of the given type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Parent: ModelEntity

Property to access the model entity’s parent element reference in a logical hierarchy (_parent).

Returns:

Reference to the parent entity.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__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

Inheritance diagram of PSLPrimaryUnit

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

Property to access the document (_document).

Returns:

The document.

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 type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property 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 Library: Library

Property to access the library (_parent).

Returns:

The library.

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.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__init__(identifier, contextItems=None, documentation=None, parent=None)

Initializes a design unit.

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

str

Returns:

Formatted design unit.

_contextItems

List of all context items (library, use and context clauses).

_contextReferences

List of context clauses.

_continuesParentRegion = False

True if it continues its parent’s declarative region.

_dependencyVertex

Reference to the vertex in the dependency graph representing the design unit.
This reference is set by CreateDependencyGraph().

_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

Inheritance diagram of VerificationUnit

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:

str

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

Property to access the document (_document).

Returns:

The document.

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 type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property 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 Library: Library

Property to access the library (_parent).

Returns:

The library.

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.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__new__(**kwargs)
_contextItems

List of all context items (library, use and context clauses).

_contextReferences

List of context clauses.

_continuesParentRegion = False

True if it continues its parent’s declarative region.

_dependencyVertex

Reference to the vertex in the dependency graph representing the design unit.
This reference is set by CreateDependencyGraph().

_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

Inheritance diagram of VerificationProperty

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:

str

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

Property to access the document (_document).

Returns:

The document.

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 type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property 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 Library: Library

Property to access the library (_parent).

Returns:

The library.

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.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__new__(**kwargs)
_contextItems

List of all context items (library, use and context clauses).

_contextReferences

List of context clauses.

_continuesParentRegion = False

True if it continues its parent’s declarative region.

_dependencyVertex

Reference to the vertex in the dependency graph representing the design unit.
This reference is set by CreateDependencyGraph().

_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

Inheritance diagram of VerificationMode

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:

str

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

Property to access the document (_document).

Returns:

The document.

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 type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property 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 Library: Library

Property to access the library (_parent).

Returns:

The library.

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.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__new__(**kwargs)
_contextItems

List of all context items (library, use and context clauses).

_contextReferences

List of context clauses.

_continuesParentRegion = False

True if it continues its parent’s declarative region.

_dependencyVertex

Reference to the vertex in the dependency graph representing the design unit.
This reference is set by CreateDependencyGraph().

_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

Inheritance diagram of DefaultClock

Parameters:
  • identifier (str)

  • documentation (str | None)

__init__(identifier, documentation=None)[source]

Initializes a PSL default clock declaration.

Parameters:
  • identifier (str) – The identifier of a model entity.

  • documentation (str | None) – The documentation comment associated with this declaration.

Return type:

None

__str__()[source]

Formats the default clock declaration.

Format: default clock myClock

Return type:

str

Returns:

Formatted default clock declaration.

_identifier: str

The identifier of a model entity.

_normalizedIdentifier: str

The normalized (lower case) identifier of a model entity.

_documentation: str | None

The associated documentation of a model entity.

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 type found 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:

ModelEntity

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, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

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

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.