pyGHDL.dom.Sequential

This module implements derived sequential statement classes from pyVHDLModel.Sequential.

Classes


Classes

class pyGHDL.dom.Sequential.IfBranch(branchNode, condition, statements=None)[source]

Represents the if branch of an if statement.

The branch’s condition is available as Condition, its body as Statements.

Example

The whole if statement is shown; the bracket marks the part this class represents.

if sel = '0' then     -- ┐ IfBranch
-- ^^^^^^^^^          -- │   <- Condition
  s <= '0';           -- │
--^^^^^^^^^           -- ┘   <- Statements
elsif sel = '1' then
  s <= '1';
else
  s <= '0';
end if;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.IfBranch.

Inheritance

Inheritance diagram of IfBranch

Parameters:
__init__(branchNode, condition, statements=None)[source]

Initializes an if branch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which this branch’s statements are executed.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

Return type:

None

classmethod parse(branchNode, label)[source]

Translates the IIR node of the branch to an IfBranch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch.

  • label (str) – The statement’s label, or None if it has none.

Return type:

IfBranch

Returns:

The translated branch.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_parent

Reference to a parent entity in the logical model hierarchy.

_statements

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.ElsifBranch(branchNode, condition, statements=None)[source]

Represents an elsif branch of an if statement.

The branch’s condition is available as Condition, its body as Statements. An if statement may have any number of them.

Example

The whole if statement is shown; the bracket marks the part this class represents.

if sel = '0' then
  s <= '0';
elsif sel = '1' then  -- ┐ ElsifBranch
--    ^^^^^^^^^       -- │   <- Condition
  s <= '1';           -- │
--^^^^^^^^^           -- ┘   <- Statements
else
  s <= '0';
end if;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.ElsifBranch.

Inheritance

Inheritance diagram of ElsifBranch

Parameters:
__init__(branchNode, condition, statements=None)[source]

Initializes an elsif branch of an if statement.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which this branch’s statements are executed.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

Return type:

None

classmethod parse(branchNode, condition, label)[source]

Translates the IIR node of the branch to an ElsifBranch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch.

  • condition (TypeVar(Iir, bound= c_int)) – The condition guarding the branch.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ElsifBranch

Returns:

The translated branch.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_parent

Reference to a parent entity in the logical model hierarchy.

_statements

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.ElseBranch(branchNode, statements=None)[source]

Represents the else branch of an if statement.

Unlike the other branches, an else branch has no condition; it only has a body (Statements). An if statement has at most one.

Example

The whole if statement is shown; the bracket marks the part this class represents.

if sel = '0' then
  s <= '0';
elsif sel = '1' then
  s <= '1';
else                  -- ┐ ElseBranch
  s <= '0';           -- │
--^^^^^^^^^           -- ┘   <- Statements
end if;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.ElseBranch.

Inheritance

Inheritance diagram of ElseBranch

Parameters:
__init__(branchNode, statements=None)[source]

Initializes an else branch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch this object represents.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

Return type:

None

classmethod parse(branchNode, label)[source]

Translates the IIR node of the branch to an ElseBranch.

Parameters:
  • branchNode (TypeVar(Iir, bound= c_int)) – The IIR node of the branch.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ElseBranch

Returns:

The translated branch.

_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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_statements: List[SequentialStatement]

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.IfStatement(ifNode, ifBranch, elsifBranches=None, elseBranch=None, label=None)[source]

Represents an if statement.

An if statement has one if branch (IfBranch), any number of elsif branches (ElsIfBranches) and an optional else branch (ElseBranch).

Example

Only an if branch:

  lbl : if sel = '0' then
--^^^                       <- optional Label
    s <= '0';
  end if;

With elsif and else branches:

  lbl : if sel = '0' then
--^^^                       <- optional Label
--      ^^^^^^^^^^^^^^^^^   <- IfBranch
    s <= '0';
  elsif sel = '1' then
--^^^^^^^^^^^^^^^^^^^^      <- ElsIfBranches[0]
    s <= '1';
  else
--^^^^                      <- ElseBranch
    s <= '0';
  end if;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.IfStatement.

Inheritance

Inheritance diagram of IfStatement

Parameters:
__init__(ifNode, ifBranch, elsifBranches=None, elseBranch=None, label=None)[source]

Initializes an if statement.

Parameters:
  • ifNode (TypeVar(Iir, bound= c_int)) – The IIR node of the if statement.

  • ifBranch (IfBranch) – The mandatory if branch.

  • elsifBranches (Iterable[ElsifBranch]) – List of all elsif branches, in the order they were written.

  • elseBranch (ElseBranch) – The optional else branch, or None if none was given.

  • label (str) – The label of the if statement, or None if it has none.

Return type:

None

classmethod parse(ifNode, label)[source]

Translates the IIR node of the if statement to an IfStatement.

Parameters:
  • ifNode (TypeVar(Iir, bound= c_int)) – The IIR node of the if statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

IfStatement

Returns:

The translated if statement.

_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 ElsIfBranches: List[ElsifBranch]

Read-only property to access the elsif-branch of the if-statement (_elsifBranch).

Returns:

The elsif-branch.

property ElseBranch: <pyTooling.Decorators.readonly object at 0x7f3f460f4f50> | None

Read-only property to access the else-branch of the if-statement (_elseBranch).

Returns:

The else-branch.

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

Read-only property to access the if-branch of the if-statement (_ifBranch).

Returns:

The if-branch.

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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]

_elseBranch: <pyTooling.Decorators.readonly object at 0x7f3f460f4f50> | None

The optional else branch, or None if none was given.

_elsifBranches: List[ElsifBranch]

List of all elsif branches, in the order they were written.

_ifBranch: <pyTooling.Decorators.readonly object at 0x7f3f460f4e50>

The mandatory if branch.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.IndexedChoice(node, expression)[source]

Represents a case choice given by a single value.

The value is available as Expression.

Example

when 0      => v := '1';
--   ^                     <- Expression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.IndexedChoice.

Inheritance

Inheritance diagram of IndexedChoice

Parameters:
__init__(node, expression)[source]

Initializes a case choice given by a single value.

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

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The expression this choice selects on.

Return type:

None

_iirNode

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

_position

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

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

property Position: <pyTooling.Decorators.readonly object at 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 indexed case choice.

Format: 0

Return type:

str

Returns:

Formatted indexed case choice.

_expression

The expression this choice selects on.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.RangedChoice(node, rng)[source]

Represents a case choice given by a range.

The range is available as Range.

Example

when 1 to 2 => v := '0';
--   ^^^^^^                <- Range

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.RangedChoice.

Inheritance

Inheritance diagram of RangedChoice

Parameters:
__init__(node, rng)[source]

Initializes a case choice given by a range.

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

  • rng (Range) – The range this choice selects on.

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 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 Range: Range

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

Returns:

The range.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the ranged case choice.

Format: 0 to 3

Return type:

str

Returns:

Formatted ranged case choice.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_range: Range

The range this choice selects on.

class pyGHDL.dom.Sequential.Case(node, choices, statements=None)[source]

Represents one alternative of a case statement, selected by its choices.

Example

when 1 to 2 => v := '0';
--   ^^^^^^                <- Choices
--             ^^^^^^^^^   <- the statements

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.Case.

Inheritance

Inheritance diagram of Case

Parameters:
__init__(node, choices, statements=None)[source]

Initializes a case.

Parameters:
Return type:

None

classmethod parse(caseNode, choices, label)[source]

Translates the IIR node of the alternative to a Case.

Parameters:
  • caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the alternative.

  • choices (Iterable[SequentialChoice]) – List of all choices selecting this alternative.

  • label (str) – The statement’s label, or None if it has none.

Return type:

Case

Returns:

The translated alternative.

_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 Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the case alternative.

Format: when 0 | 1 =>

Return type:

str

Returns:

Formatted case alternative.

_choices: List[BaseChoice]

List of all choices selecting this alternative.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_statements: List[SequentialStatement]

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.OthersCase(caseNode, statements=None)[source]

Represents the others alternative of a case statement.

It covers every choice not named explicitly.

Example

when others => null;
--   ^^^^^^            <- the choice

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.OthersCase.

Inheritance

Inheritance diagram of OthersCase

Parameters:
__init__(caseNode, statements=None)[source]

Initializes an others alternative.

Parameters:
Return type:

None

classmethod parse(caseNode, label=None)[source]

Translates the IIR node of the alternative to an OthersCase.

Parameters:
  • caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the alternative.

  • label (str) – The statement’s label, or None if it has none.

Return type:

OthersCase

Returns:

The translated alternative.

_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 Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the others case alternative.

Format: when others =>

Return type:

str

Returns:

Formatted others case alternative.

_choices: List[BaseChoice]

List of all choices selecting this alternative.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_statements: List[SequentialStatement]

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.CaseStatement(caseNode, label, expression, cases)[source]

Represents a case statement.

The expression being tested is available as SelectExpression, the alternatives as Cases.

Example

  lbl : case sel is
--^^^                          <- optional Label
--           ^^^               <- SelectExpression
    when '0'    => s <= '1';
--  ^^^^^^^^^^^^^^^^^^^^^^^^   <- Cases[0]
    when others => null;
--  ^^^^^^^^^^^^^^^^^^^^       <- Cases[1]
  end case;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.CaseStatement.

Inheritance

Inheritance diagram of CaseStatement

Parameters:
__init__(caseNode, label, expression, cases)[source]

Initializes a case statement.

Parameters:
  • caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the case statement.

  • label (str) – The label of the case statement, or None if it has none.

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

  • cases (Iterable[SequentialCase]) – List of all alternatives, in the order they were written.

Return type:

None

classmethod parse(caseNode, label)[source]

Translates the IIR node of the alternative to a CaseStatement.

Parameters:
  • caseNode (TypeVar(Iir, bound= c_int)) – The IIR node of the alternative.

  • label (str) – The statement’s label, or None if it has none.

Return type:

CaseStatement

Returns:

The translated alternative.

_iirNode

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

_position

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

property Cases: List[SequentialCase]

Read-only property to access the cases (_cases).

Returns:

List of cases.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

Read-only property to access the select expression (_expression).

Returns:

The select expression.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_cases

List of all alternatives, in the order they were written.

_expression

The expression being tested.

_label

The label of a model entity.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.ForLoopStatement(loopNode, loopIndex, rng, statements=None, label=None)[source]

Represents a for-loop statement.

The loop index is available as LoopIndex, the iteration range as Range and the loop body as Statements.

Example

  lbl : for k in 0 to 3 loop
--^^^                          <- optional Label
--          ^                  <- LoopIndex
--               ^^^^^^        <- Range
    null;
--  ^^^^^                      <- Statements
  end loop;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.ForLoopStatement.

Inheritance

Inheritance diagram of ForLoopStatement

Parameters:
__init__(loopNode, loopIndex, rng, statements=None, label=None)[source]

Initializes a for..loop statement.

Parameters:
  • loopNode (TypeVar(Iir, bound= c_int)) – The IIR node of the loop statement.

  • loopIndex (str) – The name of the loop’s index.

  • rng (Range) – The range the loop iterates over.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

  • label (str) – The label of the for..loop statement, or None if it has none.

Return type:

None

classmethod parse(loopNode, label)[source]

Translates the IIR node of the loop statement to a ForLoopStatement.

Parameters:
  • loopNode (TypeVar(Iir, bound= c_int)) – The IIR node of the loop statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ForLoopStatement

Returns:

The translated loop statement.

_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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property LoopIndex: str

Read-only property to access the loop index (_loopIndex).

Returns:

The loop index.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

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

Returns:

The range.

property Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_loopIndex: str

The name of the loop’s index.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_range: <pyTooling.Decorators.readonly object at 0x7f3f460f60d0>

The range the loop iterates over.

_statements: List[SequentialStatement]

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.WhileLoopStatement(loopNode, condition, statements=None, label=None)[source]

Represents a while-loop statement.

The loop condition is available as Condition, the loop body as Statements.

Example

  lbl : while i < 4 loop
--^^^                      <- optional Label
--            ^^^^^        <- Condition
    null;
--  ^^^^^                  <- Statements
  end loop;

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.WhileLoopStatement.

Inheritance

Inheritance diagram of WhileLoopStatement

Parameters:
__init__(loopNode, condition, statements=None, label=None)[source]

Initializes a while..loop statement.

Parameters:
  • loopNode (TypeVar(Iir, bound= c_int)) – The IIR node of the loop statement.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition tested before each iteration; the loop ends when it is false.

  • statements (Iterable[SequentialStatement]) – List of all sequential statements in this construct.

  • label (str) – The label of the while..loop statement, or None if it has none.

Return type:

None

classmethod parse(loopNode, label)[source]

Translates the IIR node of the loop statement to a WhileLoopStatement.

Parameters:
  • loopNode (TypeVar(Iir, bound= c_int)) – The IIR node of the loop statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

WhileLoopStatement

Returns:

The translated loop statement.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Statements: List[SequentialStatement]

Read-only property to access the list of sequential statements (_statements).

Returns:

A list of sequential statements.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

_statements

List of all sequential statements in this construct.

class pyGHDL.dom.Sequential.SequentialSimpleSignalAssignment(assignmentNode, target, waveform, label=None)[source]

Represents a simple sequential signal assignment.

The assignment’s destination is available as Target, its value as Waveform.

Example

  lbl : s <= '1';
--^^^               <- optional Label
--      ^           <- Target
--           ^^^    <- Waveform

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialSimpleSignalAssignment.

Inheritance

Inheritance diagram of SequentialSimpleSignalAssignment

Parameters:
__init__(assignmentNode, target, waveform, label=None)[source]

Initializes a simple sequential signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • waveform (Iterable[WaveformElement]) – List of all waveform elements, in the order they were written.

  • label (str) – The label of the sequential signal assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialSimpleSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialSimpleSignalAssignment

Returns:

The translated assignment statement.

_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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

property Waveform: List[WaveformElement]

Read-only property to access the waveform (_waveform).

Returns:

List of waveform.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

_waveform: List[WaveformElement]

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

class pyGHDL.dom.Sequential.ConditionalExpression(node, expression, condition=None)[source]

Represents one branch of a conditional variable assignment.

Each branch pairs an expression (Expression) with a condition (Condition). The final branch has no when, so its condition is None.

Example

v := '1' when cond else '0';
--   ^^^^^^^^^^^^^             <- this branch: Expression='1', Condition=cond
--                      ^^^    <- final branch (no ``when``): Expression='0', Condition=None

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.ConditionalExpression.

Inheritance

Inheritance diagram of ConditionalExpression

Parameters:
__init__(node, expression, condition=None)[source]

Initializes a conditional expression.

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

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The value assigned when the condition holds.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition selecting this alternative.

Return type:

None

classmethod parse(node)[source]

Translates an IIR node to a ConditionalExpression.

Parameters:

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

Return type:

ConditionalExpression

Returns:

The translated object.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

property Position: <pyTooling.Decorators.readonly object at 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]

_condition

The condition guarding this statement.

_expression

The expression held by this construct.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.SelectedExpression(node, choices, expression)[source]

Represents one alternative of a selected variable assignment.

Each alternative pairs an expression (Expression) with the choices selecting it (Choices).

Example

with sel select v := '1' when '0', '0' when others;
--                   ^^^^^^^^^^^^                     <- this alternative: Choices=['0'], Expression='1'

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.SelectedExpression.

Inheritance

Inheritance diagram of SelectedExpression

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

Initializes a selected expression.

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

  • choices (Iterable) – List of all choices selecting this alternative.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The value assigned for the matching choices.

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 Choices: List[BaseChoice]

Read-only property to access the choices (_choices).

Returns:

List of choices.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

property Position: <pyTooling.Decorators.readonly object at 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]

_choices: List[BaseChoice]

List of all choices selecting this alternative.

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.OthersSelectedExpression(node, expression)[source]

Represents the others alternative of a selected variable assignment.

It supplies the expression (Expression) for every choice not named explicitly.

Example

with sel select v := '1' when '0', '0' when others;
--                                 ^^^^^^^^^^^^^^^    <- the others alternative

This class implements a pyGHDL.dom object derived from pyVHDLModel.Common.OthersSelectedExpression.

Inheritance

Inheritance diagram of OthersSelectedExpression

Parameters:
__init__(node, expression)[source]

Initializes an others selected expression.

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

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The value assigned for every unnamed choice.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

property Position: <pyTooling.Decorators.readonly object at 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]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.SequentialVariableAssignment(assignmentNode, target, expression, label=None)[source]

Represents a simple sequential variable assignment.

The assignment’s destination is available as Target, its value as Expression.

Example

  lbl : v := '1';
--^^^               <- optional Label
--      ^           <- Target
--           ^^^    <- Expression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialVariableAssignment.

Inheritance

Inheritance diagram of SequentialVariableAssignment

Parameters:
__init__(assignmentNode, target, expression, label=None)[source]

Initializes a simple sequential variable assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (VariableSymbol) – Reference to the assignment’s destination.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The assigned expression.

  • label (str) – The label of the variable assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialVariableAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialVariableAssignment

Returns:

The translated assignment statement.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Target: VariableSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The assigned expression.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SequentialConditionalVariableAssignment(assignmentNode, target, conditionalExpressions, label=None)[source]

Represents a conditional sequential variable assignment.

The alternatives are available as ConditionalExpressions, a list of ConditionalExpression. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : v := '1' when sel = '0' else '0';
--^^^                                       <- optional Label
--      ^                                   <- Target
--           ^^^^^^^^^^^^^^^^^^             <- ConditionalExpressions[0]
--                                   ^^^    <- ConditionalExpressions[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialConditionalVariableAssignment.

Inheritance

Inheritance diagram of SequentialConditionalVariableAssignment

Parameters:
__init__(assignmentNode, target, conditionalExpressions, label=None)[source]

Initializes a conditional sequential variable assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (VariableSymbol) – Reference to the assignment’s destination.

  • conditionalExpressions (Iterable[ConditionalExpression]) – List of all alternatives, in the order they were written.

  • label (str) – The label of the conditional variable assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialConditionalVariableAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialConditionalVariableAssignment

Returns:

The translated assignment statement.

_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 ConditionalExpressions: List[ConditionalExpression]

Read-only property to access the conditional expressions (_conditionalExpressions).

Returns:

List of conditional expressions.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_conditionalExpressions: List[ConditionalExpression]

List of all alternatives, in the order they were written.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SequentialConditionalSignalAssignment(assignmentNode, target, conditionalWaveforms, label=None)[source]

Represents a conditional sequential signal assignment.

The alternatives are available as ConditionalWaveforms, a list of ConditionalWaveform. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : s <= '1' when sel = '0' else '0';
--^^^                                       <- optional Label
--      ^                                   <- Target
--           ^^^^^^^^^^^^^^^^^^             <- ConditionalWaveforms[0]
--                                   ^^^    <- ConditionalWaveforms[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialConditionalSignalAssignment.

Inheritance

Inheritance diagram of SequentialConditionalSignalAssignment

Parameters:
__init__(assignmentNode, target, conditionalWaveforms, label=None)[source]

Initializes a conditional sequential signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • conditionalWaveforms (Iterable) – All alternatives, in order.

  • label (str) – The label of the conditional sequential signal assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialConditionalSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialConditionalSignalAssignment

Returns:

The translated assignment statement.

_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 ConditionalWaveforms: List[ConditionalWaveform]

Read-only property to access the conditional waveforms (_conditionalWaveforms).

Returns:

List of conditional waveforms.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_conditionalWaveforms: List[ConditionalWaveform]

All alternatives, in order.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SequentialSelectedVariableAssignment(assignmentNode, target, expression, selectedExpressions, label=None)[source]

Represents a selected sequential variable assignment.

The selector is available as Expression, the alternatives as SelectedExpressions, a list of SelectedExpression. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : with sel select v := '1' when '0', '0' when others;
--^^^                                                         <- optional Label
--           ^^^                                              <- Expression
--                      ^                                     <- Target
--                           ^^^^^^^^^^^^                     <- SelectedExpressions[0]
--                                         ^^^^^^^^^^^^^^^    <- SelectedExpressions[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialSelectedVariableAssignment.

Inheritance

Inheritance diagram of SequentialSelectedVariableAssignment

Parameters:
__init__(assignmentNode, target, expression, selectedExpressions, label=None)[source]

Initializes a selected sequential variable assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (VariableSymbol) – Reference to the assignment’s destination.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The selector expression.

  • selectedExpressions (Iterable) – All alternatives, in order.

  • label (str) – The label of the selected variable assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialSelectedVariableAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialSelectedVariableAssignment

Returns:

The translated assignment statement.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 SelectedExpressions: List[SelectedExpression | OthersSelectedExpression]

Read-only property to access the selected expressions (_selectedExpressions).

Returns:

List of selected expressions.

property Target: Symbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_selectedExpressions: List[SelectedExpression | OthersSelectedExpression]

All alternatives, in order.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SequentialSelectedSignalAssignment(assignmentNode, target, expression, selectedWaveforms, label=None)[source]

Represents a selected sequential signal assignment.

The selector is available as Expression, the alternatives as SelectedWaveforms, a list of SelectedWaveform. The model holds them in a list and has no distinct field per alternative, so the markers below name list elements.

Example

  lbl : with sel select s <= '1' when '0', '0' when others;
--^^^                                                         <- optional Label
--           ^^^                                              <- Expression
--                      ^                                     <- Target
--                           ^^^^^^^^^^^^                     <- SelectedWaveforms[0]
--                                         ^^^^^^^^^^^^^^^    <- SelectedWaveforms[1]

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialSelectedSignalAssignment.

Inheritance

Inheritance diagram of SequentialSelectedSignalAssignment

Parameters:
__init__(assignmentNode, target, expression, selectedWaveforms, label=None)[source]

Initializes a selected sequential signal assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The selector expression.

  • selectedWaveforms (Iterable) – All alternatives, in order.

  • label (str) – The label of the selected sequential signal assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SequentialSelectedSignalAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialSelectedSignalAssignment

Returns:

The translated assignment statement.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 SelectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]

Read-only property to access the selected waveforms (_selectedWaveforms).

Returns:

List of selected waveforms.

property Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_selectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]

All alternatives, in order.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SignalForceAssignment(assignmentNode, target, expression, label=None)[source]

Represents a signal force assignment.

A force assignment overrides a signal’s driver until it is released.

Example

  lbl : s <= force '1';
--^^^                     <- optional Label
--      ^                 <- Target
--                 ^^^    <- Expression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SignalForceAssignment.

Inheritance

Inheritance diagram of SignalForceAssignment

Parameters:
__init__(assignmentNode, target, expression, label=None)[source]

Initializes a signal force assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The value forced onto the signal.

  • label (str) – The label of the signal force assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SignalForceAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SignalForceAssignment

Returns:

The translated assignment statement.

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

Read-only property to access the expression (_expression).

Returns:

The expression.

GetAncestor(type)

Return the closest ancestor of the given type found by walking the parent chain upwards.

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal

The expression held by this construct.

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SignalReleaseAssignment(assignmentNode, target, label=None)[source]

Represents a signal release assignment.

A release assignment ends a previously applied force.

Example

  lbl : s <= release;
--^^^                   <- optional Label
--      ^               <- Target

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SignalReleaseAssignment.

Inheritance

Inheritance diagram of SignalReleaseAssignment

Parameters:
__init__(assignmentNode, target, label=None)[source]

Initializes a signal release assignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • target (SignalSymbol) – Reference to the assignment’s destination.

  • label (str) – The label of the signal release assignment, or None if it has none.

Return type:

None

classmethod parse(assignmentNode, label=None)[source]

Translates the IIR node of the assignment statement to a SignalReleaseAssignment.

Parameters:
  • assignmentNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assignment statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SignalReleaseAssignment

Returns:

The translated assignment statement.

_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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 Target: SignalSymbol

Read-only property to access the target (_target).

Returns:

The target.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_target: Symbol

Reference to the assignment’s destination.

class pyGHDL.dom.Sequential.SequentialProcedureCall(callNode, procedureName, parameterAssociationItems, label=None)[source]

Represents a procedure call as a sequential statement.

Like every sequential statement, it can carry an optional label (Label).

Example

  lbl : log("hello");
--^^^                   <- optional Label
--      ^^^^^^^^^^^^    <- the call

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialProcedureCall.

Inheritance

Inheritance diagram of SequentialProcedureCall

Parameters:
__init__(callNode, procedureName, parameterAssociationItems, label=None)[source]

Initializes a procedure call as a sequential statement.

Parameters:
  • callNode (TypeVar(Iir, bound= c_int)) – The IIR node of the subprogram call.

  • procedureName (Symbol) – Reference to the called procedure.

  • parameterAssociationItems (Iterable[ParameterAssociationItem]) – List of all parameter associations of the call.

  • label (str) – The label of the procedure call, or None if it has none.

Return type:

None

classmethod parse(callNode, label)[source]

Translates the IIR node of the procedure call to a SequentialProcedureCall.

Parameters:
  • callNode (TypeVar(Iir, bound= c_int)) – The IIR node of the procedure call.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialProcedureCall

Returns:

The translated procedure call.

_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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

property ParameterAssociationItems: List[ParameterAssociationItem]

Read-only property to access the parameter association items (_parameterAssociationItems).

Returns:

List of parameter association items.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Procedure: Symbol

Read-only property to access the procedure (_procedure).

Returns:

The procedure.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parameterAssociationItems: List[ParameterAssociationItem]

List of all parameter associations of the call.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_procedure: Symbol

Reference to the called procedure.

class pyGHDL.dom.Sequential.SequentialAssertStatement(assertNode, condition, message=None, severity=None, label=None)[source]

Represents a sequential assertion statement.

The checked condition is available as Condition, the optional report string as Message and the optional severity as Severity.

Example

  lbl : assert sel = '0' report "bad" severity error;
--^^^                                                   <- optional Label
--             ^^^^^^^^^                                <- Condition
--                              ^^^^^                   <- optional Message
--                                             ^^^^^    <- optional Severity

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialAssertStatement.

Inheritance

Inheritance diagram of SequentialAssertStatement

Parameters:
__init__(assertNode, condition, message=None, severity=None, label=None)[source]

Initializes a sequential assertion statement.

Parameters:
  • assertNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assertion.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition that must hold; the report is issued when it is false.

  • message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported message, or None if none was given.

  • severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or None if none was given.

  • label (str) – The label of the assertion statement, or None if it has none.

Return type:

None

classmethod parse(assertNode, label)[source]

Translates the IIR node of the assertion to a SequentialAssertStatement.

Parameters:
  • assertNode (TypeVar(Iir, bound= c_int)) – The IIR node of the assertion.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialAssertStatement

Returns:

The translated assertion.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property Message: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal | None

Read-only property to access the message (_message).

Returns:

The message, or None if not set.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

Read-only property to access the severity (_severity).

Returns:

The severity, or None if not set.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_message

The reported message, or None if none was given.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

_severity

The reported severity level, or None if none was given.

class pyGHDL.dom.Sequential.SequentialReportStatement(reportNode, message, severity=None, label=None)[source]

Represents a sequential report statement.

The report string is available as Message, the optional severity as Severity.

Example

  lbl : report "message" severity note;
--^^^                                     <- optional Label
--             ^^^^^^^^^                  <- Message
--                                ^^^^    <- optional Severity

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.SequentialReportStatement.

Inheritance

Inheritance diagram of SequentialReportStatement

Parameters:
__init__(reportNode, message, severity=None, label=None)[source]

Initializes a sequential report statement.

Parameters:
  • reportNode (TypeVar(Iir, bound= c_int)) – The IIR node of the report statement.

  • message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported message, or None if none was given.

  • severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or None if none was given.

  • label (str) – The label of the report statement, or None if it has none.

Return type:

None

classmethod parse(reportNode, label)[source]

Translates the IIR node of the report statement to a SequentialReportStatement.

Parameters:
  • reportNode (TypeVar(Iir, bound= c_int)) – The IIR node of the report statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

SequentialReportStatement

Returns:

The translated report statement.

_iirNode

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

_position

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property Message: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal | None

Read-only property to access the message (_message).

Returns:

The message, or None if not set.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

Read-only property to access the severity (_severity).

Returns:

The severity, or None if not set.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label

The label of a model entity.

_message

The reported message, or None if none was given.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

_severity

The reported severity level, or None if none was given.

class pyGHDL.dom.Sequential.ReturnStatement(returnNode, returnValue=None, label=None)[source]

Represents a return statement.

The optionally returned value is available as ReturnValue; a procedure returns nothing.

Example

  lbl : return x;
--^^^               <- optional Label
--             ^    <- optional ReturnValue

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.ReturnStatement.

Inheritance

Inheritance diagram of ReturnStatement

Parameters:
__init__(returnNode, returnValue=None, label=None)[source]

Initializes a return statement.

Parameters:
  • returnNode (TypeVar(Iir, bound= c_int)) – The IIR node of the return statement.

  • returnValue (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The returned expression, or None for a procedure.

  • label (str) – The label of the return statement, or None if it has none.

Return type:

None

classmethod parse(returnNode, label)[source]

Translates the IIR node of the return statement to a ReturnStatement.

Parameters:
  • returnNode (TypeVar(Iir, bound= c_int)) – The IIR node of the return statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ReturnStatement

Returns:

The translated return statement.

_iirNode

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

_position

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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

Read-only property to access the return value (_returnValue).

Returns:

The return value, or None if not set.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_label

The label of a model entity.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

_returnValue

The returned expression, or None for a procedure.

class pyGHDL.dom.Sequential.NullStatement(waitNode, label=None)[source]

Represents a null statement.

A null statement does nothing. Like every sequential statement, it can carry an optional label (Label).

Example

  lbl : null;
--^^^           <- optional Label
--      ^^^^    <- the statement

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.NullStatement.

Inheritance

Inheritance diagram of NullStatement

Parameters:
__init__(waitNode, label=None)[source]

Initializes a null statement.

Parameters:
  • waitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the wait statement.

  • label (str) – The label of the null statement, or None if it has none.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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]

_label: str | None

The label of a model entity.

_normalizedLabel: str | None

The normalized (lower case) label of a model entity.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.NextStatement(exitNode, condition=None, label=None)[source]

Represents a next statement.

A next statement skips to the next iteration of the named loop (LoopReference), optionally only when a condition (Condition) holds.

Example

  lbl : next outer when k = 1;
--^^^                            <- optional Label
--           ^^^^^               <- optional LoopReference
--                      ^^^^^    <- optional Condition

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.NextStatement.

Inheritance

Inheritance diagram of NextStatement

Parameters:
__init__(exitNode, condition=None, label=None)[source]

Initializes a next statement.

Parameters:
  • exitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the exit statement.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which the iteration is skipped, or None if unconditional.

  • label (str) – The label of the loop this statement applies to, or None for the enclosing loop.

Return type:

None

classmethod parse(exitNode, label)[source]

Translates the IIR node of the exit statement to a NextStatement.

Parameters:
  • exitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the exit statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

NextStatement

Returns:

The translated exit statement.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property LoopReference: LoopStatement

Read-only property to access the loop reference (_loopReference).

Returns:

The loop reference.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_loopReference

Reference to the loop this statement controls.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.ExitStatement(exitNode, condition=None, label=None)[source]

Represents an exit statement.

An exit statement leaves the named loop (LoopReference), optionally only when a condition (Condition) holds.

Example

  lbl : exit outer when k = 1;
--^^^                            <- optional Label
--           ^^^^^               <- optional LoopReference
--                      ^^^^^    <- optional Condition

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.ExitStatement.

Inheritance

Inheritance diagram of ExitStatement

Parameters:
__init__(exitNode, condition=None, label=None)[source]

Initializes an exit statement.

Parameters:
  • exitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the exit statement.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition under which the loop is left, or None if unconditional.

  • label (str) – The label of the loop this statement applies to, or None for the enclosing loop.

Return type:

None

classmethod parse(exitNode, label)[source]

Translates the IIR node of the exit statement to an ExitStatement.

Parameters:
  • exitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the exit statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

ExitStatement

Returns:

The translated exit statement.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property LoopReference: LoopStatement

Read-only property to access the loop reference (_loopReference).

Returns:

The loop reference.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_loopReference

Reference to the loop this statement controls.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Sequential.WaitStatement(waitNode, sensitivityList=None, condition=None, timeout=None, label=None)[source]

Represents a wait statement.

A wait statement may name a sensitivity list (SensitivityList), a condition (Condition) and a timeout (Timeout); all three are optional.

Example

  lbl : wait until clock = '1' for 10 ns;
--^^^                                       <- optional Label
--                 ^^^^^^^^^^^              <- optional Condition
--                                 ^^^^^    <- optional Timeout

This class implements a pyGHDL.dom object derived from pyVHDLModel.Sequential.WaitStatement.

Inheritance

Inheritance diagram of WaitStatement

Parameters:
__init__(waitNode, sensitivityList=None, condition=None, timeout=None, label=None)[source]

Initializes a wait statement.

Parameters:
  • waitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the wait statement.

  • sensitivityList (Iterable[Symbol]) – List of all signal names of the on clause, or None if none was given.

  • condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition of the until clause, or None if none was given.

  • timeout (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The timeout expression of the for clause, or None if none was given.

  • label (str) – The label of the wait statement, or None if it has none.

Return type:

None

classmethod parse(waitNode, label)[source]

Translates the IIR node of the wait statement to a WaitStatement.

Parameters:
  • waitNode (TypeVar(Iir, bound= c_int)) – The IIR node of the wait statement.

  • label (str) – The statement’s label, or None if it has none.

Return type:

WaitStatement

Returns:

The translated wait statement.

_iirNode

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

_position

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

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

Read-only property to access the condition of a statement (_condition).

Returns:

The expression representing the condition of a statement.

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 Label: str | None

Read-only property to access the model entity’s label (_label).

Returns:

Label of a model entity.

property NormalizedLabel: str | None

Read-only property to access the model entity’s normalized label (_normalizedLabel).

Returns:

Normalized label of a model entity.

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 SensitivityList: List[Symbol]

Read-only property to access the sensitivity list (_sensitivityList).

Returns:

List of sensitivity list.

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

Read-only property to access the timeout (_timeout).

Returns:

The timeout.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

_condition

The condition guarding this statement.

_label

The label of a model entity.

_normalizedLabel

The normalized (lower case) label of a model entity.

_parent

Reference to a parent entity in the logical model hierarchy.

_sensitivityList

List of all signal names to wait on, or None if none was given.

_timeout

The timeout expression, or None if none was given.