pyGHDL.dom.Concurrent
This module implements derived concurrent statement classes from pyVHDLModel.Concurrent.
Classes
GenericAssociationItem: A base-class for all generic association items used in generic map aspects.PortAssociationItem: A base-class for all port association items used in port map aspects.ParameterAssociationItem: A base-class for all parameter association items used in parameter map aspects.ComponentInstantiation: Represents a component instantiation.EntityInstantiation: Represents a direct entity instantiation.ConfigurationInstantiation: Represents a configuration instantiation.ConcurrentBlockStatement: Represents a block statement.ProcessStatement: Represents a process statement.IfGenerateBranch: Represents if-generate branch in a generate statement with a concurrent declaration region and concurrent statements.ElsifGenerateBranch: Represents elsif-generate branch in a generate statement with a concurrent declaration region and concurrent statements.ElseGenerateBranch: Represents else-generate branch in a generate statement with a concurrent declaration region and concurrent statements.IfGenerateStatement: Represents an if-generate statement.IndexedGenerateChoice: Represents a case-generate choice given by a single value.RangedGenerateChoice: Represents a case-generate choice given by a range.GenerateCase: Represents one alternative of a case-generate statement, selected by its choices.OthersGenerateCase: Represents theothersalternative of a case-generate statement.CaseGenerateStatement: Represents a case-generate statement.ForGenerateStatement: Represents a for-generate statement.WaveformElement: Represents one element of a waveform in a signal assignment.ConditionalWaveform: Represents one branch of a conditional signal assignment.SelectedWaveform: Represents one alternative of a selected signal assignment.OthersSelectedWaveform: Represents theothersalternative of a selected signal assignment.ConcurrentSimpleSignalAssignment: Represents a simple concurrent signal assignment.ConcurrentConditionalSignalAssignment: Represents a conditional concurrent signal assignment.ConcurrentSelectedSignalAssignment: Represents a selected concurrent signal assignment.ConcurrentProcedureCall: Represents a concurrent procedure call.ConcurrentAssertStatement: Represents a concurrent assertion statement.
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.domobject derived frompyVHDLModel.Association.GenericAssociationItem.Inheritance
- Parameters:
associationNode (Iir)
formal (Symbol)
actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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, orNonefor a positional association.actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.
- Return type:
None
- _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
Noneif not set.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()
Formats the association item.
Format:
formal => actual, oractualalone when positional- Return type:
- Returns:
Formatted association item.
- _actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The actual part of this 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.domobject derived frompyVHDLModel.Association.PortAssociationItem.Inheritance
- Parameters:
associationNode (Iir)
formal (Symbol)
actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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, orNonefor a positional association.actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.
- Return type:
None
- _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
Noneif not set.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()
Formats the association item.
Format:
formal => actual, oractualalone when positional- Return type:
- Returns:
Formatted association item.
- _actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The actual part of this 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.domobject derived frompyVHDLModel.Association.ParameterAssociationItem.Inheritance
- Parameters:
associationNode (Iir)
formal (Symbol)
actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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, orNonefor a positional association.actual (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The actual part of this association.
- Return type:
None
- _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
Noneif not set.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()
Formats the association item.
Format:
formal => actual, oractualalone when positional- Return type:
- Returns:
Formatted association item.
- _actual: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The actual part of this 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 asGenericAssociationItemsandPortAssociationItems. The label is mandatory.Example
inst : component Counter; --^^^^ <- Label -- ^^^^^^^ <- Component
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ComponentInstantiation.Inheritance
- Parameters:
instantiationNode (Iir)
label (str)
componentSymbol (ComponentInstantiationSymbol)
genericAssociationItems (Iterable[AssociationItem])
portAssociationItems (Iterable[AssociationItem])
- __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:
- Return type:
- Returns:
The translated instantiation statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _component: ComponentInstantiationSymbol
Reference to the instantiated component.
- _genericAssociationItems: List[GenericAssociationItem]
List of all generic associations.
- _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
Entityand the optionally selected architecture asArchitecture. The label is mandatory.Example
inst : entity work.Counter(rtl); --^^^^ <- Label -- ^^^^^^^^^^^^ <- Entity -- ^^^ <- optional Architecture
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.EntityInstantiation.Inheritance
- Parameters:
instantiationNode (Iir)
label (str)
entitySymbol (EntityInstantiationSymbol)
architectureSymbol (ArchitectureSymbol)
genericAssociationItems (Iterable[AssociationItem])
portAssociationItems (Iterable[AssociationItem])
- __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:
- Return type:
- Returns:
The translated instantiation statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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.
- _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.domobject derived frompyVHDLModel.Concurrent.ConfigurationInstantiation.Inheritance
- Parameters:
instantiationNode (Iir)
label (str)
configurationSymbol (ConfigurationInstantiationSymbol)
genericAssociationItems (Iterable[AssociationItem])
portAssociationItems (Iterable[AssociationItem])
- __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:
- Return type:
- Returns:
The translated instantiation statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _configuration: ConfigurationInstantiationSymbol
Reference to the instantiated configuration.
- _genericAssociationItems: List[GenericAssociationItem]
List of all generic associations.
- _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;
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ConcurrentBlockStatement.Inheritance
- 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:
- Return type:
- 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
If allow blackbox property is locally set, return the local value,
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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()[source]
A block’s ports share the declarative region of its declarative part.
- Return type:
- 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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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.
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.domobject derived frompyVHDLModel.Concurrent.ProcessStatement.Inheritance
- 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, orNoneif 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, orNoneif none was given.
- Return type:
None
- classmethod parse(processNode, label, hasSensitivityList)[source]
Translates the IIR node of the process statement to a
ProcessStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- 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:
- 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
_positionis 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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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
Noneif 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.domobject derived frompyVHDLModel.Concurrent.IfGenerateBranch.Inheritance
- Parameters:
branchNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
alternativeLabel (str)
- __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.
- _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
If allow blackbox property is locally set, return the local value,
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
Noneif 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
Noneif 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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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.
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.domobject derived frompyVHDLModel.Concurrent.ElsifGenerateBranch.Inheritance
- Parameters:
branchNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
alternativeLabel (str)
- __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:
- Return type:
- 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
If allow blackbox property is locally set, return the local value,
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
Noneif 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
Noneif 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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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.
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.domobject derived frompyVHDLModel.Concurrent.ElseGenerateBranch.Inheritance
- Parameters:
branchNode (Iir)
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
alternativeLabel (str)
- __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.
- _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
If allow blackbox property is locally set, return the local value,
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
Noneif 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
Noneif 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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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.
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
ifbranch (IfBranch), any number ofelsifbranches (ElsifBranches) and an optionalelsebranch (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;
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.IfGenerateStatement.Inheritance
- Parameters:
generateNode (Iir)
label (str)
ifBranch (IfGenerateBranch)
elsifBranches (Iterable[ElsifGenerateBranch])
elseBranch (ElseGenerateBranch)
- __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, orNoneif none was given.
- Return type:
None
- classmethod parse(generateNode, label)[source]
Translates the IIR node of the generate statement to an
IfGenerateStatement.- Parameters:
- Return type:
- Returns:
The translated generate statement.
- _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
If allow blackbox property is locally set, return the local value,
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
Noneif 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _elseBranch: ElseGenerateBranch | None
The optional
elsebranch, orNoneif none was given.
- _elsifBranches: List[ElsifGenerateBranch]
List of all
elsifbranches, in the order they were written.
- _ifBranch: IfGenerateBranch
The mandatory
ifbranch.
- _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.domobject derived frompyVHDLModel.Concurrent.IndexedGenerateChoice.Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()[source]
Formats the indexed case-generate choice.
Format:
0- Return type:
- 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.domobject derived frompyVHDLModel.Concurrent.RangedGenerateChoice.Inheritance
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()[source]
Formats the ranged case-generate choice.
Format:
0 to 3- Return type:
- Returns:
Formatted ranged case-generate choice.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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.domobject derived frompyVHDLModel.Concurrent.GenerateCase.Inheritance
- Parameters:
node (Iir)
choices (Iterable[ConcurrentChoice])
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
alternativeLabel (str)
- __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:
caseNode (
TypeVar(Iir, bound=c_int)) – The IIR node of the alternative.choices (
Iterable[ConcurrentChoice]) – List of all choices selecting this alternative.
- Return type:
- 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
If allow blackbox property is locally set, return the local value,
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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- __str__()[source]
Formats the case-generate alternative.
Format:
when 0 | 1 =>- Return type:
- 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.
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
othersalternative of a case-generate statement.It covers every choice not named explicitly.
Example
when others => -- ^^^^^^ <- the choice
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.OthersGenerateCase.Inheritance
- Parameters:
caseNode (Iir)
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
alternativeLabel (str)
- __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.
- _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
If allow blackbox property is locally set, return the local value,
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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- __str__()[source]
Formats the
otherscase-generate alternative.Format:
when others =>- Return type:
- Returns:
Formatted
otherscase-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.
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 asCases. 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.domobject derived frompyVHDLModel.Concurrent.CaseGenerateStatement.Inheritance
- Parameters:
generateNode (Iir)
label (str)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
cases (Iterable[ConcurrentCase])
- __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:
- Return type:
- Returns:
The translated generate statement.
- _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
If allow blackbox property is locally set, return the local value,
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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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.
- _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 asRangeand the generated statements asStatements. 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.domobject derived frompyVHDLModel.Concurrent.ForGenerateStatement.Inheritance
- Parameters:
generateNode (Iir)
label (str)
loopIndex (str)
rng (Range)
declaredItems (Iterable)
statements (Iterable[ConcurrentStatement])
parent (ModelEntity | None)
- __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:
- Return type:
- 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
If allow blackbox property is locally set, return the local value,
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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- IndexDeclaredItems()
Index declared items listed in the concurrent declaration region.
- Return type:
Algorithm
Iterate all declared items:
Every declared item is added to
_namespace.If the declared item is a
FullType, then add an entry to_types.If the declared item is a
Subtype, then add an entry to_subtypes.If the declared item is a
Function, then add an entry to_functions.If the declared item is a
Procedure, then add an entry to_procedures.If the declared item is a
Constant, then add an entry to_constants.If the declared item is a
Signal, then add an entry to_signals.If the declared item is a
Variable, TODO.If the declared item is a
SharedVariable, then add an entry to_sharedVariables.If the declared item is a
File, then add an entry to_files.If the declared item is neither of these types, call
_IndexOtherDeclaredItem().
Derived classes may override this virtual function.
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
_positionis 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.
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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- _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.
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
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Base.WaveformElement.Inheritance
- Parameters:
waveNode (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
after (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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
Noneif none was given.
- Return type:
None
- classmethod parse(waveNode)[source]
Translates the IIR node of the waveform element to a
WaveformElement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _after
The delay after which the value is assigned, or
Noneif 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 nowhen, so its condition isNone.Example
s <= '1' when cond else '0'; -- ^^^^^^^^^^^^^ <- this branch: Waveform=['1'], Condition=cond -- ^^^ <- final branch (no ``when``): Waveform=['0'], Condition=None
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Common.ConditionalWaveform.Inheritance
- Parameters:
node (Iir)
waveform (Iterable[WaveformElement])
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis 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.
- _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']
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Common.SelectedWaveform.Inheritance
- Parameters:
node (Iir)
choices (Iterable)
waveform (Iterable[WaveformElement])
- __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
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis 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.
- _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
othersalternative 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.domobject derived frompyVHDLModel.Common.OthersSelectedWaveform.Inheritance
- Parameters:
node (Iir)
waveform (Iterable[WaveformElement])
- __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
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis 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.
- _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 asWaveform.Example
lbl : q <= '1'; --^^^ <- optional Label -- ^ <- Target -- ^^^ <- Waveform
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ConcurrentSimpleSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
label (str)
target (SignalSymbol)
waveform (Iterable[WaveformElement])
- __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, orNoneif 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:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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.ConcurrentConditionalSignalAssignment(assignmentNode, label, target, conditionalWaveforms)[source]
Represents a conditional concurrent signal assignment.
The alternatives are available as
ConditionalWaveforms, a list ofConditionalWaveform. 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.domobject derived frompyVHDLModel.Concurrent.ConcurrentConditionalSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
label (str)
target (SignalSymbol)
conditionalWaveforms (Iterable[ConditionalWaveform])
- __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, orNoneif 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:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _conditionalWaveforms: List[ConditionalWaveform]
All alternatives, in order.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 asSelectedWaveforms, a list ofSelectedWaveform. 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]
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ConcurrentSelectedSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
label (str)
target (SignalSymbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
selectedWaveforms (Iterable)
- __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, orNoneif 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:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression held by this construct.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _selectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]
All alternatives, in order.
- 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
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ConcurrentProcedureCall.Inheritance
- __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, orNoneif 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:
- Return type:
- Returns:
The translated concurrent procedure call.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _parameterAssociationItems: List[ParameterAssociationItem]
List of all parameter associations of the call.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 asMessageand the optional severity asSeverity.Example
lbl : assert cond report "bad" severity note; --^^^ <- optional Label -- ^^^^ <- Condition -- ^^^^^ <- optional Message -- ^^^^ <- optional Severity
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Concurrent.ConcurrentAssertStatement.Inheritance
- Parameters:
assertNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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
Noneif none was given.severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or
Noneif none was given.label (
str) – The label of the concurrent assertion statement, orNoneif it has none.
- Return type:
None
- classmethod parse(assertNode, label)[source]
Translates the IIR node of the assertion to a
ConcurrentAssertStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
Noneif 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
_positionis 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
Noneif not set.
- _condition
The condition guarding this statement.
- _label
The label of a model entity.
- _message
The reported message, or
Noneif 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
Noneif none was given.