MMap’ed HWIO#

There are two common ways of mmap-ing to an address region:

  • If you have a device file that maps to your peripheral (like a UIO Device), use MMapFileHWIO

  • If you want to manually map to a sub-region of /dev/mem using a physical address and region size, use MMapMemHWIO

MMapFileHWIO#

class peakrdl_pyral_runtime.hwio.mmap.MMapFileHWIO(path: str, *, offset: int = 0, size: int | None = None)#

HWIO implementation that directly maps an address space to a file-backed memory map on the host device, such as a UIO device.

Parameters:
  • path (str) – Path to the device file.

  • offset (int) – Additional address offset to add to all HWIO transactions

  • size (int|None) – Explicit size of the memory map. If None, the size is derived based on the advertised size of the file.

MMapMemHWIO#

class peakrdl_pyral_runtime.hwio.mmap.MMapMemHWIO(offset: int, size: int)#

HWIO implementation that directly maps an address space to the system’s physical memory map using the /dev/mem device.

Parameters:
  • offset (int) – Additional address offset of the region to map

  • size (int) – Size of the region to map map.