pynq.mmio Module

class pynq.mmio.MMIO(base_addr, length=4, debug=False)[source]

Bases: object

This class exposes API for MMIO read and write.

virt_base

int – The address of the page for the MMIO base address.

virt_offset

int – The offset of the MMIO base address from the virt_base.

base_addr

int – The base address, not necessarily page aligned.

length

int – The length in bytes of the address range.

debug

bool – Turn on debug mode if it is True.

mmap_file

file – Underlying file object for MMIO mapping

mem

mmap – An mmap object created when mapping files to memory.

array

numpy.ndarray – A numpy view of the mapped range for efficient assignment

read(offset=0, length=4)[source]

The method to read data from MMIO.

Parameters:
  • offset (int) – The read offset from the MMIO base address.
  • length (int) – The length of the data in bytes.
Returns:

A list of data read out from MMIO

Return type:

list

write(offset, data)[source]

The method to write data to MMIO.

Parameters:
  • offset (int) – The write offset from the MMIO base address.
  • data (int / bytes) – The integer(s) to be written into MMIO.
Returns:

Return type:

None