I have a question about the use of the MMIO package for reading data out of a BRAM.
My setup with the ZCU111 is the following:
- Transmitter side: 16samples à 16bits (either high (0x7FFF) or low level (0x8000)) stored in a constant --> that means this pattern is repeated from the transmitter
- DAC: Reference clock: 4GHz, Sampling rate: 4GSPS, Interpolation x4, 16 samples per AXI-stream cycle, low-speed single-ended balun DAC used
- DAC --> ADC: Directly connect the DAC to the ADC
- ADC: Reference clock: 4GHZ, Sampling rate: 4GSPS, Decimation x2, 8 samples per AXI-stream cycle --> 8*16=128bits wide bus, low-speed single-ended balun ADC used
- Receiver side: The ADC data stream comes with 128bits at 250MHz. These data I store in a simple dual-port BRAM (Port A: 128bits wide, 256 words deep; Port B: 32bits wide, 1024 words deep). At Port B I got a BRAM controller to read the data out with PYNQ. The address of the BRAM is controlled by a
The PYNQ code to read out the data from the BRAM is:
from pynq import MMIO
base_address = 0xA0000000
mem_size = 4096
mmio = MMIO(base_address, mem_size)
Read out the data from BRAM:
received_data = *1024
for i in range(0,1024)
received_data[i] = mmio.read(i*4)
#address increment of 4 because 32bit system
Well… I read out 32bits from the BRAM. That means 2 samples at the same time. The received data in PYNQ is represented as an integer.
In order to split this 32bits wide word into two 16bits (or 12bits, because the ADC has a resolution of 12bits), I convert the integer back into a binary representation and split the string (as shown in the screenshot).
Now my question: What is the MMIO data format?
If I look on my 32bit words, the data makes no sense to me.
I would assume that the 32bits have the following format:
12bits of sample2, 4 redundant bits, 12bits of sample1, 4 redundant bits (because the data from the ADC is MSB aligned).
In other representation:
Where x is either all-zero or all-ones.
However, in my data I cannot see such a pattern.
When I then split the binary string of 32bits into 2 samples with 12 bits, reconvert into integer format and adapt the number by the two’s complement, my signal is not as defined in my transmitter side constant…
Do I miss something in my interpretation of the data format delivered by the MMIO.read function?
Thanks for any help!