pyGHDL.dom.Concurrent

This module implements derived concurrent statement classes from pyVHDLModel.Concurrent.

Classes


Classes

class pyGHDL.dom.Concurrent.GenericAssociationItem(associationNode, formal, actual)[source]

A base-class for all generic association items used in generic map aspects.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Association.GenericAssociationItem.

Inheritance

Inheritance diagram of GenericAssociationItem

Parameters:
__init__(associationNode, formal, actual)[source]

Initializes a generic association item.

Parameters:
  • associationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the association element.

  • formal (Symbol) – Reference to the formal part, or None for a positional association.

  • actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the actual (_actual).

Returns:

The actual.

property Formal: Symbol | None

Read-only property to access the formal (_formal).

Returns:

The formal, or None if not set.

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.

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

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__()

Formats the association item.

Format: formal => actual, or actual alone when positional

Return type:

str

Returns:

Formatted association item.

_actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The actual part of this association.

_formal: Symbol | None

Reference to the formal part, or None for a positional association.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.PortAssociationItem(associationNode, formal, actual)[source]

A base-class for all port association items used in port map aspects.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Association.PortAssociationItem.

Inheritance

Inheritance diagram of PortAssociationItem

Parameters:
__init__(associationNode, formal, actual)[source]

Initializes a port association item.

Parameters:
  • associationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the association element.

  • formal (Symbol) – Reference to the formal part, or None for a positional association.

  • actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the actual (_actual).

Returns:

The actual.

property Formal: Symbol | None

Read-only property to access the formal (_formal).

Returns:

The formal, or None if not set.

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.

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

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__()

Formats the association item.

Format: formal => actual, or actual alone when positional

Return type:

str

Returns:

Formatted association item.

_actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The actual part of this association.

_formal: Symbol | None

Reference to the formal part, or None for a positional association.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.ParameterAssociationItem(associationNode, formal, actual)[source]

A base-class for all parameter association items used in parameter map aspects.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Association.ParameterAssociationItem.

Inheritance

Inheritance diagram of ParameterAssociationItem

Parameters:
__init__(associationNode, formal, actual)[source]

Initializes a parameter association item.

Parameters:
  • associationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the association element.

  • formal (Symbol) – Reference to the formal part, or None for a positional association.

  • actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the actual (_actual).

Returns:

The actual.

property Formal: Symbol | None

Read-only property to access the formal (_formal).

Returns:

The formal, or None if not set.

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.

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

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__()

Formats the association item.

Format: formal => actual, or actual alone when positional

Return type:

str

Returns:

Formatted association item.

_actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The actual part of this association.

_formal: Symbol | None

Reference to the formal part, or None for a positional association.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.ComponentInstantiation(instantiationNode, label, componentSymbol, genericAssociationItems=None, portAssociationItems=None)[source]

Represents a component instantiation.

The instantiated component is available as Component, the associations as GenericAssociationItems and PortAssociationItems. The label is mandatory.

Example

  inst : component Counter;
--^^^^                        <- Label
--                 ^^^^^^^    <- Component

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ComponentInstantiation.

Inheritance

Inheritance diagram of ComponentInstantiation

Parameters:
__init__(instantiationNode, label, componentSymbol, genericAssociationItems=None, portAssociationItems=None)[source]

Initializes a component instantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • label (str) – The label of the component instantiation statement.

  • componentSymbol (ComponentInstantiationSymbol) – Reference to the instantiated component.

  • genericAssociationItems (Iterable[AssociationItem]) – List of all generic associations in the generic map aspect.

  • portAssociationItems (Iterable[AssociationItem]) – List of all port associations in the port map aspect.

Return type:

None

classmethod parse(instantiationNode, instantiatedUnit, label)[source]

Translates the IIR node of the instantiation statement to a ComponentInstantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • instantiatedUnit (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiated unit.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ComponentInstantiation

Returns:

The translated instantiation statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Component: ComponentInstantiationSymbol

Read-only property to access the component (_component).

Returns:

The component.

property GenericAssociationItems: List[GenericAssociationItem]

Read-only property to access the generic associations (_genericAssociationItems).

Returns:

List of generic association items.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 PortAssociationItems: List[PortAssociationItem]

Read-only property to access the port associations (_portAssociationItems).

Returns:

List of port association items.

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

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]

_component: ComponentInstantiationSymbol

Reference to the instantiated component.

_genericAssociationItems: List[GenericAssociationItem]

List of all generic associations.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_portAssociationItems: List[PortAssociationItem]

List of all port associations.

class pyGHDL.dom.Concurrent.EntityInstantiation(instantiationNode, label, entitySymbol, architectureSymbol=None, genericAssociationItems=None, portAssociationItems=None)[source]

Represents a direct entity instantiation.

The instantiated entity is available as Entity and the optionally selected architecture as Architecture. The label is mandatory.

Example

  inst : entity work.Counter(rtl);
--^^^^                               <- Label
--              ^^^^^^^^^^^^         <- Entity
--                           ^^^     <- optional Architecture

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.EntityInstantiation.

Inheritance

Inheritance diagram of EntityInstantiation

Parameters:
__init__(instantiationNode, label, entitySymbol, architectureSymbol=None, genericAssociationItems=None, portAssociationItems=None)[source]

Initializes a direct entity instantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • label (str) – The label of the entity instantiation statement.

  • entitySymbol (EntityInstantiationSymbol) – Reference to the directly instantiated entity.

  • architectureSymbol (ArchitectureSymbol) – Reference to the selected architecture, if one was given.

  • genericAssociationItems (Iterable[AssociationItem]) – List of all generic associations in the generic map aspect.

  • portAssociationItems (Iterable[AssociationItem]) – List of all port associations in the port map aspect.

Return type:

None

classmethod parse(instantiationNode, instantiatedUnit, label)[source]

Translates the IIR node of the instantiation statement to an EntityInstantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • instantiatedUnit (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiated unit.

  • label (str) – The statement’s label, or None if it has none.

Return type:

EntityInstantiation

Returns:

The translated instantiation statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Architecture: ArchitectureSymbol

Read-only property to access the architecture (_architecture).

Returns:

The architecture.

property Entity: EntityInstantiationSymbol

Read-only property to access the entity (_entity).

Returns:

The entity.

property GenericAssociationItems: List[GenericAssociationItem]

Read-only property to access the generic associations (_genericAssociationItems).

Returns:

List of generic association items.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 PortAssociationItems: List[PortAssociationItem]

Read-only property to access the port associations (_portAssociationItems).

Returns:

List of port association items.

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

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]

_architecture: ArchitectureSymbol

Reference to the selected architecture, if one was given.

_entity: EntityInstantiationSymbol

Reference to the directly instantiated entity.

_genericAssociationItems: List[GenericAssociationItem]

List of all generic associations.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_portAssociationItems: List[PortAssociationItem]

List of all port associations.

class pyGHDL.dom.Concurrent.ConfigurationInstantiation(instantiationNode, label, configurationSymbol, genericAssociationItems=None, portAssociationItems=None)[source]

Represents a configuration instantiation.

The instantiated configuration is available as Configuration. The label is mandatory.

Example

  inst : configuration Counter;
--^^^^                            <- Label
--                     ^^^^^^^    <- Configuration

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConfigurationInstantiation.

Inheritance

Inheritance diagram of ConfigurationInstantiation

Parameters:
__init__(instantiationNode, label, configurationSymbol, genericAssociationItems=None, portAssociationItems=None)[source]

Initializes a configuration instantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • label (str) – The label of the configuration instantiation statement.

  • configurationSymbol (ConfigurationInstantiationSymbol) – Reference to the instantiated configuration.

  • genericAssociationItems (Iterable[AssociationItem]) – List of all generic associations in the generic map aspect.

  • portAssociationItems (Iterable[AssociationItem]) – List of all port associations in the port map aspect.

Return type:

None

classmethod parse(instantiationNode, instantiatedUnit, label)[source]

Translates the IIR node of the instantiation statement to a ConfigurationInstantiation.

Parameters:
  • instantiationNode (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiation statement.

  • instantiatedUnit (TypeVar(Iir, bound= c_int)) – The IIR node of the instantiated unit.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConfigurationInstantiation

Returns:

The translated instantiation statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Configuration: ConfigurationInstantiationSymbol

Read-only property to access the configuration (_configuration).

Returns:

The configuration.

property GenericAssociationItems: List[GenericAssociationItem]

Read-only property to access the generic associations (_genericAssociationItems).

Returns:

List of generic association items.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 PortAssociationItems: List[PortAssociationItem]

Read-only property to access the port associations (_portAssociationItems).

Returns:

List of port association items.

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

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]

_configuration: ConfigurationInstantiationSymbol

Reference to the instantiated configuration.

_genericAssociationItems: List[GenericAssociationItem]

List of all generic associations.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_portAssociationItems: List[PortAssociationItem]

List of all port associations.

class pyGHDL.dom.Concurrent.ConcurrentBlockStatement(blockNode, label, genericItems=None, genericAssociationItems=None, portItems=None, portAssociationItems=None, declaredItems=None, statements=None)[source]

Represents a block statement.

A block groups concurrent statements (Statements) and may declare its own items (DeclaredItems). It always forms a hierarchy level; independently of that, it may also have a block header: a generic clause (GenericItems) with its generic map aspect (GenericAssociationItems), and a port clause (PortItems) with its port map aspect (PortAssociationItems).

Example

  blk : block
--^^^                              <- Label
    generic (G : positive := 1);
--          ^^^^^^^^^^^^^^^^^^     <- GenericItems
    generic map (G => 2);
--              ^^^^^^^^           <- GenericAssociationItems
    port (bp : in bit);
--        ^^^^^^^^^^^              <- PortItems
    port map (bp => clock);
--           ^^^^^^^^^^^^          <- PortAssociationItems
    signal inner : bit := '0';
--  ^^^^^^^^^^^^^^^^^^^^^^^^^^     <- DeclaredItems
  begin
    inner <= bp;
--  ^^^^^^^^^^^^                   <- Statements
  end block;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentBlockStatement.

Inheritance

Inheritance diagram of ConcurrentBlockStatement

Parameters:
__init__(blockNode, label, genericItems=None, genericAssociationItems=None, portItems=None, portAssociationItems=None, declaredItems=None, statements=None)[source]

Initializes a block statement.

Parameters:
  • blockNode (TypeVar(Iir, bound= c_int)) – The IIR node of the block statement.

  • label (str) – The label of the block statement.

  • genericItems (Iterable) – List of all generics, in declaration order.

  • genericAssociationItems (Iterable) – List of all generic associations in the generic map aspect.

  • portItems (Iterable) – List of all ports, in declaration order.

  • portAssociationItems (Iterable) – List of all port associations in the port map aspect.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

Return type:

None

classmethod parse(blockNode, label)[source]

Translates the IIR node of the block statement to a ConcurrentBlockStatement.

Parameters:
  • blockNode (TypeVar(Iir, bound= c_int)) – The IIR node of the block statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentBlockStatement

Returns:

The translated block statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

property GenericAssociationItems: List[GenericAssociationItem]

Read-only property to access the generic associations (_genericAssociationItems).

Returns:

List of generic association items.

property GenericCount: int

Read-only property to return the number of generics in _genericItems.

Returns:

The generic count.

property GenericItems: List[GenericInterfaceItemMixin]

Read-only property to access the generic items (_genericItems).

Returns:

List of generic items.

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.

IndexDeclaredItems()[source]

A block’s ports share the declarative region of its declarative part.

Return type:

None

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 PortAssociationItems: List[PortAssociationItem]

Read-only property to access the port associations (_portAssociationItems).

Returns:

List of port association items.

property PortCount: int

Read-only property to return the number of ports in _portItems.

Returns:

The port count.

property PortItems: List[PortInterfaceItemMixin]

Read-only property to access the port items (_portItems).

Returns:

List of port items.

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

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox

Allow blackboxes for components in language entity.

_components

Dictionary of all components declared in this concurrent declaration region.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_documentation

The associated documentation of a model entity.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_genericAssociationItems

List of all generic associations.

_genericItems

List of all generics, in declaration order.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_label

The label of a model entity.

_namespace

The namespace of this block’s declarative region.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_portAssociationItems

List of all port associations.

_portItems

List of all ports, in declaration order.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.ProcessStatement(processNode, label=None, declaredItems=None, statements=None, sensitivityList=None)[source]

Represents a process statement.

A process declares its own items (DeclaredItems) and groups sequential statements (Statements). It may name a sensitivity list (SensitivityList).

Example

  proc : process (clock)
--^^^^                     <- optional Label
--                ^^^^^    <- optional SensitivityList
    variable v : bit;
--  ^^^^^^^^^^^^^^^^^      <- DeclaredItems
  begin
    v := '1';
--  ^^^^^^^^^              <- Statements
  end process;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ProcessStatement.

Inheritance

Inheritance diagram of ProcessStatement

Parameters:
__init__(processNode, label=None, declaredItems=None, statements=None, sensitivityList=None)[source]

Initializes a process statement.

Parameters:
  • processNode (TypeVar(Iir, bound= c_int)) – The IIR node of the process statement.

  • label (str) – The label of the process statement, or None if it has none.

  • declaredItems (Iterable) – List of all declared items in this sequential declaration region.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

  • sensitivityList (Iterable[Symbol]) – List of all signal names in the sensitivity list, or None if none was given.

Return type:

None

classmethod parse(processNode, label, hasSensitivityList)[source]

Translates the IIR node of the process statement to a ProcessStatement.

Parameters:
  • processNode (TypeVar(Iir, bound= c_int)) – The IIR node of the process statement.

  • label (str) – The statement’s label, or None if it has none.

  • hasSensitivityList (bool) – True if the process was declared with a sensitivity list.

Return type:

ProcessStatement

Returns:

The translated process statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property Constants: Dict[str, Constant]

Read-only property to access the declared constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

property Files: Dict[str, File]

Read-only property to access the declared files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the declared functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the sequential declaration region.

Every declared item is added to _namespace, and additionally to the lookup table matching its kind. Items of an unhandled kind are passed to _IndexOtherDeclaredItem().

See also

ConcurrentDeclarationRegionMixin.IndexDeclaredItems()

The same algorithm for a concurrent declaration region.

Return type:

None

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property Namespace: <pyTooling.Decorators.readonly object at 0x7f3f46055650>

Read-only property to access this region’s namespace (_namespace).

Returns:

The namespace.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the declared procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SensitivityList: List[Name]

Read-only property to access the sensitivity list (_sensitivityList).

Returns:

List of sensitivity list.

property Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the declared subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the declared types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

property Variables: Dict[str, Variable]

Read-only property to access the declared variables (_variables).

Returns:

Dictionary of variables, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_constants

Dictionary of all constants declared in this sequential declaration region.

_declaredItems

List of all declared items in this sequential declaration region.

_documentation

The associated documentation of a model entity.

_files

Dictionary of all files declared in this sequential declaration region.

_functions

Dictionary of all functions declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_label

The label of a model entity.

_namespace

The namespace of this sequential declaration region.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_sensitivityList

List of all signal names in the sensitivity list, or None if none was given.

_statements

List of all sequential statements in this construct.

_subtypes

Dictionary of all subtypes declared in this sequential declaration region.

_types

Dictionary of all types declared in this sequential declaration region.

_variables

Dictionary of all variables declared in this sequential declaration region.

class pyGHDL.dom.Concurrent.IfGenerateBranch(branchNode, condition, declaredItems=None, statements=None, alternativeLabel=None)[source]

Represents if-generate branch in a generate statement with a concurrent declaration region and concurrent statements.

Example

gen: if condition generate
  -- concurrent declarations
begin
  -- concurrent statements
elsif condition generate
  -- ...
else generate
  -- ...
end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.IfGenerateBranch.

Inheritance

Inheritance diagram of IfGenerateBranch

Parameters:
__init__(branchNode, condition, declaredItems=None, statements=None, alternativeLabel=None)[source]

Initializes an if..generate branch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which this branch’s declarations and statements are elaborated.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • alternativeLabel (str) – The branch’s alternative label, if one was given.

Return type:

None

classmethod parse(generateNode)[source]

Translates the IIR node of the generate statement to an IfGenerateBranch.

Parameters:

generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

Return type:

IfGenerateBranch

Returns:

The translated generate statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property AlternativeLabel: str | None

Read-only property to access the alternative label (_alternativeLabel).

Returns:

The alternative label, or None if not set.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Condition: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property NormalizedAlternativeLabel: str | None

Read-only property to access the normalized alternative label (_normalizedAlternativeLabel).

Returns:

The normalized alternative label, or None if not set.

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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox

Allow blackboxes for components in language entity.

_alternativeLabel

The branch’s alternative label, if one was given.

_components

Dictionary of all components declared in this concurrent declaration region.

_condition

The condition guarding this statement.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_namespace

The namespace of this branch’s declarative region.

_normalizedAlternativeLabel

The normalized (lower case) alternative label.

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.ElsifGenerateBranch(branchNode, condition, declaredItems=None, statements=None, alternativeLabel=None)[source]

Represents elsif-generate branch in a generate statement with a concurrent declaration region and concurrent statements.

Example

gen: if condition generate
  -- ...
elsif condition generate
  -- concurrent declarations
begin
  -- concurrent statements
else generate
  -- ...
end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ElsifGenerateBranch.

Inheritance

Inheritance diagram of ElsifGenerateBranch

Parameters:
__init__(branchNode, condition, declaredItems=None, statements=None, alternativeLabel=None)[source]

Initializes an elsif branch of an if..generate statement.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which this branch’s declarations and statements are elaborated.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • alternativeLabel (str) – The branch’s alternative label, if one was given.

Return type:

None

classmethod parse(generateNode, condition)[source]

Translates the IIR node of the generate statement to an ElsifGenerateBranch.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • condition (TypeVar(Iir, bound= c_int)) – The condition guarding the branch.

Return type:

ElsifGenerateBranch

Returns:

The translated generate statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property AlternativeLabel: str | None

Read-only property to access the alternative label (_alternativeLabel).

Returns:

The alternative label, or None if not set.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Condition: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property NormalizedAlternativeLabel: str | None

Read-only property to access the normalized alternative label (_normalizedAlternativeLabel).

Returns:

The normalized alternative label, or None if not set.

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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox

Allow blackboxes for components in language entity.

_alternativeLabel

The branch’s alternative label, if one was given.

_components

Dictionary of all components declared in this concurrent declaration region.

_condition

The condition guarding this statement.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_namespace

The namespace of this branch’s declarative region.

_normalizedAlternativeLabel

The normalized (lower case) alternative label.

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.ElseGenerateBranch(branchNode, declaredItems=None, statements=None, alternativeLabel=None)[source]

Represents else-generate branch in a generate statement with a concurrent declaration region and concurrent statements.

Example

gen: if condition generate
  -- ...
elsif condition generate
  -- ...
else generate
  -- concurrent declarations
begin
  -- concurrent statements
end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ElseGenerateBranch.

Inheritance

Inheritance diagram of ElseGenerateBranch

Parameters:
__init__(branchNode, declaredItems=None, statements=None, alternativeLabel=None)[source]

Initializes an else generate branch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • alternativeLabel (str) – The branch’s alternative label, if one was given.

Return type:

None

classmethod parse(generateNode)[source]

Translates the IIR node of the generate statement to an ElseGenerateBranch.

Parameters:

generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

Return type:

ElseGenerateBranch

Returns:

The translated generate statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property AlternativeLabel: str | None

Read-only property to access the alternative label (_alternativeLabel).

Returns:

The alternative label, or None if not set.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property NormalizedAlternativeLabel: str | None

Read-only property to access the normalized alternative label (_normalizedAlternativeLabel).

Returns:

The normalized alternative label, or None if not set.

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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox

Allow blackboxes for components in language entity.

_alternativeLabel

The branch’s alternative label, if one was given.

_components

Dictionary of all components declared in this concurrent declaration region.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_namespace

The namespace of this branch’s declarative region.

_normalizedAlternativeLabel

The normalized (lower case) alternative label.

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.IfGenerateStatement(generateNode, label, ifBranch, elsifBranches=None, elseBranch=None)[source]

Represents an if-generate statement.

It has one if branch (IfBranch), any number of elsif branches (ElsifBranches) and an optional else branch (ElseBranch). The label is mandatory and the branch conditions must be static expressions.

Example

  gen : if WIDTH > 8 generate
--^^^                           <- Label
--      ^^^^^^^^^^^^^^^^^^^^^   <- IfBranch
    q <= '0';
  elsif WIDTH > 4 generate
--^^^^^^^^^^^^^^^^^^^^^^^^      <- ElsifBranches[0]
    q <= '1';
  else generate
--^^^^^^^^^^^^^                 <- ElseBranch
    q <= 'Z';
  end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.IfGenerateStatement.

Inheritance

Inheritance diagram of IfGenerateStatement

Parameters:
__init__(generateNode, label, ifBranch, elsifBranches=None, elseBranch=None)[source]

Initializes an if..generate statement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The label of the if..generate statement.

  • ifBranch (IfGenerateBranch) – The mandatory if branch.

  • elsifBranches (Iterable[ElsifGenerateBranch]) – List of all elsif branches, in the order they were written.

  • elseBranch (ElseGenerateBranch) – The optional else branch, or None if none was given.

Return type:

None

classmethod parse(generateNode, label)[source]

Translates the IIR node of the generate statement to an IfGenerateStatement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

IfGenerateStatement

Returns:

The translated generate statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property ElseBranch: ElseGenerateBranch | None

Read-only property to access the else branch (_elseBranch).

Returns:

The else branch, or None if not set.

property ElsifBranches: List[ElsifGenerateBranch]

Read-only property to access the elsif branches (_elsifBranches).

Returns:

List of elsif branches.

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 IfBranch: IfGenerateBranch

Read-only property to access the if branch (_ifBranch).

Returns:

The if branch.

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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]

_allowBlackbox: bool | None

Allow blackboxes for components in language entity.

_elseBranch: ElseGenerateBranch | None

The optional else branch, or None if none was given.

_elsifBranches: List[ElsifGenerateBranch]

List of all elsif branches, in the order they were written.

_ifBranch: IfGenerateBranch

The mandatory if branch.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.IndexedGenerateChoice(node, expression)[source]

Represents a case-generate choice given by a single value.

The value is available as Expression.

Example

when 8 =>
--   ^      <- Expression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.IndexedGenerateChoice.

Inheritance

Inheritance diagram of IndexedGenerateChoice

Parameters:
__init__(node, expression)[source]

Initializes a case-generate choice given by a single value.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression this choice selects on.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the expression (_expression).

Returns:

The expression.

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.

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

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 indexed case-generate choice.

Format: 0

Return type:

str

Returns:

Formatted indexed case-generate choice.

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression this choice selects on.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.RangedGenerateChoice(node, rng)[source]

Represents a case-generate choice given by a range.

The range is available as Range.

Example

when 0 to 3 =>
--   ^^^^^^      <- Range

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.RangedGenerateChoice.

Inheritance

Inheritance diagram of RangedGenerateChoice

Parameters:
__init__(node, rng)[source]

Initializes a case-generate choice given by a range.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • rng (Range) – The range this choice selects on.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

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.

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

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

Read-only property to access the range (_range).

Returns:

The range.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the ranged case-generate choice.

Format: 0 to 3

Return type:

str

Returns:

Formatted ranged case-generate choice.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_range: Range

The range this choice selects on.

class pyGHDL.dom.Concurrent.GenerateCase(node, choices, declaredItems=None, statements=None, alternativeLabel=None)[source]

Represents one alternative of a case-generate statement, selected by its choices.

Example

when 8 =>
--   ^      <- Choices

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.GenerateCase.

Inheritance

Inheritance diagram of GenerateCase

Parameters:
__init__(node, choices, declaredItems=None, statements=None, alternativeLabel=None)[source]

Initializes a generate case.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • choices (Iterable[ConcurrentChoice]) – List of all choices selecting this alternative.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • alternativeLabel (str) – The alternative’s label.

Return type:

None

classmethod parse(caseNode, choices)[source]

Translates the IIR node of the alternative to a GenerateCase.

Parameters:
Return type:

GenerateCase

Returns:

The translated alternative.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the case-generate alternative.

Format: when 0 | 1 =>

Return type:

str

Returns:

Formatted case-generate alternative.

_allowBlackbox

Allow blackboxes for components in language entity.

_choices

List of all choices selecting this alternative.

_components

Dictionary of all components declared in this concurrent declaration region.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_label

The label of a model entity.

_namespace

The namespace of this alternative’s declarative region.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.OthersGenerateCase(caseNode, declaredItems=None, statements=None, alternativeLabel=None)[source]

Represents the others alternative of a case-generate statement.

It covers every choice not named explicitly.

Example

when others =>
--   ^^^^^^      <- the choice

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.OthersGenerateCase.

Inheritance

Inheritance diagram of OthersGenerateCase

Parameters:
__init__(caseNode, declaredItems=None, statements=None, alternativeLabel=None)[source]

Initializes an others generate alternative.

Parameters:
  • caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the case statement.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • alternativeLabel (str) – The alternative’s label.

Return type:

None

classmethod parse(caseNode)[source]

Translates the IIR node of the alternative to an OthersGenerateCase.

Parameters:

caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the alternative.

Return type:

OthersGenerateCase

Returns:

The translated alternative.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the others case-generate alternative.

Format: when others =>

Return type:

str

Returns:

Formatted others case-generate alternative.

_allowBlackbox

Allow blackboxes for components in language entity.

_choices

List of all choices selecting this alternative.

_components

Dictionary of all components declared in this concurrent declaration region.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_label

The label of a model entity.

_namespace

The namespace of this alternative’s declarative region.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.CaseGenerateStatement(generateNode, label, expression, cases)[source]

Represents a case-generate statement.

The expression being tested is available as SelectExpression, the alternatives as Cases. The label is mandatory and the selector must be a static expression.

Example

  gen : case MODE generate
--^^^                          <- Label
--           ^^^^              <- SelectExpression
    when 0 => q <= '0';
--  ^^^^^^^^^^^^^^^^^^^        <- Cases[0]
    when others => q <= '1';
--  ^^^^^^^^^^^^^^^^^^^^^^^^   <- Cases[1]
  end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.CaseGenerateStatement.

Inheritance

Inheritance diagram of CaseGenerateStatement

Parameters:
__init__(generateNode, label, expression, cases)[source]

Initializes a case..generate statement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The label of the case..generate statement.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression selecting the alternative.

  • cases (Iterable[ConcurrentCase]) – List of all alternatives, in the order they were written.

Return type:

None

classmethod parse(generateNode, label)[source]

Translates the IIR node of the generate statement to a CaseGenerateStatement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

CaseGenerateStatement

Returns:

The translated generate statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property Cases: List[GenerateCase]

Read-only property to access the cases (_cases).

Returns:

List of cases.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 SelectExpression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the select expression (_expression).

Returns:

The select expression.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox: bool | None

Allow blackboxes for components in language entity.

_cases: List[GenerateCase]

List of all alternatives, in the order they were written.

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression being tested; it must be static.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.ForGenerateStatement(generateNode, label, loopIndex, rng, declaredItems=None, statements=None, parent=None)[source]

Represents a for-generate statement.

The loop index is available as LoopIndex, the iteration range as Range and the generated statements as Statements. The label is mandatory.

Example

  gen : for i in 0 to 3 generate
--^^^                              <- Label
--          ^                      <- LoopIndex
--               ^^^^^^            <- Range
    q(i) <= '0';
--  ^^^^^^^^^^^^                   <- Statements
  end generate;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ForGenerateStatement.

Inheritance

Inheritance diagram of ForGenerateStatement

Parameters:
__init__(generateNode, label, loopIndex, rng, declaredItems=None, statements=None, parent=None)[source]

Initializes a for..generate statement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The label of the for..generate statement.

  • loopIndex (str) – The name of the generate loop’s index.

  • rng (Range) – The range the generate loop iterates over.

  • declaredItems (Iterable) – List of all declared items in this concurrent declaration region.

  • statements (Iterable[ConcurrentStatement]) – List of all concurrent statements in this construct.

  • parent (ModelEntity | None) – The parent model entity of this entity.

Return type:

None

classmethod parse(generateNode, label)[source]

Translates the IIR node of the generate statement to a ForGenerateStatement.

Parameters:
  • generateNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generate statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ForGenerateStatement

Returns:

The translated generate statement.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property AllowBlackbox: bool

Property to return whether a design supports blackboxes, inherited from the parent if not set locally (_allowBlackbox).

Algorithm

  1. If allow blackbox property is locally set, return the local value,

  2. Otherwise, return allow blackbox value from parent object.

Returns:

True, if blackboxes are allowed.

Raises:

VHDLModelException – If neither a local value is set nor a parent object is available to inherit the value from.

property Components: Dict[str, Any]

Read-only property to access the components (_components).

Returns:

Dictionary of components, indexed by normalized identifier.

property Constants: Dict[str, Constant]

Read-only property to access the constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Files: Dict[str, File]

Read-only property to access the files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

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.

IndexDeclaredItems()

Index declared items listed in the concurrent declaration region.

Return type:

None

Algorithm

  1. Iterate all declared items:

See also

pyVHDLModel.Design.IndexPackages()

Iterate all packages in the design and index declared items.

pyVHDLModel.Library.IndexPackages()

Iterate all packages in the library and index declared items.

pyVHDLModel.Library._IndexOtherDeclaredItem()

Iterate all packages in the library and index declared items.

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property LoopIndex: str

Read-only property to access the loop index (_loopIndex).

Returns:

The loop index.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Procedures: Dict[str, List[Procedure]]

Read-only property to access the procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property Range: <pyTooling.Decorators.readonly object at 0x7f3f444d57d0>

Read-only property to access the range (_range).

Returns:

The range.

property SharedVariables: Dict[str, SharedVariable]

Read-only property to access the shared variables (_sharedVariables).

Returns:

Dictionary of shared variables, indexed by normalized identifier.

property Signals: Dict[str, Signal]

Read-only property to access the signals (_signals).

Returns:

Dictionary of signals, indexed by normalized identifier.

property Statements: List[ConcurrentStatement]

Read-only property to access the statements (_statements).

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_allowBlackbox

Allow blackboxes for components in language entity.

_components

Dictionary of all components declared in this concurrent declaration region.

_constants

Dictionary of all constants declared in this concurrent declaration region.

_declaredItems

List of all declared items in this concurrent declaration region.

_files

Dictionary of all files declared in this concurrent declaration region.

_functions

Dictionary of all functions declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_hierarchy

All elements creating a hierarchy level (blocks and generates), in declaration order.

_instantiations

All instantiations, indexed by label.

_label

The label of a model entity.

_loopIndex

The name of the generate loop’s index.

_namespace

The namespace of the generate loop’s declarative region.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this concurrent declaration region, indexed by name; each entry is a list of overloads.

_range

The range the generate loop iterates over.

_sharedVariables

Dictionary of all shared variables declared in this concurrent declaration region.

_signals

Dictionary of all signals declared in this concurrent declaration region.

_statements

List of all concurrent statements in this construct.

_subtypes

Dictionary of all subtypes declared in this concurrent declaration region.

_types

Dictionary of all types declared in this concurrent declaration region.

class pyGHDL.dom.Concurrent.WaveformElement(waveNode, expression, after)[source]

Represents one element of a waveform in a signal assignment.

A waveform element assigns a value (Expression) after an optional delay (After).

Example

s <= '1' after 5 ns;
--   ^^^               <- Expression
--             ^^^^    <- After

This class implements a pyGHDL.dom object derived from pyVHDLModel.Base.WaveformElement.

Inheritance

Inheritance diagram of WaveformElement

Parameters:
__init__(waveNode, expression, after)[source]

Initializes a waveform element.

Parameters:
  • waveNode (TypeVar(Iir, bound= c_int)) – The IIR node of the waveform element.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The value this waveform element assigns.

  • after (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The delay after which the value is assigned, or None if none was given.

Return type:

None

classmethod parse(waveNode)[source]

Translates the IIR node of the waveform element to a WaveformElement.

Parameters:

waveNode (TypeVar(Iir, bound= c_int)) – The IIR node of the waveform element.

Returns:

The translated waveform element.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property After: <pyTooling.Decorators.readonly object at 0x7f3f462fb950>

Read-only property to access the waveform element’s delay (_after).

Returns:

The after.

property Expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the expression (_expression).

Returns:

The expression.

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.

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

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]

_after

The delay after which the value is assigned, or None if none was given.

_expression

The value this waveform element assigns.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Concurrent.ConditionalWaveform(node, waveform, condition=None)[source]

Represents one branch of a conditional signal assignment.

Each branch pairs a waveform (Waveform) with a condition (Condition). The final branch has no when, so its condition is None.

Example

s <= '1' when cond else '0';
--   ^^^^^^^^^^^^^             <- this branch: Waveform=['1'], Condition=cond
--                      ^^^    <- final branch (no ``when``): Waveform=['0'], Condition=None

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.ConditionalWaveform.

Inheritance

Inheritance diagram of ConditionalWaveform

Parameters:
__init__(node, waveform, condition=None)[source]

Initializes a conditional waveform.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • waveform (Iterable[WaveformElement]) – List of all waveform elements, in the order they were written.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition selecting this alternative.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a ConditionalWaveform.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

ConditionalWaveform

Returns:

The translated object.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property Condition: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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.

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

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 Waveform: List[WaveformElement]

Read-only property to access the waveform (_waveform).

Returns:

List of waveform.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_parent

Reference to a parent entity in the logical model hierarchy.

_waveform

List of all waveform elements, in the order they were written.

class pyGHDL.dom.Concurrent.SelectedWaveform(node, choices, waveform)[source]

Represents one alternative of a selected signal assignment.

Each alternative pairs a waveform (Waveform) with the choices selecting it (Choices).

Example

with sel select s <= '1' when '0', '0' when others;
--                   ^^^^^^^^^^^^                     <- this alternative: Choices=['0'], Waveform=['1']

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.SelectedWaveform.

Inheritance

Inheritance diagram of SelectedWaveform

Parameters:
__init__(node, choices, waveform)[source]

Initializes a selected waveform.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • choices (Iterable) – List of all choices selecting this alternative.

  • waveform (Iterable[WaveformElement]) – List of all waveform elements, in the order they were written.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

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.

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

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 Waveform: List[WaveformElement]

Read-only property to access the waveform (_waveform).

Returns:

List of waveform.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_choices: List[BaseChoice]

List of all choices selecting this alternative.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_waveform: List[WaveformElement]

List of all waveform elements, in the order they were written.

class pyGHDL.dom.Concurrent.OthersSelectedWaveform(node, waveform)[source]

Represents the others alternative of a selected signal assignment.

It supplies the waveform (Waveform) for every choice not named explicitly.

Example

with sel select s <= '1' when '0', '0' when others;
--                                 ^^^^^^^^^^^^^^^    <- the others alternative

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.OthersSelectedWaveform.

Inheritance

Inheritance diagram of OthersSelectedWaveform

Parameters:
__init__(node, waveform)[source]

Initializes an others selected waveform.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • waveform (Iterable[WaveformElement]) – List of all waveform elements, in the order they were written.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

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.

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

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 Waveform: List[WaveformElement]

Read-only property to access the waveform (_waveform).

Returns:

List of waveform.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_waveform: List[WaveformElement]

List of all waveform elements, in the order they were written.

class pyGHDL.dom.Concurrent.ConcurrentSimpleSignalAssignment(assignmentNode, label, target, waveform)[source]

Represents a simple concurrent signal assignment.

The assignment’s destination is available as Target, its value as Waveform.

Example

  lbl : q <= '1';
--^^^               <- optional Label
--      ^           <- Target
--           ^^^    <- Waveform

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentSimpleSignalAssignment.

Inheritance

Inheritance diagram of ConcurrentSimpleSignalAssignment

Parameters:
__init__(assignmentNode, label, target, waveform)[source]

Initializes a simple concurrent signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The label of the concurrent signal assignment, or None if it has none.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • waveform (Iterable[WaveformElement]) – List of all waveform elements, in the order they were written.

Return type:

None

classmethod parse(assignmentNode, label)[source]

Translates the IIR node of the assignment statement to a ConcurrentSimpleSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentSimpleSignalAssignment

Returns:

The translated assignment statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

property Waveform: List[WaveformElement]

Read-only property to access the waveform (_waveform).

Returns:

List of waveform.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

_waveform: List[WaveformElement]

List of all waveform elements, in the order they were written.

class pyGHDL.dom.Concurrent.ConcurrentConditionalSignalAssignment(assignmentNode, label, target, conditionalWaveforms)[source]

Represents a conditional concurrent signal assignment.

The alternatives are available as ConditionalWaveforms, a list of ConditionalWaveform. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : q <= '1' when cond else '0';
--^^^                                  <- optional Label
--      ^                              <- Target
--           ^^^^^^^^^^^^^             <- ConditionalWaveforms[0]
--                              ^^^    <- ConditionalWaveforms[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentConditionalSignalAssignment.

Inheritance

Inheritance diagram of ConcurrentConditionalSignalAssignment

Parameters:
__init__(assignmentNode, label, target, conditionalWaveforms)[source]

Initializes a conditional concurrent signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The label of the conditional concurrent signal assignment, or None if it has none.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • conditionalWaveforms (Iterable[ConditionalWaveform]) – All alternatives, in order.

Return type:

None

classmethod parse(assignmentNode, label)[source]

Translates the IIR node of the assignment statement to a ConcurrentConditionalSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentConditionalSignalAssignment

Returns:

The translated assignment statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property ConditionalWaveforms: List[ConditionalWaveform]

Read-only property to access the conditional waveforms (_conditionalWaveforms).

Returns:

List of conditional waveforms.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_conditionalWaveforms: List[ConditionalWaveform]

All alternatives, in order.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Concurrent.ConcurrentSelectedSignalAssignment(assignmentNode, label, target, expression, selectedWaveforms)[source]

Represents a selected concurrent signal assignment.

The selector is available as Expression, the alternatives as SelectedWaveforms, a list of SelectedWaveform. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : with sel select q <= '1' when '0', '0' when others;
--^^^                                                         <- optional Label
--           ^^^                                              <- Expression
--                      ^                                     <- Target
--                           ^^^^^^^^^^^^                     <- SelectedWaveforms[0]
--                                         ^^^^^^^^^^^^^^^    <- SelectedWaveforms[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentSelectedSignalAssignment.

Inheritance

Inheritance diagram of ConcurrentSelectedSignalAssignment

Parameters:
__init__(assignmentNode, label, target, expression, selectedWaveforms)[source]

Initializes a selected concurrent signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The label of the selected concurrent signal assignment, or None if it has none.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The selector expression.

  • selectedWaveforms (Iterable) – All alternatives, in order.

Return type:

None

classmethod parse(assignmentNode, label)[source]

Translates the IIR node of the assignment statement to a ConcurrentSelectedSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentSelectedSignalAssignment

Returns:

The translated assignment statement.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the expression (_expression).

Returns:

The expression.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 SelectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]

Read-only property to access the selected waveforms (_selectedWaveforms).

Returns:

List of selected waveforms.

property Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_selectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]

All alternatives, in order.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Concurrent.ConcurrentProcedureCall(callNode, label, procedureName, parameterAssociationItems)[source]

Represents a concurrent procedure call.

Like every concurrent statement, it can carry an optional label (Label).

Example

  proc_lbl : proc(clock, open);
--^^^^^^^^                        <- optional Label
--           ^^^^^^^^^^^^^^^^^    <- the call

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentProcedureCall.

Inheritance

Inheritance diagram of ConcurrentProcedureCall

Parameters:
__init__(callNode, label, procedureName, parameterAssociationItems)[source]

Initializes a concurrent procedure call.

Parameters:
  • callNode (TypeVar(Iir, bound= c_int)) – The IIR node of the subprogram call.

  • label (str) – The label of the concurrent procedure call, or None if it has none.

  • procedureName (Symbol) – Reference to the called procedure.

  • parameterAssociationItems (Iterable) – List of all parameter associations of the call.

Return type:

None

classmethod parse(concurrentCallNode, label)[source]

Translates the IIR node of the concurrent procedure call to a ConcurrentProcedureCall.

Parameters:
  • concurrentCallNode (TypeVar(Iir, bound= c_int)) – The IIR node of the concurrent procedure call.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentProcedureCall

Returns:

The translated concurrent procedure call.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

property ParameterAssociationItems: List[ParameterAssociationItem]

Read-only property to access the parameter association items (_parameterAssociationItems).

Returns:

List of parameter association items.

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 0x7f3f462456d0>

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 Procedure: Symbol

Read-only property to access the procedure (_procedure).

Returns:

The procedure.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

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

_parameterAssociationItems: List[ParameterAssociationItem]

List of all parameter associations of the call.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_procedure: Symbol

Reference to the called procedure.

class pyGHDL.dom.Concurrent.ConcurrentAssertStatement(assertNode, condition, message=None, severity=None, label=None)[source]

Represents a concurrent assertion statement.

The checked condition is available as Condition, the optional report string as Message and the optional severity as Severity.

Example

  lbl : assert cond report "bad" severity note;
--^^^                                             <- optional Label
--             ^^^^                               <- Condition
--                         ^^^^^                  <- optional Message
--                                        ^^^^    <- optional Severity

This class implements a pyGHDL.dom object derived from pyVHDLModel.Concurrent.ConcurrentAssertStatement.

Inheritance

Inheritance diagram of ConcurrentAssertStatement

Parameters:
__init__(assertNode, condition, message=None, severity=None, label=None)[source]

Initializes a concurrent assertion statement.

Parameters:
  • assertNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assertion.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition that must hold; the report is issued when it is false.

  • message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported message, or None if none was given.

  • severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or None if none was given.

  • label (str) – The label of the concurrent assertion statement, or None if it has none.

Return type:

None

classmethod parse(assertNode, label)[source]

Translates the IIR node of the assertion to a ConcurrentAssertStatement.

Parameters:
  • assertNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assertion.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ConcurrentAssertStatement

Returns:

The translated assertion.

_iirNode

The IIR node in libghdl’s tree this DOM object was translated from.

_position

The IIR node’s position in the source file, resolved on first access and then cached.

property Condition: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property Message: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal | None

Read-only property to access the message (_message).

Returns:

The message, or None if not set.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label 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 0x7f3f462456d0>

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 Severity: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal | None

Read-only property to access the severity (_severity).

Returns:

The severity, or None if not set.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_message

The reported message, or None if none was given.

_normalizedLabel

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

_parent

Reference to a parent entity in the logical model hierarchy.

_severity

The reported severity level, or None if none was given.