pyGHDL.dom.Name

This module implements derived name classes from pyVHDLModel.Name.

Classes

  • SimpleName: Represents a single name (identifier) to a language entity.

  • ParenthesisName: Represents a parenthesis (index access or function call) following a name.

  • IndexedName: Represents a name indexing an array by one or more values.

  • SlicedName: Represents a slice following a name.

  • SelectedName: Represents a name following a name in dot-notation.

  • AttributeName: Represents a name following a name in tick-notation.

  • AllName: Represents a keyword all following a name in dot-notation.

  • OpenName: Represents the keyword open used as a special name.


Classes

class pyGHDL.dom.Name.SimpleName(node, identifier)[source]

Represents a single name (identifier) to a language entity.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.SimpleName.

Example

ieee

Inheritance

Inheritance diagram of SimpleName

Parameters:
__init__(node, identifier)[source]

Initializes a name.

Parameters:
  • identifier (str) – The name’s identifier.

  • prefix – Reference to the name’s prefix, or None for a simple name.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()

Formats the name.

Format: sig

Return type:

str

Returns:

Formatted name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.ParenthesisName(node, prefix, associations)[source]

Represents a parenthesis (index access or function call) following a name.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.ParenthesisName.

Example

arr(0)
-- ^^^

Inheritance

Inheritance diagram of ParenthesisName

Parameters:
__init__(node, prefix, associations)[source]

Initializes a name followed by a parenthesized association list.

Parameters:
  • prefix (Name) – Reference to the name’s prefix, or None for a simple name.

  • associations (List) – List of all associations in the parenthesis.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

property Associations: List

Read-only property to access the associations (_associations).

Returns:

List of associations.

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()[source]

Formats the parenthesis name.

Format: func(a, b)

Return type:

str

Returns:

Formatted parenthesis name.

_associations: List

List of all associations in the parenthesis.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.IndexedName(node, identifier)[source]

Inheritance

Inheritance diagram of IndexedName

Parameters:
__init__(node, identifier)[source]

Initializes a name indexing an array by one or more values.

Parameters:
  • prefix – Reference to the name’s prefix, or None for a simple name.

  • indices – List of all index expressions, one per dimension.

  • parent – The parent model entity of this entity.

  • node (Iir)

  • identifier (str)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property Indices: List[BaseExpression | QualifiedExpression | FunctionCall | TypeConversion | Literal]

Read-only property to access the indices (_indices).

Returns:

List of indices.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()[source]

Formats the indexed name.

Format: arr(0)

Return type:

str

Returns:

Formatted indexed name.

_identifier

The name’s identifier.

_indices

List of all index expressions, one per dimension.

_normalizedIdentifier

The normalized (lower case) identifier.

_parent

Reference to a parent entity in the logical model hierarchy.

_prefix

Reference to the name’s prefix, or None for a simple name.

_root

Reference to the root of the name chain.

class pyGHDL.dom.Name.SlicedName(node, identifier)[source]

Represents a slice following a name.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.SlicedName.

Example

arr(7 downto 0)
-- ^^^^^^^^^^^^

Inheritance

Inheritance diagram of SlicedName

Parameters:
__init__(node, identifier)[source]

Initializes a name.

Parameters:
  • identifier (str) – The name’s identifier.

  • prefix – Reference to the name’s prefix, or None for a simple name.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()

Formats the name.

Format: sig

Return type:

str

Returns:

Formatted name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.SelectedName(node, identifier, prefix)[source]

Represents a name following a name in dot-notation.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.SelectedName.

Example

rec.elem
-- ^^^^^

Inheritance

Inheritance diagram of SelectedName

Parameters:
__init__(node, identifier, prefix)[source]

Initializes a selected name.

Parameters:
  • identifier (str) – The name’s identifier.

  • prefix (Name) – Reference to the name’s prefix, or None for a simple name.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()[source]

Formats the selected name.

Format: rec.elem

Return type:

str

Returns:

Formatted selected name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.AttributeName(node, identifier, prefix)[source]

Represents a name following a name in tick-notation.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.AttributeName.

Example

arr'length
-- ^^^^^^^

Inheritance

Inheritance diagram of AttributeName

Parameters:
__init__(node, identifier, prefix)[source]

Initializes a name selecting an attribute of its prefix.

Parameters:
  • identifier (str) – The name’s identifier.

  • prefix (Name) – Reference to the name’s prefix, or None for a simple name.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()[source]

Formats the attribute name.

Format: v'range

Return type:

str

Returns:

Formatted attribute name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.AllName(node, prefix)[source]

Represents a keyword all following a name in dot-notation.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.AllName.

Example

ptr.all
-- ^^^^

Inheritance

Inheritance diagram of AllName

Parameters:
__init__(node, prefix)[source]

Initializes an all name.

Parameters:
  • prefix (Name) – Reference to the name’s prefix, or None for a simple name.

  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()

Formats the selected name.

Format: rec.elem

Return type:

str

Returns:

Formatted selected name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.

class pyGHDL.dom.Name.OpenName(node)[source]

Represents the keyword open used as a special name.

This class implements a pyGHDL.dom object derived from pyVHDLModel.Name.OpenName.

Example

open

Inheritance

Inheritance diagram of OpenName

Parameters:

node (Iir)

__init__(node)[source]

Initializes an open name.

Parameters:
  • parent – The parent model entity of this entity.

  • node (Iir)

Return type:

None

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 HasPrefix: bool

Check if the name has a prefix, i.e. _prefix is set.

This is true for all names except simple names.

Returns:

True, if the name has a prefix.

property Identifier: str

Read-only property to access the identifier this name references (_identifier).

Returns:

The referenced identifier.

property NormalizedIdentifier: str

Read-only property to access the normalized identifier this name references (_normalizedIdentifier).

Returns:

The referenced identifier (normalized).

property Parent: ModelEntity

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

Returns:

Reference to the parent entity.

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

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

If _position is None, resolve the position object from _iirNode

Returns:

The IIR’s position in the source file.

property Prefix: Name | None

Read-only property to access the name’s prefix in a chain of names (_prefix).

Returns:

The name left from current name, if not a simple name, otherwise None.

property Root: Name

Read-only property to access the root (left-most) element in a chain of names (_root).

In case the name is a simple name, the root points to the name itself.

Returns:

The name’s root element.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__repr__()

Formats a representation of the name.

Format: Name: 'sig'

Return type:

str

Returns:

String representation of the name.

__str__()[source]

Formats the open name.

Format: open

Return type:

str

Returns:

Formatted open name.

_identifier: str

The name’s identifier.

_normalizedIdentifier: str

The normalized (lower case) identifier.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_prefix: Name | None

Reference to the name’s prefix, or None for a simple name.

_root: Name | None

Reference to the root of the name chain.