avl._core.struct module
- class avl._core.struct.Struct[source]
- to_bits() int[source]
Convert the Struct instance to a bit representation. This method combines the values of all fields into a single integer, where each field’s value is shifted according to its width.
- Returns:
An integer representing the combined bit value of the Struct.
- to_hdl(hdl: <MagicMock name = 'mock.HierarchyObject' id='124411365987328'>) None[source]
Populate the Struct instance from a HierarchyObject. This method assigns each field’s value based on the corresponding attribute in the HierarchyObject.
- Parameters:
hdl – A HierarchyObject from which to populate the Struct fields.
- Returns:
None
- from_bits(value: <MagicMock name = 'mock.SimHandleBase' id='124411365987664'>) None[source]
Populate the Struct instance from a bit representation. This method takes an integer value and assigns each field’s value based on its width, effectively reconstructing the Struct from its bit representation.
- Parameters:
value – An integer representing the combined bit value of the Struct.
- Returns:
None
- from_hdl(hdl: <MagicMock name = 'mock.HierarchyObject' id='124411365987328'>) None[source]
Populate the Struct instance from a HierarchyObject. This method assigns each field’s value based on the corresponding attribute in the HierarchyObject.
- Parameters:
hdl – A HierarchyObject from which to populate the Struct fields.
- Returns:
None
- property value
Property to abstract the value and ensure it’s always cast when assigned
- property width: int
Calculate the total width of the Struct instance. This property sums the widths of all fields to determine the overall width.
- Returns:
The total width of the Struct instance.