pyGHDL.dom.PSL

This module contains all DOM classes for VHDL’s design units (context, architecture, package, package body, context and configuration.

Classes


Classes

class pyGHDL.dom.PSL.VerificationUnit(node, identifier)[source]

Inheritance

Inheritance diagram of VerificationUnit

Parameters:
__init__(node, identifier)[source]

Initializes a PSL verification unit (vunit).

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

  • node (Iir)

Return type:

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 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 Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

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)
__str__()[source]

Formats the verification unit declaration.

Format: vunit myUnit

Return type:

str

Returns:

Formatted verification unit declaration.

_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 pyGHDL.dom.PSL.VerificationProperty(node, identifier)[source]

Inheritance

Inheritance diagram of VerificationProperty

Parameters:
__init__(node, identifier)[source]

Initializes a PSL verification property (vprop).

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

  • node (Iir)

Return type:

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 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 Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

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)
__str__()[source]

Formats the verification property declaration.

Format: vprop myUnit

Return type:

str

Returns:

Formatted verification property declaration.

_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 pyGHDL.dom.PSL.VerificationMode(node, identifier)[source]

Inheritance

Inheritance diagram of VerificationMode

Parameters:
__init__(node, identifier)[source]

Initializes a PSL verification mode (vmode).

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

  • node (Iir)

Return type:

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 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 Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

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)
__str__()[source]

Formats the verification mode declaration.

Format: vmode myUnit

Return type:

str

Returns:

Formatted verification mode declaration.

_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 pyGHDL.dom.PSL.DefaultClock(node, identifier, documentation=None)[source]

Inheritance

Inheritance diagram of DefaultClock

Parameters:
  • node (Iir)

  • identifier (str)

  • documentation (str)

__init__(node, identifier, documentation=None)[source]

Initializes a PSL default clock declaration.

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

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

  • node (Iir)

Return type:

None

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.

property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the default clock declaration.

Format: default clock myClock

Return type:

str

Returns:

Formatted default clock declaration.

_documentation: str | None

The associated documentation of a model entity.

_identifier: str

The identifier of a model entity.

_normalizedIdentifier: str

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.