pyGHDL.dom.InterfaceItem

This module implements derived interface item classes from pyVHDLModel.Interface.

Classes


Classes

class pyGHDL.dom.InterfaceItem.GenericConstantInterfaceItem(node, identifiers, mode, subtype, defaultExpression, documentation=None)[source]

Represents a constant in a generic clause.

Example

generic (W : positive := 8);
--       ^                     <- Identifiers
--           ^^^^^^^^          <- Subtype
--                       ^     <- DefaultExpression

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.GenericConstantInterfaceItem.

Inheritance

Inheritance diagram of GenericConstantInterfaceItem

Parameters:
__init__(node, identifiers, mode, subtype, defaultExpression, documentation=None)[source]

Initializes a constant in a generic clause.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The interface item’s mode.

  • subtype (Symbol) – Reference to the object’s subtype.

  • defaultExpression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The default value, or None if none was given.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(genericNode, furtherIdentifiers=None)[source]

Translates the IIR node of the generic declaration to a GenericConstantInterfaceItem.

Parameters:
  • genericNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generic declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

GenericConstantInterfaceItem

Returns:

The translated generic declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f444a42d0>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the generic constant.

Format: constant G : in positive

Return type:

str

Returns:

Formatted generic constant.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_mode

The interface item’s mode.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'constant'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.GenericTypeInterfaceItem(node, identifier, documentation=None)[source]

Represents a type in a generic clause.

A generic type introduces a type name without defining the type.

Example

generic (type T);
--            ^     <- Identifier

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.GenericTypeInterfaceItem.

Inheritance

Inheritance diagram of GenericTypeInterfaceItem

Parameters:
  • node (Iir)

  • identifier (str)

  • documentation (str)

__init__(node, identifier, documentation=None)[source]

Initializes a type in a generic clause.

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

  • identifier (str) – The generic type’s identifier.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(genericNode)[source]

Translates the IIR node of the generic declaration to a GenericTypeInterfaceItem.

Parameters:

genericNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generic declaration.

Return type:

GenericTypeInterfaceItem

Returns:

The translated generic declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifier: str

Read-only property to access the model entity’s identifier (_identifier).

Returns:

Name of a model entity.

property NormalizedIdentifier: str

Read-only property to access the model entity’s normalized identifier (_normalizedIdentifier).

Returns:

Normalized name of a model entity.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the type declaration.

Format: type myType

Return type:

str

Returns:

Formatted type declaration.

_documentation: str | None

The associated documentation of a model entity.

_identifier: str

The identifier of a model entity.

_normalizedIdentifier: str

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

_objectVertex: Vertex

The vertex representing this type in the design’s object graph.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.InterfaceItem.GenericPackageInterfaceItem(node, name, documentation=None)[source]

Represents a package in a generic clause.

A generic package parameterises a design unit with an instantiated package.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.GenericPackageInterfaceItem.

Inheritance

Inheritance diagram of GenericPackageInterfaceItem

Parameters:
__init__(node, name, documentation=None)[source]

Initializes a package in a generic clause.

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

  • name (str) – The generic package’s identifier.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(genericNode)[source]

Translates the IIR node of the generic declaration to a GenericPackageInterfaceItem.

Parameters:

genericNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generic declaration.

Return type:

GenericPackageInterfaceItem

Returns:

The translated generic declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifier: str

Read-only property to access the model entity’s identifier (_identifier).

Returns:

Name of a model entity.

property NormalizedIdentifier: str

Read-only property to access the model entity’s normalized identifier (_normalizedIdentifier).

Returns:

Normalized name of a model entity.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the interface package.

Format: package myPackage

Return type:

str

Returns:

Formatted interface package.

_documentation: str | None

The associated documentation of a model entity.

_identifier: str

The identifier of a model entity.

_normalizedIdentifier: str

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.InterfaceItem.GenericProcedureInterfaceItem(node, identifier, documentation=None)[source]

Represents a procedure in a generic clause.

Example

generic (procedure log(msg : string));
--                 ^^^                   <- Identifier
--                     ^^^^^^^^^^^^      <- ParameterItems

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.GenericProcedureInterfaceItem.

Inheritance

Inheritance diagram of GenericProcedureInterfaceItem

Parameters:
  • node (Iir)

  • identifier (str)

  • documentation (str)

__init__(node, identifier, documentation=None)[source]

Initializes a procedure in a generic clause.

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

  • identifier (str) – The generic procedure’s identifier.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(genericNode)[source]

Translates the IIR node of the generic declaration to a GenericProcedureInterfaceItem.

Parameters:

genericNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generic declaration.

Return type:

GenericProcedureInterfaceItem

Returns:

The translated generic declaration.

_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 Constants: Dict[str, Constant]

Read-only property to access the declared constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

property Files: Dict[str, File]

Read-only property to access the declared files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the declared functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

property GenericItems: List[GenericInterfaceItemMixin]

Read-only property to access the generic items (_genericItems).

Returns:

List of generic items.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifier: str

Read-only property to access the model entity’s identifier (_identifier).

Returns:

Name of a model entity.

IndexDeclaredItems()

A subprogram’s generics and parameters share the declarative region of its declarative part.

Return type:

None

property IsPure: bool

Check if the subprogram is pure (_isPure).

Returns:

True, if the subprogram is pure.

property Namespace: <pyTooling.Decorators.readonly object at 0x7f3f46055650>

Read-only property to access this region’s namespace (_namespace).

Returns:

The namespace.

property NormalizedIdentifier: str

Read-only property to access the model entity’s normalized identifier (_normalizedIdentifier).

Returns:

Normalized name of a model entity.

property ParameterItems: List[ParameterInterfaceItemMixin]

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

Returns:

List of parameter items.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Procedures: Dict[str, List[Procedure]]

Read-only property to access the declared procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property Statements: List[SequentialStatement]

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

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the declared subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the declared types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

property Variables: Dict[str, Variable]

Read-only property to access the declared variables (_variables).

Returns:

Dictionary of variables, indexed by normalized identifier.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the subprogram declaration.

Format: procedure myProcedure(a, b)

Return type:

str

Returns:

Formatted subprogram declaration.

_constants

Dictionary of all constants declared in this sequential declaration region.

_declaredItems

List of all declared items in this sequential declaration region.

_documentation

The associated documentation of a model entity.

_files

Dictionary of all files declared in this sequential declaration region.

_functions

Dictionary of all functions declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_genericItems

List of all generics, in declaration order.

_identifier

The identifier of a model entity.

_isPure

True if the subprogram was declared pure.

_namespace

The namespace of this sequential declaration region.

_normalizedIdentifier

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

_parameterItems

List of all parameters, in declaration order.

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_statements

List of all sequential statements in the subprogram’s body.

_subprogramKeyword = 'procedure'

The VHDL keyword introducing this subprogram kind.

_subtypes

Dictionary of all subtypes declared in this sequential declaration region.

_types

Dictionary of all types declared in this sequential declaration region.

_variables

Dictionary of all variables declared in this sequential declaration region.

class pyGHDL.dom.InterfaceItem.GenericFunctionInterfaceItem(node, identifier, returnType, documentation=None)[source]

Represents a function in a generic clause.

Example

generic (function cmp(a, b : integer) return boolean);
--                ^^^                                    <- Identifier
--                    ^^^^^^^^^^^^^^                     <- ParameterItems
--                                           ^^^^^^^     <- ReturnType

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.GenericFunctionInterfaceItem.

Inheritance

Inheritance diagram of GenericFunctionInterfaceItem

Parameters:
__init__(node, identifier, returnType, documentation=None)[source]

Initializes a function in a generic clause.

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

  • identifier (str) – The generic function’s identifier.

  • returnType (Symbol) – Reference to the subtype of the function’s return value.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(genericNode)[source]

Translates the IIR node of the generic declaration to a GenericFunctionInterfaceItem.

Parameters:

genericNode (TypeVar(Iir, bound= c_int)) – The IIR node of the generic declaration.

Return type:

GenericFunctionInterfaceItem

Returns:

The translated generic declaration.

_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 Constants: Dict[str, Constant]

Read-only property to access the declared constants (_constants).

Returns:

Dictionary of constants, indexed by normalized identifier.

property DeclaredItems: List

Read-only property to access the declared items (_declaredItems).

Returns:

List of declared items.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

property Files: Dict[str, File]

Read-only property to access the declared files (_files).

Returns:

Dictionary of files, indexed by normalized identifier.

property Functions: Dict[str, List[Function]]

Read-only property to access the declared functions (_functions).

Returns:

Dictionary of functions, indexed by normalized identifier; each entry is a list of overloads.

property GenericItems: List[GenericInterfaceItemMixin]

Read-only property to access the generic items (_genericItems).

Returns:

List of generic items.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifier: str

Read-only property to access the model entity’s identifier (_identifier).

Returns:

Name of a model entity.

IndexDeclaredItems()

A subprogram’s generics and parameters share the declarative region of its declarative part.

Return type:

None

property IsPure: bool

Check if the subprogram is pure (_isPure).

Returns:

True, if the subprogram is pure.

property Namespace: <pyTooling.Decorators.readonly object at 0x7f3f46055650>

Read-only property to access this region’s namespace (_namespace).

Returns:

The namespace.

property NormalizedIdentifier: str

Read-only property to access the model entity’s normalized identifier (_normalizedIdentifier).

Returns:

Normalized name of a model entity.

property ParameterItems: List[ParameterInterfaceItemMixin]

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

Returns:

List of parameter items.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Procedures: Dict[str, List[Procedure]]

Read-only property to access the declared procedures (_procedures).

Returns:

Dictionary of procedures, indexed by normalized identifier; each entry is a list of overloads.

property ReturnType: SubtypeSymbol

Read-only property to access the return type (_returnType).

Returns:

The return type.

property Statements: List[SequentialStatement]

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

Returns:

List of statements.

property Subtypes: Dict[str, Subtype]

Read-only property to access the declared subtypes (_subtypes).

Returns:

Dictionary of subtypes, indexed by normalized identifier.

property Types: Dict[str, FullType]

Read-only property to access the declared types (_types).

Returns:

Dictionary of types, indexed by normalized identifier.

property Variables: Dict[str, Variable]

Read-only property to access the declared variables (_variables).

Returns:

Dictionary of variables, indexed by normalized identifier.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

_IndexGenericItems()

Add this region’s generics to its namespace.

Return type:

None

_IndexOtherDeclaredItem(item)

Hook for declared items the region doesn’t handle itself. Derived classes may override it.

Return type:

None

_IndexParameterItems()

Add this region’s parameters to its namespace.

Return type:

None

_IndexPortItems()

Add this region’s ports to its namespace.

Return type:

None

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the subprogram declaration.

Format: procedure myProcedure(a, b)

Return type:

str

Returns:

Formatted subprogram declaration.

_constants

Dictionary of all constants declared in this sequential declaration region.

_declaredItems

List of all declared items in this sequential declaration region.

_documentation

The associated documentation of a model entity.

_files

Dictionary of all files declared in this sequential declaration region.

_functions

Dictionary of all functions declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_genericItems

List of all generics, in declaration order.

_identifier

The identifier of a model entity.

_isPure

True if the subprogram was declared pure.

_namespace

The namespace of this sequential declaration region.

_normalizedIdentifier

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

_parameterItems

List of all parameters, in declaration order.

_parent

Reference to a parent entity in the logical model hierarchy.

_procedures

Dictionary of all procedures declared in this sequential declaration region, indexed by name; each entry is a list of overloads.

_returnType

Reference to the subtype of the function’s return value.

_statements

List of all sequential statements in the subprogram’s body.

_subprogramKeyword = 'function'

The VHDL keyword introducing this subprogram kind.

_subtypes

Dictionary of all subtypes declared in this sequential declaration region.

_types

Dictionary of all types declared in this sequential declaration region.

_variables

Dictionary of all variables declared in this sequential declaration region.

class pyGHDL.dom.InterfaceItem.PortSimpleSignalInterfaceItem(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Represents a port declared with a simple mode.

The port’s mode is available as Mode, its subtype as Subtype.

Example

port (p : in bit);
--    ^              <- Identifiers
--        ^^         <- Mode
--           ^^^     <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.PortSimpleSignalInterfaceItem.

Inheritance

Inheritance diagram of PortSimpleSignalInterfaceItem

Parameters:
__init__(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Initializes a port declared with a simple mode.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The interface item’s mode.

  • subtype (Symbol) – Reference to the object’s subtype.

  • defaultExpression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The default value, or None if none was given.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(portNode, furtherIdentifiers=None)[source]

Translates the IIR node of the port declaration to a PortSimpleSignalInterfaceItem.

Parameters:
  • portNode (TypeVar(Iir, bound= c_int)) – The IIR node of the port declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

PortSimpleSignalInterfaceItem

Returns:

The translated port declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f444a42d0>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the port.

Format: signal p : in bit

Return type:

str

Returns:

Formatted port.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_mode

The interface item’s mode.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'signal'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.PortViewSignalInterfaceItem(node, identifiers, modeViewIndication, documentation=None)[source]

Example

port (p : view MyView);

Note

Get_Subtype_Indication on an Interface_View_Declaration node is only populated after semantic analysis has resolved the referenced mode view; since translation here is parse-only, Subtype stays None - the type is only implied by the referenced mode view.

Inheritance

Inheritance diagram of PortViewSignalInterfaceItem

Parameters:
__init__(node, identifiers, modeViewIndication, documentation=None)[source]

Initializes a port declared with a mode view (VHDL-2019).

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

  • identifiers (List[str]) – A list of identifiers.

  • modeViewIndication (ModeViewSymbol) – Reference to the mode view applied to this port.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(portNode, furtherIdentifiers=None)[source]

Translates the IIR node of the port declaration to a PortViewSignalInterfaceItem.

Parameters:
  • portNode (TypeVar(Iir, bound= c_int)) – The IIR node of the port declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

PortViewSignalInterfaceItem

Returns:

The translated port declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property ModeViewIndication: ModeViewSymbol

Read-only property to access the mode view indication (_subtype).

Returns:

The mode view indication.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the port declared with a mode view.

Format: signal p : view myView

Return type:

str

Returns:

Formatted port declared with a mode view.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'signal'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.ParameterConstantInterfaceItem(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Represents a constant parameter of a subprogram.

Example

function fun(constant cst : in integer) return integer;
--                    ^^^                                 <- Identifiers
--                          ^^                            <- Mode
--                             ^^^^^^^                    <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.ParameterConstantInterfaceItem.

Inheritance

Inheritance diagram of ParameterConstantInterfaceItem

Parameters:
__init__(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Initializes a constant parameter of a subprogram.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The interface item’s mode.

  • subtype (Symbol) – Reference to the object’s subtype.

  • defaultExpression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The default value, or None if none was given.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(parameterNode, furtherIdentifiers=None)[source]

Translates the IIR node of the parameter declaration to a ParameterConstantInterfaceItem.

Parameters:
  • parameterNode (TypeVar(Iir, bound= c_int)) – The IIR node of the parameter declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

ParameterConstantInterfaceItem

Returns:

The translated parameter declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f444a42d0>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the constant parameter.

Format: constant a : in integer

Return type:

str

Returns:

Formatted constant parameter.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_mode

The interface item’s mode.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'constant'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.ParameterVariableInterfaceItem(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Represents a variable parameter of a subprogram.

Example

procedure proc(variable var : out bit);
--                      ^^^               <- Identifiers
--                            ^^^         <- Mode
--                                ^^^     <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.ParameterVariableInterfaceItem.

Inheritance

Inheritance diagram of ParameterVariableInterfaceItem

Parameters:
__init__(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Initializes a variable parameter of a subprogram.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The interface item’s mode.

  • subtype (Symbol) – Reference to the object’s subtype.

  • defaultExpression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The default value, or None if none was given.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(parameterNode, furtherIdentifiers=None)[source]

Translates the IIR node of the parameter declaration to a ParameterVariableInterfaceItem.

Parameters:
  • parameterNode (TypeVar(Iir, bound= c_int)) – The IIR node of the parameter declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

ParameterVariableInterfaceItem

Returns:

The translated parameter declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f444a42d0>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the variable parameter.

Format: variable v : inout integer

Return type:

str

Returns:

Formatted variable parameter.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_mode

The interface item’s mode.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'variable'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.ParameterSimpleSignalInterfaceItem(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Represents a signal parameter declared with a simple mode.

The parameter’s mode is available as Mode, its subtype as Subtype.

Example

procedure proc(signal sig : in bit);
--                    ^^^              <- Identifiers
--                          ^^         <- Mode
--                             ^^^     <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.ParameterSimpleSignalInterfaceItem.

Inheritance

Inheritance diagram of ParameterSimpleSignalInterfaceItem

Parameters:
__init__(node, identifiers, mode, subtype, defaultExpression=None, documentation=None)[source]

Initializes a signal parameter declared with a simple mode.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The interface item’s mode.

  • subtype (Symbol) – Reference to the object’s subtype.

  • defaultExpression (BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal) – The default value, or None if none was given.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(parameterNode, furtherIdentifiers=None)[source]

Translates the IIR node of the parameter declaration to a ParameterSimpleSignalInterfaceItem.

Parameters:
  • parameterNode (TypeVar(Iir, bound= c_int)) – The IIR node of the parameter declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

ParameterSimpleSignalInterfaceItem

Returns:

The translated parameter declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f444a42d0>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the signal parameter.

Format: signal s : in bit

Return type:

str

Returns:

Formatted signal parameter.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_mode

The interface item’s mode.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'signal'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.ParameterViewSignalInterfaceItem(node, identifiers, modeViewIndication, documentation=None)[source]

Example

procedure proc(signal s : view MyView);

Note

See PortViewSignalInterfaceItem for why Subtype stays None here.

Inheritance

Inheritance diagram of ParameterViewSignalInterfaceItem

Parameters:
__init__(node, identifiers, modeViewIndication, documentation=None)[source]

Initializes a signal parameter declared with a mode view (VHDL-2019).

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

  • identifiers (List[str]) – A list of identifiers.

  • modeViewIndication (ModeViewSymbol) – Reference to the mode view applied to this parameter.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(parameterNode, furtherIdentifiers=None)[source]

Translates the IIR node of the parameter declaration to a ParameterViewSignalInterfaceItem.

Parameters:
  • parameterNode (TypeVar(Iir, bound= c_int)) – The IIR node of the parameter declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

ParameterViewSignalInterfaceItem

Returns:

The translated parameter declaration.

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

Read-only property to access the default expression (_defaultExpression).

Returns:

The default expression, or None if not set.

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property ModeViewIndication: ModeViewSymbol

Read-only property to access the mode view indication (_subtype).

Returns:

The mode view indication.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the signal parameter declared with a mode view.

Format: signal s : view myView

Return type:

str

Returns:

Formatted signal parameter declared with a mode view.

_defaultExpression

The default value, or None if none was given.

_documentation

The associated documentation of a model entity.

_identifiers

A list of identifiers.

_normalizedIdentifiers

A list of normalized (lower case) identifiers.

_objectKeyword = 'signal'

The VHDL keyword introducing this object class.

_objectVertex

The vertex representing this object in the design’s object graph.

_parent

Reference to a parent entity in the logical model hierarchy.

_subtype

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.ParameterFileInterfaceItem(node, identifiers, subtype, documentation=None)[source]

Represents a file parameter of a subprogram.

Example

procedure proc(file fil : text_file);
--                  ^^^                 <- Identifiers
--                        ^^^^^^^^^     <- Subtype

This class implements a pyGHDL.dom object derived from pyVHDLModel.Interface.ParameterFileInterfaceItem.

Inheritance

Inheritance diagram of ParameterFileInterfaceItem

Parameters:
__init__(node, identifiers, subtype, documentation=None)[source]

Initializes a file parameter of a subprogram.

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

  • identifiers (List[str]) – A list of identifiers.

  • subtype (Symbol) – Reference to the object’s subtype.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(parameterNode, furtherIdentifiers=None)[source]

Translates the IIR node of the parameter declaration to a ParameterFileInterfaceItem.

Parameters:
  • parameterNode (TypeVar(Iir, bound= c_int)) – The IIR node of the parameter declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

ParameterFileInterfaceItem

Returns:

The translated parameter declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property ObjectVertex: Vertex | None

Read-only property to access the corresponding object vertex (_objectVertex).

The object vertex references this Object by its value field.

Returns:

The corresponding object vertex.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: Symbol

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

Returns:

The subtype.

_FormatInterfaceItem(mode=None, isModeView=False)

Format this interface item as a single-line declaration.

Interface items are objects, so they render like one (signal p : bit), but an object’s own rendering cannot show the interface mode - a mode is not part of an object declaration. This adds it, for the derived class’s __str__() to return.

Parameters:
  • mode (Mode | None) – This item’s mode, or None when it declares none.

  • isModeView (bool) – True if the subtype position holds a mode view (VHDL-2019), not a subtype.

Return type:

str

Returns:

Formatted interface item.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the file parameter.

Format: file f : text

Return type:

str

Returns:

Formatted file parameter.

_documentation: str | None

The associated documentation of a model entity.

_identifiers: Tuple[str]

A list of identifiers.

_normalizedIdentifiers: Tuple[str]

A list of normalized (lower case) identifiers.

_objectKeyword: ClassVar[str] = 'file'

The VHDL keyword introducing this object class.

_objectVertex: Vertex | None

The vertex representing this object in the design’s object graph.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_subtype: Symbol

Reference to the object’s subtype.

class pyGHDL.dom.InterfaceItem.SimpleModeViewElement(node, identifiers, mode, documentation=None)[source]

Example

view MyView of RecordType is
  a, b : out;
end view;

Inheritance

Inheritance diagram of SimpleModeViewElement

Parameters:
__init__(node, identifiers, mode, documentation=None)[source]

Initializes a simple mode view element.

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

  • identifiers (List[str]) – A list of identifiers.

  • mode (Mode) – The element’s mode.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(elementNode, furtherIdentifiers=None)[source]

Translates the IIR node of the element declaration to a SimpleModeViewElement.

Parameters:
  • elementNode (TypeVar(Iir, bound= c_int)) – The IIR node of the element declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

SimpleModeViewElement

Returns:

The translated element declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property Mode: <pyTooling.Decorators.readonly object at 0x7f3f460f7950>

Read-only property to access the mode (_mode).

Returns:

The mode.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the mode view element as its identifiers.

Format: a, b

Return type:

str

Returns:

The element’s identifiers, comma-separated.

_documentation: str | None

The associated documentation of a model entity.

_identifiers: Tuple[str]

A list of identifiers.

_mode: <pyTooling.Decorators.readonly object at 0x7f3f460f7950>

The element’s mode.

_normalizedIdentifiers: Tuple[str]

A list of normalized (lower case) identifiers.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.InterfaceItem.CompositeModeViewElement(node, identifiers, modeViewName, documentation=None)[source]

Example

view OuterView of OuterRecord is
  b : view InnerView;
end view;

Inheritance

Inheritance diagram of CompositeModeViewElement

Parameters:
__init__(node, identifiers, modeViewName, documentation=None)[source]

Initializes a composite mode view element.

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

  • identifiers (List[str]) – A list of identifiers.

  • modeViewName (ModeViewSymbol) – Reference to the mode view applied to this element.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(elementNode, furtherIdentifiers=None)[source]

Translates the IIR node of the element declaration to a CompositeModeViewElement.

Parameters:
  • elementNode (TypeVar(Iir, bound= c_int)) – The IIR node of the element declaration.

  • furtherIdentifiers (Iterable[str]) – The remaining identifiers, when one declaration names several.

Return type:

CompositeModeViewElement

Returns:

The translated element declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifiers: Tuple[str]

Read-only property to access the model entity’s identifiers (_identifiers).

Returns:

Tuple of identifiers.

property ModeViewName: ModeViewSymbol

Read-only property to access the mode view name (_modeViewName).

Returns:

The mode view name.

property NormalizedIdentifiers: Tuple[str]

Read-only property to access the model entity’s normalized identifiers (_normalizedIdentifiers).

Returns:

Tuple of normalized identifiers.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the mode view element as its identifiers.

Format: a, b

Return type:

str

Returns:

The element’s identifiers, comma-separated.

_documentation: str | None

The associated documentation of a model entity.

_identifiers: Tuple[str]

A list of identifiers.

_modeViewName: ModeViewSymbol

Reference to the mode view applied to this element.

_normalizedIdentifiers: Tuple[str]

A list of normalized (lower case) identifiers.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.InterfaceItem.ModeViewDeclaration(node, identifier, subtype, elements=None, documentation=None)[source]

Example

view MyView of RecordType is
  a : out;
  b : in;
end view;

Inheritance

Inheritance diagram of ModeViewDeclaration

Parameters:
__init__(node, identifier, subtype, elements=None, documentation=None)[source]

Initializes a mode view declaration (VHDL-2019).

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

  • identifier (str) – The mode view’s identifier.

  • subtype (Symbol) – Reference to the subtype this mode view applies to.

  • elements (List) – List of all mode view elements, in declaration order.

  • documentation (str) – The documentation comment associated with this declaration.

Return type:

None

classmethod parse(modeViewNode)[source]

Translates the IIR node of the mode view declaration to a ModeViewDeclaration.

Parameters:

modeViewNode (TypeVar(Iir, bound= c_int)) – The IIR node of the mode view declaration.

Return type:

ModeViewDeclaration

Returns:

The translated mode view declaration.

_iirNode: Iir

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

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

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

property Documentation: str | None

Read-only property to access the model entity’s documentation (_documentation).

Returns:

Associated documentation of a model entity.

property Elements: List[ModeViewElement]

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

Returns:

List of elements.

GetAncestor(type)

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

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

Parameters:

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

Return type:

ModelEntity

Returns:

The closest ancestor of the requested type.

Raises:

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

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

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

Return type:

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

Returns:

Dictionary of methods and the matching attributes attached to them.

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

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

property Identifier: str

Read-only property to access the model entity’s identifier (_identifier).

Returns:

Name of a model entity.

property NormalizedIdentifier: str

Read-only property to access the model entity’s normalized identifier (_normalizedIdentifier).

Returns:

Normalized name of a model entity.

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Subtype: SubtypeSymbol

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

Returns:

The subtype.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the mode view declaration.

Format: view myView of myRecord: a, b

Return type:

str

Returns:

Formatted mode view declaration.

_documentation: str | None

The associated documentation of a model entity.

_elements: List[ModeViewElement]

List of all mode view elements, in declaration order.

_identifier: str

The identifier of a model entity.

_normalizedIdentifier: str

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

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_subtype: SubtypeSymbol

Reference to the subtype this mode view applies to.