pyGHDL.dom.Aggregates

This module contains all DOM classes for VHDL’s design units (context, architecture, package, package body, context and configuration.

Classes


Classes

class pyGHDL.dom.Aggregates.SimpleAggregateElement(node, expression)[source]

Inheritance

Inheritance diagram of SimpleAggregateElement

Parameters:
__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 type found by walking the parent chain upwards.

Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.

Parameters:

type (Type) – Class (type) of the ancestor to find.

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.

classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
Parameters:

predicate (TypeVar(TAttr) | Iterable[TypeVar(TAttr)] | None) – An attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property Parent: ModelEntity

Property to access the model entity’s parent element reference in a logical hierarchy (_parent).

Returns:

Reference to the parent entity.

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

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the simple aggregate element.

Format: val

Return type:

str

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

Inheritance diagram of IndexedAggregateElement

Parameters:
__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 type found by walking the parent chain upwards.

Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.

Parameters:

type (Type) – Class (type) of the ancestor to find.

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.

classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
Parameters:

predicate (TypeVar(TAttr) | Iterable[TypeVar(TAttr)] | None) – An attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property Index: int

Read-only property to access the index (_index).

Returns:

The index.

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 _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the indexed aggregate element.

Format: 0 => val

Return type:

str

Returns:

Formatted indexed aggregate element.

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression this aggregate element supplies.

_index: int

The index selecting the element this value is assigned to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Aggregates.RangedAggregateElement(node, rng, expression)[source]

Inheritance

Inheritance diagram of RangedAggregateElement

Parameters:
__init__(node, rng, expression)[source]

Initializes an aggregate element chosen by a range.

Parameters:
  • rng (Range) – The range selecting the elements 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 type found by walking the parent chain upwards.

Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.

Parameters:

type (Type) – Class (type) of the ancestor to find.

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.

classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
Parameters:

predicate (TypeVar(TAttr) | Iterable[TypeVar(TAttr)] | None) – An attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property Parent: ModelEntity

Property to access the model entity’s parent element reference in a logical hierarchy (_parent).

Returns:

Reference to the parent entity.

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

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

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

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

Returns:

The range.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the ranged aggregate element.

Format: 0 to 3 => val

Return type:

str

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

Inheritance diagram of NamedAggregateElement

Parameters:
__init__(node, name, expression)[source]

Initializes an aggregate element chosen by a name.

Parameters:
  • name (Symbol) – Reference to the name 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 type found by walking the parent chain upwards.

Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.

Parameters:

type (Type) – Class (type) of the ancestor to find.

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.

classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
Parameters:

predicate (TypeVar(TAttr) | Iterable[TypeVar(TAttr)] | None) – An attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property Name: Symbol

Read-only property to access the name (_name).

Returns:

The name.

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 _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the named aggregate element.

Format: elem => val

Return type:

str

Returns:

Formatted named aggregate element.

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression this aggregate element supplies.

_name: Symbol

Reference to the name selecting the element this value is assigned to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Aggregates.OthersAggregateElement(node, expression)[source]

Inheritance

Inheritance diagram of OthersAggregateElement

Parameters:
__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 type found by walking the parent chain upwards.

Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.

Parameters:

type (Type) – Class (type) of the ancestor to find.

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.

classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
Parameters:

predicate (TypeVar(TAttr) | Iterable[TypeVar(TAttr)] | None) – An attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

Dict[Callable, Tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

property Parent: ModelEntity

Property to access the model entity’s parent element reference in a logical hierarchy (_parent).

Returns:

Reference to the parent entity.

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

Cached read-only property to access an IIR’s position in source code (_position).

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the others aggregate element.

Format: others => val

Return type:

str

Returns:

Formatted others 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.