pyGHDL.dom.Sequential
This module implements derived sequential statement classes from pyVHDLModel.Sequential.
Classes
IfBranch: Represents theifbranch of an if statement.ElsifBranch: Represents anelsifbranch of an if statement.ElseBranch: Represents theelsebranch of an if statement.IfStatement: Represents an if statement.IndexedChoice: Represents a case choice given by a single value.RangedChoice: Represents a case choice given by a range.Case: Represents one alternative of a case statement, selected by its choices.OthersCase: Represents theothersalternative of a case statement.CaseStatement: Represents a case statement.ForLoopStatement: Represents a for-loop statement.WhileLoopStatement: Represents a while-loop statement.SequentialSimpleSignalAssignment: Represents a simple sequential signal assignment.ConditionalExpression: Represents one branch of a conditional variable assignment.SelectedExpression: Represents one alternative of a selected variable assignment.OthersSelectedExpression: Represents theothersalternative of a selected variable assignment.SequentialVariableAssignment: Represents a simple sequential variable assignment.SequentialConditionalVariableAssignment: Represents a conditional sequential variable assignment.SequentialConditionalSignalAssignment: Represents a conditional sequential signal assignment.SequentialSelectedVariableAssignment: Represents a selected sequential variable assignment.SequentialSelectedSignalAssignment: Represents a selected sequential signal assignment.SignalForceAssignment: Represents a signal force assignment.SignalReleaseAssignment: Represents a signal release assignment.SequentialProcedureCall: Represents a procedure call as a sequential statement.SequentialAssertStatement: Represents a sequential assertion statement.SequentialReportStatement: Represents a sequential report statement.ReturnStatement: Represents a return statement.NullStatement: Represents a null statement.NextStatement: Represents a next statement.ExitStatement: Represents an exit statement.WaitStatement: Represents a wait statement.
Classes
- class pyGHDL.dom.Sequential.IfBranch(branchNode, condition, statements=None)[source]
Represents the
ifbranch of an if statement.The branch’s condition is available as
Condition, its body asStatements.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.domobject derived frompyVHDLModel.Sequential.IfBranch.Inheritance
- Parameters:
branchNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
statements (Iterable[SequentialStatement])
- __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
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Statements: List[SequentialStatement]
Read-only property to access the list of sequential statements (
_statements).- Returns:
A list of sequential statements.
- _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
elsifbranch of an if statement.The branch’s condition is available as
Condition, its body asStatements. 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.domobject derived frompyVHDLModel.Sequential.ElsifBranch.Inheritance
- Parameters:
branchNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
statements (Iterable[SequentialStatement])
- __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.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Statements: List[SequentialStatement]
Read-only property to access the list of sequential statements (
_statements).- Returns:
A list of sequential statements.
- _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
elsebranch 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.domobject derived frompyVHDLModel.Sequential.ElseBranch.Inheritance
- Parameters:
branchNode (Iir)
statements (Iterable[SequentialStatement])
- __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:
- Return type:
- Returns:
The translated branch.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Statements: List[SequentialStatement]
Read-only property to access the list of sequential statements (
_statements).- Returns:
A list of sequential statements.
- _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
ifbranch (IfBranch), any number ofelsifbranches (ElsIfBranches) and an optionalelsebranch (ElseBranch).Example
Only an
ifbranch:lbl : if sel = '0' then --^^^ <- optional Label s <= '0'; end if;
With
elsifandelsebranches:lbl : if sel = '0' then --^^^ <- optional Label -- ^^^^^^^^^^^^^^^^^ <- IfBranch s <= '0'; elsif sel = '1' then --^^^^^^^^^^^^^^^^^^^^ <- ElsIfBranches[0] s <= '1'; else --^^^^ <- ElseBranch s <= '0'; end if;
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.IfStatement.Inheritance
- Parameters:
ifNode (Iir)
ifBranch (IfBranch)
elsifBranches (Iterable[ElsifBranch])
elseBranch (ElseBranch)
label (str)
- __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, orNoneif none was given.label (
str) – The label of the if statement, orNoneif it has none.
- Return type:
None
- classmethod parse(ifNode, label)[source]
Translates the IIR node of the if statement to an
IfStatement.- Parameters:
- Return type:
- Returns:
The translated if statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _elseBranch: <pyTooling.Decorators.readonly object at 0x7f3f460f4f50> | None
The optional
elsebranch, orNoneif none was given.
- _elsifBranches: List[ElsifBranch]
List of all
elsifbranches, in the order they were written.
- _ifBranch: <pyTooling.Decorators.readonly object at 0x7f3f460f4e50>
The mandatory
ifbranch.
- _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.domobject derived frompyVHDLModel.Sequential.IndexedChoice.Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()[source]
Formats the indexed case choice.
Format:
0- Return type:
- 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.domobject derived frompyVHDLModel.Sequential.RangedChoice.Inheritance
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- __str__()[source]
Formats the ranged case choice.
Format:
0 to 3- Return type:
- Returns:
Formatted ranged case choice.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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.domobject derived frompyVHDLModel.Sequential.Case.Inheritance
- Parameters:
node (Iir)
choices (Iterable[SequentialChoice])
statements (Iterable[SequentialStatement])
- __init__(node, choices, statements=None)[source]
Initializes a case.
- Parameters:
node (
TypeVar(Iir, bound=c_int)) – The IIR node this object was translated from.choices (
Iterable[SequentialChoice]) – List of all choices selecting this alternative.statements (
Iterable[SequentialStatement]) – List of all sequential statements in this construct.
- Return type:
None
- classmethod parse(caseNode, choices, label)[source]
Translates the IIR node of the alternative to a
Case.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Statements: List[SequentialStatement]
Read-only property to access the list of sequential statements (
_statements).- Returns:
A list of sequential statements.
- __str__()[source]
Formats the case alternative.
Format:
when 0 | 1 =>- Return type:
- 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
othersalternative of a case statement.It covers every choice not named explicitly.
Example
when others => null; -- ^^^^^^ <- the choice
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.OthersCase.Inheritance
- Parameters:
caseNode (Iir)
statements (Iterable[SequentialStatement])
- __init__(caseNode, statements=None)[source]
Initializes an others alternative.
- Parameters:
caseNode (
TypeVar(Iir, bound=c_int)) – The IIR node of the case statement.statements (
Iterable[SequentialStatement]) – List of all sequential statements in this construct.
- Return type:
None
- classmethod parse(caseNode, label=None)[source]
Translates the IIR node of the alternative to an
OthersCase.- Parameters:
- Return type:
- Returns:
The translated alternative.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Statements: List[SequentialStatement]
Read-only property to access the list of sequential statements (
_statements).- Returns:
A list of sequential statements.
- __str__()[source]
Formats the
otherscase alternative.Format:
when others =>- Return type:
- Returns:
Formatted
otherscase 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 asCases.Example
lbl : case sel is --^^^ <- optional Label -- ^^^ <- SelectExpression when '0' => s <= '1'; -- ^^^^^^^^^^^^^^^^^^^^^^^^ <- Cases[0] when others => null; -- ^^^^^^^^^^^^^^^^^^^^ <- Cases[1] end case;
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.CaseStatement.Inheritance
- Parameters:
caseNode (Iir)
label (str)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
cases (Iterable[SequentialCase])
- __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, orNoneif 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:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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 asRangeand the loop body asStatements.Example
lbl : for k in 0 to 3 loop --^^^ <- optional Label -- ^ <- LoopIndex -- ^^^^^^ <- Range null; -- ^^^^^ <- Statements end loop;
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.ForLoopStatement.Inheritance
- 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, orNoneif it has none.
- Return type:
None
- classmethod parse(loopNode, label)[source]
Translates the IIR node of the loop statement to a
ForLoopStatement.- Parameters:
- Return type:
- Returns:
The translated loop statement.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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 asStatements.Example
lbl : while i < 4 loop --^^^ <- optional Label -- ^^^^^ <- Condition null; -- ^^^^^ <- Statements end loop;
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.WhileLoopStatement.Inheritance
- Parameters:
loopNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
statements (Iterable[SequentialStatement])
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(loopNode, label)[source]
Translates the IIR node of the loop statement to a
WhileLoopStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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 asWaveform.Example
lbl : s <= '1'; --^^^ <- optional Label -- ^ <- Target -- ^^^ <- Waveform
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialSimpleSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (SignalSymbol)
waveform (Iterable[WaveformElement])
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialSimpleSignalAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _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 nowhen, so its condition isNone.Example
v := '1' when cond else '0'; -- ^^^^^^^^^^^^^ <- this branch: Expression='1', Condition=cond -- ^^^ <- final branch (no ``when``): Expression='0', Condition=None
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Common.ConditionalExpression.Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __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.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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'
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Common.SelectedExpression.Inheritance
- Parameters:
node (Iir)
choices (Iterable)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- __init__(node, choices, expression)[source]
Initializes a selected expression.
- Parameters:
- Return type:
None
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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
othersalternative 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.domobject derived frompyVHDLModel.Common.OthersSelectedExpression.Inheritance
- Parameters:
node (Iir)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property Parent: ModelEntity
Property to access the model entity’s parent element reference in a logical hierarchy (
_parent).- Returns:
Reference to the parent entity.
- property Position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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 asExpression.Example
lbl : v := '1'; --^^^ <- optional Label -- ^ <- Target -- ^^^ <- Expression
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialVariableAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (VariableSymbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialVariableAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The assigned expression.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 ofConditionalExpression. 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]
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialConditionalVariableAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (VariableSymbol)
conditionalExpressions (Iterable[ConditionalExpression])
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialConditionalVariableAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _conditionalExpressions: List[ConditionalExpression]
List of all alternatives, in the order they were written.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 ofConditionalWaveform. 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.domobject derived frompyVHDLModel.Sequential.SequentialConditionalSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (SignalSymbol)
conditionalWaveforms (Iterable)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialConditionalSignalAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _conditionalWaveforms: List[ConditionalWaveform]
All alternatives, in order.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 asSelectedExpressions, a list ofSelectedExpression. 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]
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialSelectedVariableAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (VariableSymbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
selectedExpressions (Iterable)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialSelectedVariableAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression held by this construct.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _selectedExpressions: List[SelectedExpression | OthersSelectedExpression]
All alternatives, in order.
- 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 asSelectedWaveforms, a list ofSelectedWaveform. 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]
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialSelectedSignalAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (SignalSymbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
selectedWaveforms (Iterable)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SequentialSelectedSignalAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _expression: BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal
The expression held by this construct.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _selectedWaveforms: List[SelectedWaveform | OthersSelectedWaveform]
All alternatives, in order.
- 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.domobject derived frompyVHDLModel.Sequential.SignalForceAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (SignalSymbol)
expression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SignalForceAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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.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.domobject derived frompyVHDLModel.Sequential.SignalReleaseAssignment.Inheritance
- Parameters:
assignmentNode (Iir)
target (SignalSymbol)
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(assignmentNode, label=None)[source]
Translates the IIR node of the assignment statement to a
SignalReleaseAssignment.- Parameters:
- Return type:
- Returns:
The translated assignment statement.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialProcedureCall.Inheritance
- Parameters:
callNode (Iir)
procedureName (Symbol)
parameterAssociationItems (Iterable[ParameterAssociationItem])
label (str)
- __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, orNoneif it has none.
- Return type:
None
- classmethod parse(callNode, label)[source]
Translates the IIR node of the procedure call to a
SequentialProcedureCall.- Parameters:
- Return type:
- Returns:
The translated procedure call.
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _parameterAssociationItems: List[ParameterAssociationItem]
List of all parameter associations of the call.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- 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 asMessageand the optional severity asSeverity.Example
lbl : assert sel = '0' report "bad" severity error; --^^^ <- optional Label -- ^^^^^^^^^ <- Condition -- ^^^^^ <- optional Message -- ^^^^^ <- optional Severity
See also
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialAssertStatement.Inheritance
- Parameters:
assertNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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
Noneif none was given.severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or
Noneif none was given.label (
str) – The label of the assertion statement, orNoneif it has none.
- Return type:
None
- classmethod parse(assertNode, label)[source]
Translates the IIR node of the assertion to a
SequentialAssertStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
Noneif 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
_positionis 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
Noneif not set.
- _condition
The condition guarding this statement.
- _label
The label of a model entity.
- _message
The reported message, or
Noneif 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
Noneif 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 asSeverity.Example
lbl : report "message" severity note; --^^^ <- optional Label -- ^^^^^^^^^ <- Message -- ^^^^ <- optional Severity
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Sequential.SequentialReportStatement.Inheritance
- Parameters:
reportNode (Iir)
message (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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
Noneif none was given.severity (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The reported severity level, or
Noneif none was given.label (
str) – The label of the report statement, orNoneif it has none.
- Return type:
None
- classmethod parse(reportNode, label)[source]
Translates the IIR node of the report statement to a
SequentialReportStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
Noneif 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
_positionis 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
Noneif not set.
- _label
The label of a model entity.
- _message
The reported message, or
Noneif 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
Noneif 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.domobject derived frompyVHDLModel.Sequential.ReturnStatement.Inheritance
- Parameters:
returnNode (Iir)
returnValue (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __init__(returnNode, returnValue=None, label=None)[source]
Initializes a return statement.
- Parameters:
- Return type:
None
- classmethod parse(returnNode, label)[source]
Translates the IIR node of the return statement to a
ReturnStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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
Noneif not set.
- _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
Nonefor 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.domobject derived frompyVHDLModel.Sequential.NullStatement.Inheritance
- _position: <pyTooling.Decorators.readonly object at 0x7f3f462456d0>
The IIR node’s position in the source file, resolved on first access and then cached.
- GetAncestor(type)
Return the closest ancestor of the given
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.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.domobject derived frompyVHDLModel.Sequential.NextStatement.Inheritance
- Parameters:
exitNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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
Noneif unconditional.label (
str) – The label of the loop this statement applies to, orNonefor the enclosing loop.
- Return type:
None
- classmethod parse(exitNode, label)[source]
Translates the IIR node of the exit statement to a
NextStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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.domobject derived frompyVHDLModel.Sequential.ExitStatement.Inheritance
- Parameters:
exitNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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
Noneif unconditional.label (
str) – The label of the loop this statement applies to, orNonefor the enclosing loop.
- Return type:
None
- classmethod parse(exitNode, label)[source]
Translates the IIR node of the exit statement to an
ExitStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- _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.domobject derived frompyVHDLModel.Sequential.WaitStatement.Inheritance
- Parameters:
waitNode (Iir)
condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
timeout (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal)
label (str)
- __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, orNoneif none was given.condition (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The condition of the until clause, or
Noneif none was given.timeout (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The timeout expression of the for clause, or
Noneif none was given.label (
str) – The label of the wait statement, orNoneif it has none.
- Return type:
None
- classmethod parse(waitNode, label)[source]
Translates the IIR node of the wait statement to a
WaitStatement.- Parameters:
- Return type:
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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
_positionis 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.
- _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
Noneif none was given.
- _timeout
The timeout expression, or
Noneif none was given.