HWIO Callback Wrapper#
Already have implementations of read/write operations elsewhere? Pass them to this HWIO callback wrapper shim.
- class peakrdl_pyral_runtime.hwio.callback.CallbackHWIO(read_cb: Callable[[int, int], int], write_cb: Callable[[int, int, int], None], *, offset: int = 0)#
Generic HWIO implementation that allows users to provide externally defined read/methods as callbacks.
- Parameters:
read_cb (Callable) –
Reference to function that implements read operations from the hardware.
Function shall match the following prototype:
def read_cb(addr: int, size: int) -> int: ...
write_cb (Callable) –
Reference to function that implements write operations to the hardware.
Function shall match the following prototype:
def write_cb(addr: int, value: int, size: int) -> None: ...
offset (int) – Additional address offset to add to all HWIO transactions