pyGHDL.dom.Aggregates
This module contains all DOM classes for VHDL’s design units (context,
architecture, package,
package body, context and
configuration.
Classes
SimpleAggregateElement: Represents an aggregate element given by position.IndexedAggregateElement: Represents an aggregate element chosen by an index.RangedAggregateElement: Represents an aggregate element chosen by a range.NamedAggregateElement: Represents an aggregate element chosen by a name.OthersAggregateElement: Represents theotherselement of an aggregate.
Classes
- class pyGHDL.dom.Aggregates.SimpleAggregateElement(node, expression)[source]
Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, expression)[source]
Initializes an aggregate element.
- Parameters:
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression this aggregate element supplies.
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- 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 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.
- __str__()[source]
Formats the simple aggregate element.
Format:
val- Return type:
- Returns:
Formatted simple aggregate element.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression this aggregate element supplies.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Aggregates.IndexedAggregateElement(node, index, expression)[source]
Inheritance
- Parameters:
node (Iir)
index (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, index, expression)[source]
Initializes an aggregate element chosen by an index.
- Parameters:
index (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The index selecting the element this value is assigned to.
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression this aggregate element supplies.
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- 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 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.
- __str__()[source]
Formats the indexed aggregate element.
Format:
0 => val- Return type:
- Returns:
Formatted indexed aggregate element.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression this aggregate element supplies.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Aggregates.RangedAggregateElement(node, rng, expression)[source]
Inheritance
- Parameters:
node (Iir)
rng (Range)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, rng, expression)[source]
Initializes an aggregate element chosen by a range.
- Parameters:
- Return type:
None
- 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 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.
- property Range: <pyTooling.Decorators.readonly object at 0x7c5266b85dd0>
Read-only property to access the range (
_range).- Returns:
The range.
- __str__()[source]
Formats the ranged aggregate element.
Format:
0 to 3 => val- Return type:
- Returns:
Formatted ranged aggregate element.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression this aggregate element supplies.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _range: <pyTooling.Decorators.readonly object at 0x7c5266b85dd0>
The range selecting the elements this value is assigned to.
- class pyGHDL.dom.Aggregates.NamedAggregateElement(node, name, expression)[source]
Inheritance
- Parameters:
node (Iir)
name (Symbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, name, expression)[source]
Initializes an aggregate element chosen by a name.
- Parameters:
- Return type:
None
- 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 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.
- __str__()[source]
Formats the named aggregate element.
Format:
elem => val- Return type:
- Returns:
Formatted named aggregate element.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression this aggregate element supplies.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Aggregates.OthersAggregateElement(node, expression)[source]
Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, expression)[source]
Initializes an aggregate element.
- Parameters:
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression this aggregate element supplies.
parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- 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 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.
- __str__()[source]
Formats the
othersaggregate element.Format:
others => val- Return type:
- Returns:
Formatted
othersaggregate element.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression this aggregate element supplies.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.