pyGHDL.dom.Configuration
Classes
EntityAspectEntity: Represents an entity aspect naming an entity, optionally with an architecture.EntityAspectConfiguration: Represents an entity aspect naming a configuration.EntityAspectOpen: Represents an open entity aspect, leaving the binding unspecified.BindingIndication: Represents a binding indication: which design entity a component is bound to.AllInstantiationList: Represents an instantiation list namingallinstances of a component.OthersInstantiationList: Represents an instantiation list naming all instances not configured elsewhere.ComponentConfiguration: .. note:BlockConfiguration: Represents the configuration of one block: an architecture, a block statement or a generate body.
Classes
- class pyGHDL.dom.Configuration.EntityAspectEntity(node, entity, architecture=None)[source]
Inheritance
- Parameters:
node (Iir)
entity (EntitySymbol)
architecture (ArchitectureSymbol)
- __init__(node, entity, architecture=None)[source]
Initializes an entity aspect naming an entity, optionally with an architecture.
- Parameters:
entity (
EntitySymbol) – Reference to the named entity.architecture (
ArchitectureSymbol) – Reference to the selected architecture, orNoneif none was given.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- property Architecture: ArchitectureSymbol | None
Read-only property to access the architecture (
_architecture).- Returns:
The architecture, or
Noneif not set.
- property Entity: EntitySymbol
Read-only property to access the entity (
_entity).- Returns:
The entity.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _architecture: ArchitectureSymbol | None
Reference to the selected architecture, or
Noneif none was given.
- _entity: EntitySymbol
Reference to the named entity.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.EntityAspectConfiguration(node, configuration)[source]
Inheritance
- Parameters:
node (Iir)
configuration (ConfigurationSymbol)
- __init__(node, configuration)[source]
Initializes an entity aspect naming a configuration.
- Parameters:
configuration (
ConfigurationSymbol) – Reference to the named configuration.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- property Configuration: ConfigurationSymbol
Read-only property to access the configuration (
_configuration).- Returns:
The configuration.
- 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 0x7c526738b7d0>
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: ConfigurationSymbol
Reference to the named configuration.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.EntityAspectOpen(node)[source]
Inheritance
- Parameters:
node (Iir)
- __init__(node)[source]
Initializes a VHDL model entity.
- Parameters:
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.BindingIndication(node, entityAspect=None, genericAssociationItems=None, portAssociationItems=None)[source]
Inheritance
- Parameters:
node (Iir)
entityAspect (EntityAspect)
genericAssociationItems (List[GenericAssociationItem])
portAssociationItems (List[PortAssociationItem])
- __init__(node, entityAspect=None, genericAssociationItems=None, portAssociationItems=None)[source]
Initializes a binding indication.
- Parameters:
entityAspect (
EntityAspect) – The bound design entity, orNoneif not given.genericAssociationItems (
List[GenericAssociationItem]) – List of all generic associations in the generic map aspect.portAssociationItems (
List[PortAssociationItem]) – List of all port associations in the port map aspect.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- property EntityAspect: <pyTooling.Decorators.readonly object at 0x7c5266915150> | None
Read-only property to access the entity aspect (
_entityAspect).- Returns:
The entity aspect, or
Noneif not set.
- 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 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 0x7c526738b7d0>
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.
- _entityAspect: <pyTooling.Decorators.readonly object at 0x7c5266915150> | None
The bound design entity, or
Noneif not given.
- _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.Configuration.AllInstantiationList(node)[source]
Inheritance
- Parameters:
node (Iir)
- __init__(node)[source]
Initializes a VHDL model entity.
- Parameters:
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.OthersInstantiationList(node)[source]
Inheritance
- Parameters:
node (Iir)
- __init__(node)[source]
Initializes a VHDL model entity.
- Parameters:
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.ComponentConfiguration(node, instantiationList, componentName, bindingIndication=None)[source]
Note
Also used for configuration specifications (
for U1 : comp use entity ...;declared directly in an architecture’s declarative part) - GHDL represents both with the identical field structure (Instantiation_List,Component_Name,Binding_Indication).Inheritance
- Parameters:
node (Iir)
instantiationList (List[Name] | AllInstantiationList | OthersInstantiationList)
componentName (ComponentInstantiationSymbol)
bindingIndication (BindingIndication)
- __init__(node, instantiationList, componentName, bindingIndication=None)[source]
Initializes a component configuration.
- Parameters:
instantiationList (
List[Name] |AllInstantiationList|OthersInstantiationList) – The instances this configuration applies to.componentName (
ComponentInstantiationSymbol) – Reference to the component being configured.bindingIndication (
BindingIndication) – The binding indication, orNoneif none was given.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- property BindingIndication: <pyTooling.Decorators.readonly object at 0x7c5266915550> | None
Read-only property to access the binding indication (
_bindingIndication).- Returns:
The binding indication, or
Noneif not set.
- property ComponentName: ComponentInstantiationSymbol
Read-only property to access the component name (
_componentName).- Returns:
The component name.
- 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 InstantiationList: List[Name] | AllInstantiationList | OthersInstantiationList
Read-only property to access the instantiation list (
_instantiationList).- Returns:
The instantiation list.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7c526738b7d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _bindingIndication: <pyTooling.Decorators.readonly object at 0x7c5266915550> | None
The binding indication, or
Noneif none was given.
- _componentName: ComponentInstantiationSymbol
Reference to the component being configured.
- _instantiationList: List[Name] | AllInstantiationList | OthersInstantiationList
The instances this configuration applies to.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.BlockConfiguration(node, blockSpecification, items=None)[source]
Inheritance
- Parameters:
node (Iir)
blockSpecification (Symbol)
items (List[BlockConfiguration | ComponentConfiguration])
- __init__(node, blockSpecification, items=None)[source]
Initializes a block configuration.
- Parameters:
blockSpecification (
Symbol) – The configured block.items (
List[BlockConfiguration|ComponentConfiguration]) – Nested configurations.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- property BlockSpecification: Symbol
Read-only property to access the block specification (
_blockSpecification).- Returns:
The block specification.
- 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 Items: List[BlockConfiguration | ComponentConfiguration]
Read-only property to access the items (
_items).- Returns:
List of 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 0x7c526738b7d0>
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.
- _items: List[BlockConfiguration | ComponentConfiguration]
Nested configurations.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.