pyGHDL.dom.Literal

Classes


Classes

class pyGHDL.dom.Literal.NullLiteral(node)[source]

Inheritance

Inheritance diagram of NullLiteral

Parameters:

node (Iir)

__init__(node)[source]

Initializes a VHDL model entity.

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 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.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the null literal.

Format: null

Return type:

str

Returns:

Formatted null literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

class pyGHDL.dom.Literal.EnumerationLiteral(node, value)[source]

Inheritance

Inheritance diagram of EnumerationLiteral

Parameters:
__init__(node, value)[source]

Initializes an enumeration literal.

Parameters:
  • value (str) – The enumeration literal’s 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 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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the enumeration literal.

Format: idle

Return type:

str

Returns:

Formatted enumeration literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The enumeration literal’s name.

class pyGHDL.dom.Literal.IntegerLiteral(node, value)[source]

Inheritance

Inheritance diagram of IntegerLiteral

Parameters:
__init__(node, value)[source]

Initializes an integer literal.

Parameters:
  • value (int) – The literal’s integer value.

  • 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 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 Value: int

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the integer literal.

Format: 42

Return type:

str

Returns:

Formatted integer literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: int

The literal’s integer value.

class pyGHDL.dom.Literal.FloatingPointLiteral(node, value)[source]

Inheritance

Inheritance diagram of FloatingPointLiteral

Parameters:
__init__(node, value)[source]

Initializes a floating-point literal.

Parameters:
  • value (float) – The literal’s floating-point value.

  • 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 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 Value: float

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the floating-point literal.

Format: 3.5

Return type:

str

Returns:

Formatted floating-point literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: float

The literal’s floating-point value.

class pyGHDL.dom.Literal.PhysicalIntegerLiteral(node, value, unitName)[source]

Inheritance

Inheritance diagram of PhysicalIntegerLiteral

Parameters:
__init__(node, value, unitName)[source]

Initializes a physical literal with an integer value.

Parameters:
  • value (int) – The literal’s integer value, in units of _unitName.

  • unitName (str) – The name of the physical unit the value is given in.

  • 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 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 UnitName: str

Read-only property to access the unit name (_unitName).

Returns:

The unit name.

property Value: int

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the physical literal.

Format: 10 ns

Return type:

str

Returns:

Formatted physical literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_unitName: str

The name of the physical unit the value is given in.

_value: int

The literal’s integer value, in units of _unitName.

class pyGHDL.dom.Literal.PhysicalFloatingLiteral(node, value, unitName)[source]

Inheritance

Inheritance diagram of PhysicalFloatingLiteral

Parameters:
__init__(node, value, unitName)[source]

Initializes a physical literal with a floating-point value.

Parameters:
  • value (int) – The literal’s floating-point value, in units of _unitName.

  • unitName (float) – The name of the physical unit the value is given in.

  • 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 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 UnitName: str

Read-only property to access the unit name (_unitName).

Returns:

The unit name.

property Value: float

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the physical literal.

Format: 10 ns

Return type:

str

Returns:

Formatted physical literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_unitName: str

The name of the physical unit the value is given in.

_value: float

The literal’s floating-point value, in units of _unitName.

class pyGHDL.dom.Literal.CharacterLiteral(node, value)[source]

Inheritance

Inheritance diagram of CharacterLiteral

Parameters:
__init__(node, value)[source]

Initializes a character literal.

Parameters:
  • value (str) – The literal’s character value.

  • 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 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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the character literal.

Format: a

Return type:

str

Returns:

Formatted character literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal’s character value.

class pyGHDL.dom.Literal.BinaryBitStringLiteral(node, value, length=None, isSigned=None)[source]

Inheritance

Inheritance diagram of BinaryBitStringLiteral

Parameters:
  • node (Iir)

  • value (str)

  • length (int | None)

  • isSigned (bool | None)

__init__(node, value, length=None, isSigned=None)[source]

Initializes a bit string literal.

Parameters:
  • value (str) – The literal as written in the source, without the enclosing double quotes.

  • length (int | None) – The explicitly given length, or None if the literal has no length specification.

  • isSigned (bool | None) – True if signed, False if unsigned, None if unspecified.

  • node (Iir)

Return type:

None

property BinaryValue: str

Read-only property to access the binary value (_binaryValue).

Returns:

The binary value.

property Bits: int | None

Read-only property to access the bits (_bits).

Returns:

The bits, or None if not set.

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 IsSigned: bool | None

Check if the bit string literal is signed (_isSigned).

Returns:

True, if the literal is signed; None, if unspecified.

property Length: int | None

Read-only property to access the length (_length).

Returns:

The length, or None if not set.

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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the bit string literal.

Format: 8ub"10100000"

The length and the signedness marker (s/u) are omitted when unspecified.

Return type:

str

Returns:

Formatted bit string literal.

_base: ClassVar[BitStringBase] = 2

The base this literal is written in.

_binaryValue: str

The literal’s value expanded to base 2, one character per bit.

_bits: int

The number of bits the literal represents.

_isSigned: bool | None

True if signed, False if unsigned, None if unspecified.

_length: int | None

The explicitly given length, or None if the literal has no length specification.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal as written in the source, without the enclosing double quotes.

class pyGHDL.dom.Literal.OctalBitStringLiteral(node, value, length=None, isSigned=None)[source]

Inheritance

Inheritance diagram of OctalBitStringLiteral

Parameters:
  • node (Iir)

  • value (str)

  • length (int | None)

  • isSigned (bool | None)

__init__(node, value, length=None, isSigned=None)[source]

Initializes a bit string literal.

Parameters:
  • value (str) – The literal as written in the source, without the enclosing double quotes.

  • length (int | None) – The explicitly given length, or None if the literal has no length specification.

  • isSigned (bool | None) – True if signed, False if unsigned, None if unspecified.

  • node (Iir)

Return type:

None

property BinaryValue: str

Read-only property to access the binary value (_binaryValue).

Returns:

The binary value.

property Bits: int | None

Read-only property to access the bits (_bits).

Returns:

The bits, or None if not set.

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 IsSigned: bool | None

Check if the bit string literal is signed (_isSigned).

Returns:

True, if the literal is signed; None, if unspecified.

property Length: int | None

Read-only property to access the length (_length).

Returns:

The length, or None if not set.

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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the bit string literal.

Format: 8ub"10100000"

The length and the signedness marker (s/u) are omitted when unspecified.

Return type:

str

Returns:

Formatted bit string literal.

_base: ClassVar[BitStringBase] = 8

The base this literal is written in.

_binaryValue: str

The literal’s value expanded to base 2, one character per bit.

_bits: int

The number of bits the literal represents.

_isSigned: bool | None

True if signed, False if unsigned, None if unspecified.

_length: int | None

The explicitly given length, or None if the literal has no length specification.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal as written in the source, without the enclosing double quotes.

class pyGHDL.dom.Literal.DecimalBitStringLiteral(node, value, length=None, isSigned=None)[source]

Inheritance

Inheritance diagram of DecimalBitStringLiteral

Parameters:
  • node (Iir)

  • value (str)

  • length (int | None)

  • isSigned (bool | None)

__init__(node, value, length=None, isSigned=None)[source]

Initializes a bit string literal.

Parameters:
  • value (str) – The literal as written in the source, without the enclosing double quotes.

  • length (int | None) – The explicitly given length, or None if the literal has no length specification.

  • isSigned (bool | None) – True if signed, False if unsigned, None if unspecified.

  • node (Iir)

Return type:

None

property BinaryValue: str

Read-only property to access the binary value (_binaryValue).

Returns:

The binary value.

property Bits: int | None

Read-only property to access the bits (_bits).

Returns:

The bits, or None if not set.

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 IsSigned: bool | None

Check if the bit string literal is signed (_isSigned).

Returns:

True, if the literal is signed; None, if unspecified.

property Length: int | None

Read-only property to access the length (_length).

Returns:

The length, or None if not set.

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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the bit string literal.

Format: 8ub"10100000"

The length and the signedness marker (s/u) are omitted when unspecified.

Return type:

str

Returns:

Formatted bit string literal.

_base: ClassVar[BitStringBase] = 10

The base this literal is written in.

_binaryValue: str

The literal’s value expanded to base 2, one character per bit.

_bits: int

The number of bits the literal represents.

_isSigned: bool | None

True if signed, False if unsigned, None if unspecified.

_length: int | None

The explicitly given length, or None if the literal has no length specification.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal as written in the source, without the enclosing double quotes.

class pyGHDL.dom.Literal.HexadecimalBitStringLiteral(node, value, length=None, isSigned=None)[source]

Inheritance

Inheritance diagram of HexadecimalBitStringLiteral

Parameters:
  • node (Iir)

  • value (str)

  • length (int | None)

  • isSigned (bool | None)

__init__(node, value, length=None, isSigned=None)[source]

Initializes a bit string literal.

Parameters:
  • value (str) – The literal as written in the source, without the enclosing double quotes.

  • length (int | None) – The explicitly given length, or None if the literal has no length specification.

  • isSigned (bool | None) – True if signed, False if unsigned, None if unspecified.

  • node (Iir)

Return type:

None

property BinaryValue: str

Read-only property to access the binary value (_binaryValue).

Returns:

The binary value.

property Bits: int | None

Read-only property to access the bits (_bits).

Returns:

The bits, or None if not set.

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 IsSigned: bool | None

Check if the bit string literal is signed (_isSigned).

Returns:

True, if the literal is signed; None, if unspecified.

property Length: int | None

Read-only property to access the length (_length).

Returns:

The length, or None if not set.

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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()

Formats the bit string literal.

Format: 8ub"10100000"

The length and the signedness marker (s/u) are omitted when unspecified.

Return type:

str

Returns:

Formatted bit string literal.

_base: ClassVar[BitStringBase] = 16

The base this literal is written in.

_binaryValue: str

The literal’s value expanded to base 2, one character per bit.

_bits: int

The number of bits the literal represents.

_isSigned: bool | None

True if signed, False if unsigned, None if unspecified.

_length: int | None

The explicitly given length, or None if the literal has no length specification.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal as written in the source, without the enclosing double quotes.

class pyGHDL.dom.Literal.StringLiteral(node, value)[source]

Inheritance

Inheritance diagram of StringLiteral

Parameters:
__init__(node, value)[source]

Initializes a string literal.

Parameters:
  • value (str) – The literal’s string value, without the enclosing double quotes.

  • 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 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 Value: str

Read-only property to access the value (_value).

Returns:

The value.

__getstate__() Dict[str, Any]

Helper for pickle.

Return type:

Dict[str, Any]

__str__()[source]

Formats the string literal.

Format: "hello"

Return type:

str

Returns:

Formatted string literal.

_parent: ModelEntity

Reference to a parent entity in the logical model hierarchy.

_value: str

The literal’s string value, without the enclosing double quotes.