pyGHDL.dom.Configuration
This module implements derived configuration classes from pyVHDLModel.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]
Represents an entity aspect naming an entity, optionally with an architecture.
Example
use entity work.e_rest(rtl); -- ^^^^^^^^^^^ <- Entity -- ^^^ <- Architecture
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.EntityAspectEntity.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:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.entity (
EntitySymbol) – Reference to the named entity.architecture (
ArchitectureSymbol) – Reference to the selected architecture, orNoneif none was given.
- Return type:
None
- classmethod parse(entityAspectNode)[source]
Translates the IIR node of the entity aspect to an
EntityAspectEntity.
- _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 | 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 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 | 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]
Represents an entity aspect naming a configuration.
Example
use configuration work.cfg; -- ^^^^^^^^ <- Configuration
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.EntityAspectConfiguration.Inheritance
- Parameters:
node (Iir)
configuration (ConfigurationSymbol)
- __init__(node, configuration)[source]
Initializes an entity aspect naming a configuration.
- Parameters:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.configuration (
ConfigurationSymbol) – Reference to the named configuration.
- Return type:
None
- classmethod parse(entityAspectNode)[source]
Translates the IIR node of the entity aspect to an
EntityAspectConfiguration.
- _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: 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 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: 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]
Represents an open entity aspect, leaving the binding unspecified.
Example
use open; -- ^^^^ <- the aspect
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.EntityAspectOpen.Inheritance
- Parameters:
node (Iir)
- classmethod parse(entityAspectNode)[source]
Translates the IIR node of the entity aspect to an
EntityAspectOpen.
- _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.
- _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]
Represents a binding indication: which design entity a component is bound to.
The entity aspect is available as
EntityAspect, together with the generic and port maps (GenericAssociations,PortAssociations).This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.BindingIndication.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:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.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.
- Return type:
None
- classmethod parse(bindingIndicationNode)[source]
Translates the IIR node of the binding indication to a
BindingIndication.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- property EntityAspect: <pyTooling.Decorators.readonly object at 0x7f3f444d70d0> | 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 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.
- _entityAspect: <pyTooling.Decorators.readonly object at 0x7f3f444d70d0> | 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]
Represents an instantiation list naming
allinstances of a component.Example
for all : comp use entity work.sub(behav); -- ^^^ <- the instantiation list
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.AllInstantiationList.Inheritance
- Parameters:
node (Iir)
- _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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Configuration.OthersInstantiationList(node)[source]
Represents an instantiation list naming all instances not configured elsewhere.
Example
for others : comp use entity work.sub(behav); -- ^^^^^^ <- the instantiation list
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.OthersInstantiationList.Inheritance
- Parameters:
node (Iir)
- _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.
- _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:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.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.
- Return type:
None
- classmethod parse(node)[source]
Translates an IIR node to a
ComponentConfiguration.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- property BindingIndication: <pyTooling.Decorators.readonly object at 0x7f3f444d74d0> | 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 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.
- _bindingIndication: <pyTooling.Decorators.readonly object at 0x7f3f444d74d0> | 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]
Represents the configuration of one block: an architecture, a block statement or a generate body.
Nested configurations are available as
ConfigurationItems.Example
for rtl -- ^^^ <- Block end for;
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Configuration.BlockConfiguration.Inheritance
- Parameters:
node (Iir)
blockSpecification (Symbol)
items (List[BlockConfiguration | ComponentConfiguration])
- __init__(node, blockSpecification, items=None)[source]
Initializes a block configuration.
- Parameters:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.blockSpecification (
Symbol) – The configured block.items (
List[BlockConfiguration|ComponentConfiguration]) – Nested configurations.
- Return type:
None
- classmethod parse(node)[source]
Translates an IIR node to a
BlockConfiguration.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- 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 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.
- _items: List[BlockConfiguration | ComponentConfiguration]
Nested configurations.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.