Hi all!
I am trying to implement the equivalent of the RFSoC-MTS repo ( GitHub - Xilinx/RFSoC-MTS: A PYNQ overlay demonstrating AMD RFSoC Multi-Tile Synchronization (MTS). · GitHub ) but on the ZCU111. I don’t really care about the MTS feature, I just need basically the ADC with some BRAMs and also the DeepCapture feature (using the DDR4 to capture data).
That has worked fine, I am able to capture data with the DDR4 and see it in Pynq, working as expected. Now I would like to extend the design a bit, and instead send data from the PS to the PL through the DDR4. I am going this direction since I need to send in a single command 32 Mb of data, which is too much for the BRAMs to handle. To do so, my first naive try was to enable the Write Channel within the DMA IP and connect the stream output to a FIFO, and then to a system ILA to debug.
Then, on the Pynq side I am able to use the DDR4 data capture with the function provided by the RFSoC-MTS repo
def dram_capture(self, buffer):
""" Captures ADC samples to the PL-DRAM memory notebook provided buffer """
if type(buffer) != pynq.buffer.PynqBuffer:
raise Exception("A PYNQ allocated buffer is required!")
if not np.issubdtype(buffer.dtype, np.int16):
raise Exception("buffer not defined or np.int16")
self.adc_dma.register_map.S2MM_DMACR.Reset = 1
self.adc_dma.recvchannel.stop()
self.fifo_flush.off() # clear FIFO
# because TLAST is not used, we must soft-reset the S2MM/recvchannel
self.adc_dma.register_map.S2MM_DMACR.Reset = 0
self.adc_dma.recvchannel.start()
self.adc_dma.recvchannel.transfer(buffer)
self.fifo_flush.on() # enable FIFO and samples will start flowing
I defined a naive function to transfer data
def dram_playback(self, buffer):
"""Stream a waveform from PL-DRAM to the DAC via MM2S DMA"""
if type(buffer) != pynq.buffer.PynqBuffer:
raise Exception("A PYNQ allocated buffer is required!")
if not np.issubdtype(buffer.dtype, np.int16):
raise Exception("buffer must be np.int16")
self.adc_dma.sendchannel.transfer(buffer)
which I call with:
from pynq import allocate
import numpy as np
num_samples = 4 * 1024 * 1024
tx_buffer = allocate(num_samples, dtype='i2', target=ol.ddr4_0)
t = np.arange(num_samples)
tx_buffer[:] = t
ol.dram_playback(tx_buffer)
However, when I do that I see on the probes that tdata is changed but to very weird and constant values.
Any hint on what I am doing wrong?
Thanks!




