pyGHDL.dom.Expression

This module implements derived expression classes from pyVHDLModel.Expression.

Classes


Classes

class pyGHDL.dom.Expression.InverseExpression(node, operand)[source]

Represents a logical inversion expression (not).

The operand is available as Operand.

Example

res := not operand;
--     ^^^^^^^^^^^    <- the expression
--         ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.InverseExpression.

Inheritance

Inheritance diagram of InverseExpression

Parameters:
__init__(node, operand)[source]

Initializes an inverse expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('not ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.IdentityExpression(node, operand)[source]

Represents an identity (unary plus) expression.

The operand is available as Operand.

Example

res := + operand;
--     ^^^^^^^^^    <- the expression
--       ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.IdentityExpression.

Inheritance

Inheritance diagram of IdentityExpression

Parameters:
__init__(node, operand)[source]

Initializes an identity expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('+', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.NegationExpression(node, operand)[source]

Represents a negation (unary minus) expression.

The operand is available as Operand.

Example

res := - operand;
--     ^^^^^^^^^    <- the expression
--       ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.NegationExpression.

Inheritance

Inheritance diagram of NegationExpression

Parameters:
__init__(node, operand)[source]

Initializes a negation expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('-', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.AbsoluteExpression(node, operand)[source]

Represents an absolute value expression (abs).

The operand is available as Operand.

Example

res := abs operand;
--     ^^^^^^^^^^^    <- the expression
--         ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.AbsoluteExpression.

Inheritance

Inheritance diagram of AbsoluteExpression

Parameters:
__init__(node, operand)[source]

Initializes an absolute expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('abs ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ParenthesisExpression(node, operand)[source]

Represents a parenthesized sub-expression.

The operand is available as Operand.

Example

res := (lhs + rhs);
--     ^^^^^^^^^^^    <- the sub-expression
--      ^^^^^^^^^     <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.SubExpression.

Inheritance

Inheritance diagram of ParenthesisExpression

Parameters:
__init__(node, operand)[source]

Initializes a parenthesis expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a ParenthesisExpression.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

ParenthesisExpression

Returns:

The translated object.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('(', ')')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Expression.TypeConversion(node, targetSubtype, operand)[source]

Represents a type conversion, e.g. integer(x).

Note

Not reachable from this translator today. GHDL’s parser cannot tell a type conversion from an indexed name or a function call - integer(x), arr(x) and f(x) are all parsed as Parenthesis_Name - and only semantic analysis rewrites one into Type_Conversion. pyGHDL.dom parses without that pass, so a Type_Conversion node never arrives and Parenthesis_Name is translated to IndexedObjectOrFunctionCallSymbol, which carries the ambiguity.

The constructor is kept correct so this class works if semantic analysis is ever run.

Inheritance

Inheritance diagram of TypeConversion

Parameters:
__init__(node, targetSubtype, operand)[source]

Initializes a type conversion.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • targetSubtype (SubtypeSymbol) – Reference to the subtype the expression is converted to.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

property TargetSubtype: SubtypeSymbol

Read-only property to access the target subtype (_targetSubtype).

Returns:

The target subtype.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the type conversion.

Format: integer(val)

Return type:

str

Returns:

Formatted type conversion.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_targetSubtype: SubtypeSymbol

Reference to the subtype the expression is converted to.

_FORMAT: ClassVar[Tuple[str, str]]

The operator’s string representation as (prefix, suffix) around the operand.

class pyGHDL.dom.Expression.FunctionCall(node, operand)[source]

Represents a call to a function.

Example

res := maximum(a, b);
--     ^^^^^^^^^^^^^    <- the call

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.FunctionCall.

Inheritance

Inheritance diagram of FunctionCall

Parameters:
__init__(node, operand)[source]

Initializes a function call.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the function is applied to.

Return type:

None

Todo

The operand is not forwarded to the base-class, because pyVHDLModel.Expression.FunctionCall does not model a call’s operands yet.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 0x7f3f462456d0>

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]

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Expression.AscendingRangeExpression(node, left, right)[source]

Represents an ascending range expression (to).

Both operands are available as LeftOperand and RightOperand.

Example

res := v(0 to 3);
--       ^^^^^^     <- the range
--       ^          <- LeftOperand
--            ^     <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.AscendingRangeExpression.

Inheritance

Inheritance diagram of AscendingRangeExpression

Parameters:
__init__(node, left, right)[source]

Initializes an ascending range expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Direction: <pyTooling.Decorators.readonly object at 0x7f3f4617bf50>

Read-only property to access the direction (_direction).

Returns:

The direction.

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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' to ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_direction: ClassVar[Direction] = 0

The range’s direction, either ascending (to) or descending (downto).

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

class pyGHDL.dom.Expression.DescendingRangeExpression(node, left, right)[source]

Represents a descending range expression (downto).

Both operands are available as LeftOperand and RightOperand.

Example

res := v(7 downto 4);
--       ^^^^^^^^^^     <- the range
--       ^              <- LeftOperand
--                ^     <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.DescendingRangeExpression.

Inheritance

Inheritance diagram of DescendingRangeExpression

Parameters:
__init__(node, left, right)[source]

Initializes a descending range expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Direction: <pyTooling.Decorators.readonly object at 0x7f3f4617bf50>

Read-only property to access the direction (_direction).

Returns:

The direction.

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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' downto ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_direction: ClassVar[Direction] = 1

The range’s direction, either ascending (to) or descending (downto).

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

class pyGHDL.dom.Expression.AdditionExpression(node, left, right)[source]

Represents an addition expression (+).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs + rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.AdditionExpression.

Inheritance

Inheritance diagram of AdditionExpression

Parameters:
__init__(node, left, right)[source]

Initializes an addition expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' + ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.SubtractionExpression(node, left, right)[source]

Represents a subtraction expression (-).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs - rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.SubtractionExpression.

Inheritance

Inheritance diagram of SubtractionExpression

Parameters:
__init__(node, left, right)[source]

Initializes a subtraction expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' - ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ConcatenationExpression(node, left, right)[source]

Represents a concatenation expression (&).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs & rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ConcatenationExpression.

Inheritance

Inheritance diagram of ConcatenationExpression

Parameters:
__init__(node, left, right)[source]

Initializes a concatenation expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' & ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MultiplyExpression(node, left, right)[source]

Represents a multiplication expression (*).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs * rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MultiplyExpression.

Inheritance

Inheritance diagram of MultiplyExpression

Parameters:
__init__(node, left, right)[source]

Initializes a multiply expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' * ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.DivisionExpression(node, left, right)[source]

Represents a division expression (/).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs / rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.DivisionExpression.

Inheritance

Inheritance diagram of DivisionExpression

Parameters:
__init__(node, left, right)[source]

Initializes a division expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' / ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.RemainderExpression(node, left, right)[source]

Represents a remainder expression (rem).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs rem rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.RemainderExpression.

Inheritance

Inheritance diagram of RemainderExpression

Parameters:
__init__(node, left, right)[source]

Initializes a remainder expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' rem ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ModuloExpression(node, left, right)[source]

Represents a modulo expression (mod).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs mod rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ModuloExpression.

Inheritance

Inheritance diagram of ModuloExpression

Parameters:
__init__(node, left, right)[source]

Initializes a modulo expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' mod ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ExponentiationExpression(node, left, right)[source]

Represents an exponentiation expression (**).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ** rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ExponentiationExpression.

Inheritance

Inheritance diagram of ExponentiationExpression

Parameters:
__init__(node, left, right)[source]

Initializes an exponentiation expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', '**', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.AndExpression(node, left, right)[source]

Represents a logical and expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs and rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.AndExpression.

Inheritance

Inheritance diagram of AndExpression

Parameters:
__init__(node, left, right)[source]

Initializes an and expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' and ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.NandExpression(node, left, right)[source]

Represents a logical nand expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs nand rhs;
--     ^^^^^^^^^^^^    <- the expression
--     ^^^             <- LeftOperand
--              ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.NandExpression.

Inheritance

Inheritance diagram of NandExpression

Parameters:
__init__(node, left, right)[source]

Initializes a nand expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' nand ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.OrExpression(node, left, right)[source]

Represents a logical or expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs or rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.OrExpression.

Inheritance

Inheritance diagram of OrExpression

Parameters:
__init__(node, left, right)[source]

Initializes an or expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' or ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.NorExpression(node, left, right)[source]

Represents a logical nor expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs nor rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.NorExpression.

Inheritance

Inheritance diagram of NorExpression

Parameters:
__init__(node, left, right)[source]

Initializes a nor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' nor ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.XorExpression(node, left, right)[source]

Represents a logical xor expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs xor rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.XorExpression.

Inheritance

Inheritance diagram of XorExpression

Parameters:
__init__(node, left, right)[source]

Initializes an xor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' xor ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.XnorExpression(node, left, right)[source]

Represents a logical xnor expression.

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs xnor rhs;
--     ^^^^^^^^^^^^    <- the expression
--     ^^^             <- LeftOperand
--              ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.XnorExpression.

Inheritance

Inheritance diagram of XnorExpression

Parameters:
__init__(node, left, right)[source]

Initializes an xnor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' xnor ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryAndExpression(node, operand)[source]

Represents a and reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := and operand;
--     ^^^^^^^^^^^    <- the expression
--         ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryAndExpression.

Inheritance

Inheritance diagram of UnaryAndExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary and expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('and ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryNandExpression(node, operand)[source]

Represents a nand reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := nand operand;
--     ^^^^^^^^^^^^    <- the expression
--          ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryNandExpression.

Inheritance

Inheritance diagram of UnaryNandExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary nand expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('nand ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryOrExpression(node, operand)[source]

Represents a or reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := or operand;
--     ^^^^^^^^^^    <- the expression
--        ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryOrExpression.

Inheritance

Inheritance diagram of UnaryOrExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary or expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('or ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryNorExpression(node, operand)[source]

Represents a nor reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := nor operand;
--     ^^^^^^^^^^^    <- the expression
--         ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryNorExpression.

Inheritance

Inheritance diagram of UnaryNorExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary nor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('nor ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryXorExpression(node, operand)[source]

Represents a xor reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := xor operand;
--     ^^^^^^^^^^^    <- the expression
--         ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryXorExpression.

Inheritance

Inheritance diagram of UnaryXorExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary xor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('xor ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnaryXnorExpression(node, operand)[source]

Represents a xnor reduction expression.

A reduction operator folds all elements of an array into a single value. The operand is available as Operand.

Example

res := xnor operand;
--     ^^^^^^^^^^^^    <- the expression
--          ^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnaryXnorExpression.

Inheritance

Inheritance diagram of UnaryXnorExpression

Parameters:
__init__(node, operand)[source]

Initializes a unary xnor expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression the operator is applied to.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

_FORMAT: ClassVar[Tuple[str, str]] = ('xnor ', '')

The operator’s string representation as (prefix, suffix) around the operand.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the unary expression.

Format: not operand

Return type:

str

Returns:

Formatted unary expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression the operator is applied to.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

classmethod parse(node)

Translates an IIR node to a _ParseUnaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

UnaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.EqualExpression(node, left, right)[source]

Represents an equality expression (=).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs = rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.EqualExpression.

Inheritance

Inheritance diagram of EqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes an equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' = ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.UnequalExpression(node, left, right)[source]

Represents an inequality expression (/=).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs /= rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.UnequalExpression.

Inheritance

Inheritance diagram of UnequalExpression

Parameters:
__init__(node, left, right)[source]

Initializes an unequal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' /= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.LessThanExpression(node, left, right)[source]

Represents a less-than expression (<).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs < rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.LessThanExpression.

Inheritance

Inheritance diagram of LessThanExpression

Parameters:
__init__(node, left, right)[source]

Initializes a less than expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' < ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.LessEqualExpression(node, left, right)[source]

Represents a less-or-equal expression (<=).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs <= rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.LessEqualExpression.

Inheritance

Inheritance diagram of LessEqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes a less equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' <= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.GreaterThanExpression(node, left, right)[source]

Represents a greater-than expression (>).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs > rhs;
--     ^^^^^^^^^    <- the expression
--     ^^^          <- LeftOperand
--           ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.GreaterThanExpression.

Inheritance

Inheritance diagram of GreaterThanExpression

Parameters:
__init__(node, left, right)[source]

Initializes a greater than expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' > ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.GreaterEqualExpression(node, left, right)[source]

Represents a greater-or-equal expression (>=).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs >= rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.GreaterEqualExpression.

Inheritance

Inheritance diagram of GreaterEqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes a greater equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' >= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingEqualExpression(node, left, right)[source]

Represents a matching equality expression (?=).

Unlike =, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?= rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingEqualExpression.

Inheritance

Inheritance diagram of MatchingEqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingUnequalExpression(node, left, right)[source]

Represents a matching inequality expression (?/=).

Unlike /=, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?/= rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingUnequalExpression.

Inheritance

Inheritance diagram of MatchingUnequalExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching unequal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?/= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingLessThanExpression(node, left, right)[source]

Represents a matching less-than expression (?<).

Unlike <, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?< rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingLessThanExpression.

Inheritance

Inheritance diagram of MatchingLessThanExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching less than expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?< ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingLessEqualExpression(node, left, right)[source]

Represents a matching less-or-equal expression (?<=).

Unlike <=, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?<= rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingLessEqualExpression.

Inheritance

Inheritance diagram of MatchingLessEqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching less equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?<= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingGreaterThanExpression(node, left, right)[source]

Represents a matching greater-than expression (?>).

Unlike >, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?> rhs;
--     ^^^^^^^^^^    <- the expression
--     ^^^           <- LeftOperand
--            ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingGreaterThanExpression.

Inheritance

Inheritance diagram of MatchingGreaterThanExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching greater than expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?> ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.MatchingGreaterEqualExpression(node, left, right)[source]

Represents a matching greater-or-equal expression (?>=).

Unlike >=, a matching operator returns a bit/std_ulogic. Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ?>= rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.MatchingGreaterEqualExpression.

Inheritance

Inheritance diagram of MatchingGreaterEqualExpression

Parameters:
__init__(node, left, right)[source]

Initializes a matching greater equal expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ?>= ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ShiftRightLogicExpression(node, left, right)[source]

Represents a logical right shift expression (srl).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs srl rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ShiftRightLogicExpression.

Inheritance

Inheritance diagram of ShiftRightLogicExpression

Parameters:
__init__(node, left, right)[source]

Initializes a shift right logic expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' srl ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ShiftLeftLogicExpression(node, left, right)[source]

Represents a logical left shift expression (sll).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs sll rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ShiftLeftLogicExpression.

Inheritance

Inheritance diagram of ShiftLeftLogicExpression

Parameters:
__init__(node, left, right)[source]

Initializes a shift left logic expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' sll ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ShiftRightArithmeticExpression(node, left, right)[source]

Represents an arithmetic right shift expression (sra).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs sra rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ShiftRightArithmeticExpression.

Inheritance

Inheritance diagram of ShiftRightArithmeticExpression

Parameters:
__init__(node, left, right)[source]

Initializes a shift right arithmetic expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' sra ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.ShiftLeftArithmeticExpression(node, left, right)[source]

Represents an arithmetic left shift expression (sla).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs sla rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.ShiftLeftArithmeticExpression.

Inheritance

Inheritance diagram of ShiftLeftArithmeticExpression

Parameters:
__init__(node, left, right)[source]

Initializes a shift left arithmetic expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' sla ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.RotateRightExpression(node, left, right)[source]

Represents a right rotate expression (ror).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs ror rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.RotateRightExpression.

Inheritance

Inheritance diagram of RotateRightExpression

Parameters:
__init__(node, left, right)[source]

Initializes a rotate right expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' ror ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.RotateLeftExpression(node, left, right)[source]

Represents a left rotate expression (rol).

Both operands are available as LeftOperand and RightOperand.

Example

res := lhs rol rhs;
--     ^^^^^^^^^^^    <- the expression
--     ^^^            <- LeftOperand
--             ^^^    <- RightOperand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.RotateLeftExpression.

Inheritance

Inheritance diagram of RotateLeftExpression

Parameters:
__init__(node, left, right)[source]

Initializes a rotate left expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • left (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression left of the operator.

  • right (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression right of the operator.

Return type:

None

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 LeftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the left operand (_leftOperand).

Returns:

The left operand.

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

Returns:

The IIR’s position in the source file.

property RightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the right operand (_rightOperand).

Returns:

The right operand.

_FORMAT: ClassVar[Tuple[str, str, str]] = ('', ' rol ', '')

The operator’s string representation as (prefix, infix, suffix).

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the binary expression.

Format: lhs + rhs

Return type:

str

Returns:

Formatted binary expression.

_leftOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression left of the operator.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_rightOperand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression right of the operator.

classmethod parse(node)

Translates an IIR node to a _ParseBinaryExpressionMixin.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

BinaryExpression

Returns:

The translated object.

class pyGHDL.dom.Expression.QualifiedExpression(node, subtype, operand)[source]

Represents a qualified expression.

A qualified expression states the subtype (Subtype) of its operand (Operand), resolving which of several overloaded meanings is intended.

Example

res := byte'(others => '0');
--     ^^^^                    <- Subtype
--          ^^^^^^^^^^^^^^^    <- Operand

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.QualifiedExpression.

Inheritance

Inheritance diagram of QualifiedExpression

Parameters:
__init__(node, subtype, operand)[source]

Initializes a qualified expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • subtype (Symbol) – Reference to the subtype qualifying the expression.

  • operand (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression being qualified.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a QualifiedExpression.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

QualifiedExpression

Returns:

The translated object.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 Operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

Read-only property to access the operand (_operand).

Returns:

The operand.

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

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

Read-only property to access the subtype (_subtype).

Returns:

The subtype.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the qualified expression.

Format: byte'(val)

Return type:

str

Returns:

Formatted qualified expression.

_operand: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression being qualified.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_subtype: Symbol

Reference to the subtype qualifying the expression.

class pyGHDL.dom.Expression.SubtypeAllocation(node, subtype)[source]

Represents an allocation of a subtype via new.

The allocated subtype is available as Subtype. The allocated object is default-initialized.

Example

p := new integer;
--       ^^^^^^^    <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.SubtypeAllocation.

Inheritance

Inheritance diagram of SubtypeAllocation

Parameters:
__init__(node, subtype)[source]

Initializes an allocation of a subtype via new.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • subtype (Symbol) – Reference to the subtype being allocated.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a SubtypeAllocation.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

QualifiedExpressionAllocation

Returns:

The translated object.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 0x7f3f462456d0>

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 Subtype: Symbol

Read-only property to access the subtype (_subtype).

Returns:

The subtype.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the subtype allocation.

Format: new node

Return type:

str

Returns:

Formatted subtype allocation.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_subtype: Symbol

Reference to the subtype being allocated.

class pyGHDL.dom.Expression.QualifiedExpressionAllocation(node, qualifiedExpression)[source]

Represents an allocation initialized by a qualified expression.

The qualified expression providing the initial value is available as QualifiedExpression.

Example

p := new integer'(5);
--       ^^^^^^^^^^^    <- QualifiedExpression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.QualifiedExpressionAllocation.

Inheritance

Inheritance diagram of QualifiedExpressionAllocation

Parameters:
__init__(node, qualifiedExpression)[source]

Initializes an allocation initialized by a qualified expression.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • qualifiedExpression (QualifiedExpression) – The qualified expression the allocated object is initialized with.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a QualifiedExpressionAllocation.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

QualifiedExpressionAllocation

Returns:

The translated object.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_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 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 0x7f3f462456d0>

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 QualifiedExpression: <pyTooling.Decorators.readonly object at 0x7f3f461e7550>

Read-only property to access the qualified expression (_qualifiedExpression).

Returns:

The qualified expression.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the qualified expression allocation.

Format: new byte'(val)

Return type:

str

Returns:

Formatted qualified expression allocation.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_qualifiedExpression: <pyTooling.Decorators.readonly object at 0x7f3f461e7550>

The qualified expression the allocated object is initialized with.

class pyGHDL.dom.Expression.Aggregate(node, elements)[source]

Represents an aggregate.

An aggregate composes a value from its elements (Elements), each of which associates a choice with a value.

Example

res := (0 => '1', 1 to 3 => '0', others => '1');
--     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^    <- Elements

This class implements a pyGHDL.dom object derived from pyVHDLModel.Expression.Aggregate.

Inheritance

Inheritance diagram of Aggregate

Parameters:
__init__(node, elements)[source]

Initializes an aggregate.

Parameters:
  • node (TypeVar(Iir, bound= c_int)) – The IIR node this object was translated from.

  • elements (List[AggregateElement]) – List of all elements of this aggregate, in the order they were written.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to an Aggregate.

Parameters:

node (TypeVar(Iir, bound= c_int)) – The IIR node this object is translated from.

Return type:

Aggregate

Returns:

The translated object.

_iirNode: Iir

The IIR node in libghdl’s tree this DOM object was translated from.

_position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>

The IIR node’s position in the source file, resolved on first access and then cached.

property Elements: List[AggregateElement]

Read-only property to access the elements (_elements).

Returns:

List of elements.

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 0x7f3f462456d0>

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 aggregate.

Format: (1, others => 0)

Return type:

str

Returns:

Formatted aggregate.

_elements: List[AggregateElement]

List of all elements of this aggregate, in the order they were written.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.