HandlePayload¶
Default synchronous payload adapter for logic leaves and named containers. Containers are discovered once. Records use nested field-name mappings.
- class coaxi.HandlePayload(handle: SimHandleBase) None¶
- Parameters:
handle: SimHandleBaseScalar logic, logic-vector, or non-empty named-container payload handle.
- Returns:
None.- Raises:
TypeError – A leaf type is unsupported or a container is empty or inaccessible.
read¶
- HandlePayload.read() PayloadValue¶
- Returns:
A fresh
Logic,LogicArray, or nested dictionary snapshot, including meta-values.
drive¶
- HandlePayload.drive(value: PayloadValue) None¶
- Parameters:
value: PayloadValueWidth-matched scalar/vector value, unsigned integer, or complete nested field mapping.
- Returns:
None.- Raises:
ValueError – Fields do not match, an integer is negative or out of range, or a logic value or width is invalid.
TypeError – A leaf value has an unsupported type, including
None.
Validates the entire payload before writing any leaf. Validation failure leaves
all leaves unchanged. Conversion errors include the failing HDL path.
Use LogicArray.from_signed() for negative integers.
clear¶
- HandlePayload.clear() None¶
- Returns:
None, after scheduling zero on every payload leaf.
Signal writes follow cocotb’s write scheduling.