pyGHDL.dom.Misc
Todo
Add a module documentation.
Classes
Alias: Represents an alias declaration.
Classes
- class pyGHDL.dom.Misc.Alias(node, aliasName, name, subtype=None, documentation=None)[source]
Inheritance
- __init__(node, aliasName, name, subtype=None, documentation=None)[source]
Initializes an alias declaration.
- Parameters:
identifier – The identifier of a model entity.
name (
Symbol) – Reference to the name being aliased.subtype (
Symbol) – Reference to the alias’ subtype, orNoneif none was given.documentation (
str) – The documentation comment associated with this declaration.parent – The parent model entity of this entity.
node (Iir)
aliasName (str)
- Return type:
None
- 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
typefound by walking the parent chain upwards.Iterates the parent chain - starting at this model entity - upwards (toward the root of the model) until an ancestor of the requested type is found.
- Parameters:
type (
Type) – Class (type) of the ancestor to find.- Return type:
- Returns:
The closest ancestor of the requested type.
- Raises:
VHDLModelException – If the root of the model is reached without finding an ancestor of the requested type.
- classmethod GetMethodsWithAttributes(predicate: TAttr | Iterable[TAttr] | None = None) Dict[Callable, Tuple[Attribute, ...]]
- Parameters:
predicate (
TypeVar(TAttr) |Iterable[TypeVar(TAttr)] |None) – An attribute class, an iterable of attribute classes, orNoneto accept every attribute.- Return type:
- Returns:
Dictionary of methods and the matching attributes attached to them.
- Raises:
ValueError – If an element of parameter ‘predicate’ is not a sub-class of
Attribute.ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.
- property 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 0x7c526738b7d0>
Cached read-only property to access an IIR’s position in source code (
_position).If
_positionis None, resolve the position object from_iirNode- Returns:
The IIR’s position in the source file.
- property Subtype: SubtypeSymbol | None
Read-only property to access the subtype (
_subtype).- Returns:
The subtype, or
Noneif not set.
- __str__()[source]
Formats the alias declaration.
Format:
alias myAlias : bit is target, or without the subtype when none was given- Return type:
- Returns:
Formatted alias declaration.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- _subtype: SubtypeSymbol | None
Reference to the alias’ subtype, or
Noneif none was given.