Payload

class coaxi.Payload[T]

Adapter for an application payload type T. Bind the data handles in the adapter and pass it to the endpoint’s payload parameter. An adapter can inherit from Payload[T] or implement its methods without inheritance. Use the signature drive(self, value: T) -> None and return T from read(). A type checker checks the value keyword as well as its type, even when the endpoint calls drive() positionally.

The source calls drive() and clear(); the sink calls read(). These methods must be synchronous. Validate all fields before writing any of them to avoid leaving a partial payload on a conversion error.

See IQ samples as a dataclass for the VHDL, adapter, and cocotb test.

read

Payload.read() → T
Returns:

A snapshot independent of later reads or writes.

drive

Payload.drive(value: T) → None
Parameters:
  • value: T

    Application payload to convert and write.

Returns:

None.

clear

Payload.clear() → None
Returns:

None, after scheduling a defined value for every payload field the adapter drives.