pynq.mmio Module

class pynq.mmio.MMIO(base_addr, length=4, device=None, **kwargs)[source]

Bases: object

This class exposes API for MMIO read and write.

base_addr

The base address, not necessarily page aligned.

Type:int
length

The length in bytes of the address range.

Type:int
array

A numpy view of the mapped range for efficient assignment

Type:numpy.ndarray
device

A device that can interact with the PL server.

Type:Device
read(offset=0, length=4, word_order='little')[source]

The method to read data from MMIO.

For the word_order parameter, it is only effective when operating 8 bytes. If it is little, from MSB to LSB, the bytes will be offset+4, offset+5, offset+6, offset+7, offset+0, offset+1, offset+2, offset+3. If it is big, from MSB to LSB, the bytes will be offset+0, offset+1, …, offset+7. This is different than the byte order (endianness); notice the endianness has not changed.

Parameters:
  • offset (int) – The read offset from the MMIO base address.
  • length (int) – The length of the data in bytes.
  • word_order (str) – The word order of the 8-byte reads.
Returns:

A list of data read out from MMIO

Return type:

list

write_mm(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

write_reg(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