pyGHDL.dom.Type
This module implements derived type classes from pyVHDLModel.Type.
Classes
IncompleteType: Represents a base-class for types without a type definition of their own.EnumeratedType: Represents an enumerated type.IntegerType: Represents an integer type.PhysicalType: Represents a physical type.ArrayType: Represents an array type.RecordTypeElement: Represents a record element.RecordType: Represents a record type.ProtectedType: Represents a protected type.ProtectedTypeBody: Represents a protected type body.AccessType: Represents an access type.FileType: Represents a file type.Subtype: Represents a subtype.
Classes
- class pyGHDL.dom.Type.IncompleteType(node, identifier, documentation=None)[source]
Inheritance
- 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.
- __str__()
Formats the type declaration.
Format:
type myType- Return type:
- Returns:
Formatted type declaration.
- _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.Type.EnumeratedType(node, identifier, literals, documentation=None)[source]
Represents an enumerated type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.EnumeratedType.Example
type integer is (lit_1, lit2, ...);
Inheritance
- Parameters:
node (Iir)
identifier (str)
literals (List[EnumerationLiteral])
documentation (str)
- __init__(node, identifier, literals, documentation=None)[source]
Initializes an enumerated type definition.
- Parameters:
identifier (
str) – The identifier of a model entity.literals (
List[EnumerationLiteral]) – List of all enumeration literals, in declaration order.documentation (
str) – The documentation comment associated with this declaration.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses an enumerated type IIR and returns an
EnumeratedTypeinstance.- Parameters:
- Return type:
- Returns:
The enumerated type instance.
- 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 Literals: List[EnumerationLiteral]
Read-only property to access the literals (
_literals).- Returns:
List of literals.
- 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.
- __str__()[source]
Formats the enumerated type definition.
Format:
state is (idle, run)- Return type:
- Returns:
Formatted enumerated type definition.
- _literals: List[EnumerationLiteral]
List of all enumeration literals, in declaration order.
- _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.Type.IntegerType(node, typeName, rng, documentation=None)[source]
Represents an integer type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.IntegerType.Example
type integer is range -2147483648 to 2147483647;
Inheritance
- 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 Range: <pyTooling.Decorators.readonly object at 0x7c5266bf6e50>
Read-only property to access the type’s range (
_range).- Returns:
The range.
- __str__()[source]
Formats the integer type definition.
Format:
byte_count is range 0 to 7- Return type:
- Returns:
Formatted integer type definition.
- _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.
- _range: <pyTooling.Decorators.readonly object at 0x7c5266bf6e50>
The range constraining this scalar type.
- class pyGHDL.dom.Type.PhysicalType(node, typeName, rng, primaryUnit, units, documentation=None)[source]
Represents a physical type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.PhysicalType.Example
type time is range integer'low to integer'high units fs; ps = 1000 fs; -- ... end units;
Inheritance
- Parameters:
- __init__(node, typeName, rng, primaryUnit, units, documentation=None)[source]
Initializes a physical type definition.
- Parameters:
identifier – The identifier of a model entity.
rng (
Range|Name) – The range constraining this scalar type.primaryUnit (
str) – The name of the type’s primary unit.units (
List[Tuple[str,PhysicalIntegerLiteral]]) – Iterable of the secondary units as (name, value) pairs.documentation (
str) – The documentation comment associated with this declaration.parent – The parent model entity of this entity.
node (Iir)
typeName (str)
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses an physical type IIR and returns an
PhysicalTypeinstance.- Parameters:
- Return type:
- Returns:
The physical type instance.
- 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 PrimaryUnit: str
Read-only property to access the primary unit (
_primaryUnit).- Returns:
The primary unit.
- property Range: <pyTooling.Decorators.readonly object at 0x7c5266bf6e50>
Read-only property to access the type’s range (
_range).- Returns:
The range.
- property SecondaryUnits: List[Tuple[str, PhysicalIntegerLiteral]]
Read-only property to access the secondary units (
_secondaryUnits).- Returns:
List of secondary units.
- __str__()[source]
Formats the physical type definition.
Format:
distance is range 0 to 1000 units um; mm = 1000 um;- Return type:
- Returns:
Formatted physical type definition.
- _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.
- _range: <pyTooling.Decorators.readonly object at 0x7c5266bf6e50>
The range constraining this scalar type.
- _secondaryUnits: List[Tuple[str, PhysicalIntegerLiteral]]
Secondary units as (name, value) pairs.
- class pyGHDL.dom.Type.ArrayType(node, identifier, indices, elementSubtype, documentation=None)[source]
Represents an array type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.ArrayType.Example
type bit_vector is array(natural range <>) of bit;
Inheritance
- __init__(node, identifier, indices, elementSubtype, documentation=None)[source]
Initializes an array type definition.
- Parameters:
identifier (
str) – The identifier of a model entity.indices (
List) – List of all index ranges, one per dimension.elementSubtype (
Symbol) – Reference to the subtype of the array’s elements.documentation (
str) – The documentation comment associated with this declaration.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses an array type IIR and returns an
ArrayTypeinstance.
- property Dimensions: List[Range]
Read-only property to access the dimensions (
_dimensions).- Returns:
List of dimensions.
- property Documentation: str | None
Read-only property to access the model entity’s documentation (
_documentation).- Returns:
Associated documentation of a model entity.
- property ElementType: Symbol
Read-only property to access the element type (
_elementType).- Returns:
The element type.
- 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.
- __str__()[source]
Formats the array type definition.
Format:
memory is array(0 to 7) of bit- Return type:
- Returns:
Formatted array type definition.
- _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.Type.RecordTypeElement(node, identifiers, subtype, documentation=None)[source]
Represents a record element.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.RecordTypeElement.Example
-- type pt is record element : std_logic; -- ... -- end record;
Inheritance
- __init__(node, identifiers, subtype, documentation=None)[source]
Initializes a record type element.
- Parameters:
- Return type:
None
- classmethod parse(elementDeclarationNode, furtherIdentifiers=None)[source]
Parses a record element IIR and returns an
RecordTypeElementinstance.- Parameters:
- Return type:
- Returns:
The record element instance.
- 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 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 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: Symbol
Read-only property to access the subtype (
_subtype).- Returns:
The subtype.
- __str__()[source]
Formats the record element declaration.
Format:
a, b : bit- Return type:
- Returns:
Formatted record element declaration.
- _parent: ModelEntity
Reference to a parent entity in the logical model hierarchy.
- class pyGHDL.dom.Type.RecordType(node, identifier, elements=None, documentation=None)[source]
Represents a record type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.RecordType.Example
type pt is record -- elements end record;
Inheritance
- Parameters:
node (Iir)
identifier (str)
elements (List[RecordTypeElement])
documentation (str)
- __init__(node, identifier, elements=None, documentation=None)[source]
Initializes a record type definition.
- Parameters:
identifier (
str) – The identifier of a model entity.elements (
List[RecordTypeElement]) – List of all element declarations, in declaration order.documentation (
str) – The documentation comment associated with this declaration.parent – The parent model entity of this entity.
node (Iir)
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses a record type IIR and returns an
RecordTypeinstance.- Parameters:
- Return type:
- Returns:
The record type instance.
- 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[RecordTypeElement]
Read-only property to access the elements (
_elements).- Returns:
List of elements.
- 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.
- __str__()[source]
Formats the record type definition.
Format:
frame is record a : bit;- Return type:
- Returns:
Formatted record type definition.
- _elements: List[RecordTypeElement]
List of all element declarations, in declaration order.
- _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.Type.ProtectedType(node, identifier, methods=None, documentation=None)[source]
Represents a protected type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.ProtectedType.Example
type pt is protected -- public interface end protected;
Inheritance
- __init__(node, identifier, methods=None, documentation=None)[source]
Initializes a protected type declaration.
- Parameters:
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses a protected type IIR and returns an
ProtectedTypeinstance.- Parameters:
- Return type:
- Returns:
The protected type instance.
- property DeclaredItems: List
Read-only property to access the declared items (
_declaredItems).- Returns:
List of all 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 Functions: Dict[str, List[Function]]
Read-only property to access the declared functions (
_functions).- Returns:
Dictionary of all functions, indexed by name; each entry is a list of overloads.
- 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.
- IndexDeclaredItems()
Index declared items listed in the protected type declaration.
Only subprogram declarations are legal here, so anything else is passed to
_IndexOtherDeclaredItem().See also
SequentialDeclarationRegionMixin.IndexDeclaredItems()The same algorithm for the protected type’s body.
- Return type:
- property Methods: List[Procedure | Function]
Read-only property to access the declared methods, in declaration order.
A protected type declares nothing but subprograms, so this is every declared item (
_declaredItems). It is kept as a named view because “method” is the VHDL term for a protected type’s subprograms.- Returns:
List of methods, in declaration order.
- 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 Procedures: Dict[str, List[Procedure]]
Read-only property to access the declared procedures (
_procedures).- Returns:
Dictionary of all procedures, indexed by name; each entry is a list of overloads.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- __str__()
Formats the type declaration.
Format:
type myType- Return type:
- Returns:
Formatted type declaration.
- _declaredItems
List of all declared items in this protected type declaration.
- _documentation
The associated documentation of a model entity.
- _functions
All declared functions, indexed by name; each is a list of overloads.
- _identifier
The identifier of a model entity.
- _namespace
The namespace of this protected type declaration.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _objectVertex
The vertex representing this type in the design’s object graph.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _procedures
All declared procedures by name; each is a list of overloads.
- class pyGHDL.dom.Type.ProtectedTypeBody(node, identifier, declaredItems=None, documentation=None)[source]
Represents a protected type body.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.ProtectedTypeBody.Example
type pt is protected body -- implementations end protected body;
Inheritance
- __init__(node, identifier, declaredItems=None, documentation=None)[source]
Initializes a protected type body.
- Parameters:
- Return type:
None
- classmethod parse(protectedBodyNode)[source]
Parses a protected type body IIR and returns an
ProtectedTypeBodyinstance.
- 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.
- 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.
- IndexDeclaredItems()
Index declared items listed in the sequential declaration region.
Every declared item is added to
_namespace, and additionally to the lookup table matching its kind. Items of an unhandled kind are passed to_IndexOtherDeclaredItem().See also
ConcurrentDeclarationRegionMixin.IndexDeclaredItems()The same algorithm for a concurrent declaration region.
- Return type:
- property Methods: List[Procedure | Function]
Read-only property to access the implemented methods, in declaration order.
A protected type body may also declare variables, types, subtypes, aliases and files, so this is the subprogram subset of
_declaredItemsrather than all of them.- Returns:
List of methods, in declaration order.
- property Namespace: <pyTooling.Decorators.readonly object at 0x7c5266bcf650>
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 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 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 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.
- _IndexOtherDeclaredItem(item)
Hook for declared items the region doesn’t handle itself. Derived classes may override it.
- Return type:
- __str__()
Formats the type declaration.
Format:
type myType- Return type:
- Returns:
Formatted type 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.
- _identifier
The identifier of a model entity.
- _namespace
The namespace of this sequential declaration region.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _objectVertex
The vertex representing this type in the design’s object graph.
- _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.
- _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.Type.AccessType(node, identifier, designatedSubtype, documentation=None)[source]
Represents an access type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.AccessType.Example
type line is access string;
Inheritance
- __init__(node, identifier, designatedSubtype, documentation=None)[source]
Initializes an access type definition.
- Parameters:
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses an access type IIR and returns an
AccessTypeinstance.- Parameters:
- Return type:
- Returns:
The access type instance.
- property DesignatedSubtype: Symbol
Read-only property to access the designated subtype (
_designatedSubtype).- Returns:
The designated subtype.
- 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.
- __str__()[source]
Formats the access type definition.
Format:
ptr is access node- Return type:
- Returns:
Formatted access type definition.
- _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.Type.FileType(node, identifier, designatedSubtype, documentation=None)[source]
Represents a file type.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.FileType.Example
type text is file of string;
Inheritance
- __init__(node, identifier, designatedSubtype, documentation=None)[source]
Initializes a file type definition.
- Parameters:
- Return type:
None
- classmethod parse(typeName, typeDefinitionNode, documentation=None)[source]
Parses a file type IIR and returns an
FileTypeinstance.
- property DesignatedSubtype: Symbol
Read-only property to access the designated subtype (
_designatedSubtype).- Returns:
The designated subtype.
- 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.
- __str__()[source]
Formats the file type definition.
Format:
ft is file of character- Return type:
- Returns:
Formatted file type definition.
- _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.Type.Subtype(node, subtypeName, symbol, documentation=None)[source]
Represents a subtype.
This class implements a
pyGHDL.domobject derived frompyVHDLModel.Type.Subtype.Inheritance
- __init__(node, subtypeName, symbol, documentation=None)[source]
Initializes a subtype declaration.
- Parameters:
- Return type:
None
- property BaseType: <pyTooling.Decorators.readonly object at 0x7c5266bf6450>
Read-only property to access the base type (
_baseType).- Returns:
The base type.
- 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 Range: <pyTooling.Decorators.readonly object at 0x7c5266bf6650>
Read-only property to access the range (
_range).- Returns:
The range.
- property ResolutionFunction: Function
Read-only property to access the resolution function (
_resolutionFunction).- Returns:
The resolution function.
- __str__()[source]
Formats the subtype declaration.
Format:
subtype byte is bit_vectorThe base type is rendered, so an unlinked subtype shows
None.- Return type:
- Returns:
Formatted subtype declaration.
- _baseType
The resolved base type of this subtype.
- _documentation
The associated documentation of a model entity.
- _identifier
The identifier of a model entity.
- _normalizedIdentifier
The normalized (lower case) identifier of a model entity.
- _objectVertex
The vertex representing this type in the design’s object graph.
- _parent
Reference to a parent entity in the logical model hierarchy.
- _range
The constraint narrowing the base type, or
Noneif unconstrained.
- _resolutionFunction
The resolution function, or
Noneif the subtype is unresolved.
- _type
Reference to the type or subtype this subtype is derived from.