How to make a proper data transfer between FPGA and Processor?

4 次查看(过去 30 天)
Dear all,
I am using SoC Blockset for a simple receiver design for ZCU111 board.
ADC is producing samples with period Ts, these samples go through an FPGA algorithm and are written (stream of samples at the same rate as ADC sample production rate = Ts) to a PS memory using AXI4-Stream to Software block. For some reason, no matter how small processor task duration time is, at some point of time the PS memory is not ready to accept new data (it sets backpressure "ready" signal to low). Of course in this case we have to either drop a sample that cannot be written to the memory or put it to some FIFO (I want the frame to be continuous, have no instant signal phase changes in the read data, so I do not want to drop the sample). When the PS memory is ready to accept the new sample, it sets backpressure "ready" signal to one, and the sample from the FIFO is transferred to the PS memory.
Now, the FIFO will always have at least one element during all further application run. Each time the PS memory will not be ready to accept a new sample, it will be added to the FIFO, and at some point it will also be full (I cannot stop ADC from producing samples, because the signal is continuous and I do not want instant phase shifts to appear in the recorded data), so the design would again drop the samples.
For example, in my model with Number of Buffers = 64, Burst length = 256, FIFO depth = 32, FIFO almost full = 32, Data Width = 128bit, task duration = 1e-4, frame production time = 1e-4 (FrameSize = 25600), starting from 2.35ms "ready" is set to 0 for the first time. This means that after 2.35 seconds from the start of the application, the FIFO in the FPGA logic will already be utilized by at least 1000 samples, in fact much more, and after 20 hours of continuous operation all the internal PL memory will for sure be used, in fact much earlier (I would make task duration and frame size greater as on the real HW but then the simulation would take too much time).
The question is what architecture/blocks to consider to avoid this problem? Or better how to solve the problem of that whatever task duration is set in Task Manager block, and Burst length, Framesize and number of buffers are set in AXi4-Stream to Software block, the PS memory will assign 0 to "ready" signal at some point of time, causing FIFO to rapidly become full in case no samples are dropped?
Thank you for your answers!

采纳的回答

Sergei
Sergei 2025-7-30
The issue can be resolved as this:
The samples, produced by the FPGA algorithm, are added to a FIFO in packages of N samples, from where these packages can be written to the memory as single data elements.
This allows to handle the FIFO filling problem: maximum bitrate from FIFO to the memory is N times the bitrate from the FPGA algorithm to the FIFO. This means, that even if the memory will not be ready to accept a package, the FIFO will be utilized more, but once the memory is available again, the FIFO will be freed faster then filled, so it will not be filled ever (if the memory is capable to store data as fast as it is produced at all). See the picture attached.

更多回答(1 个)

Chandra Adusumalli
Chandra Adusumalli 2025-7-21
Hi Seregi,
You can refer below example for streaming data tarnsfer between hardware and software.
This is the basic example for data streaming between FPGA and processor.
Here are some examples on RFSoC for RF Data capture. Using these examples as reference based on your ADC sample rate you can design your system to capture more ADC samples into processor.
  2 个评论
Sergei
Sergei 2025-7-23
编辑:Sergei 2025-7-23
@Chandra Adusumalli, thank you a lot for your answer!
I am familiar with these examples, my AXI4-Stream to Software is configured the same way as in there. However, for some reason, in the examples AXI4-Stream to Software is always ready to accept data ("ready" is high), but in my model the ready signal is asserted low after some time and I do now know why. This causes a problem: there is no place to store samples while AXI4-Stream to software is not ready to accept new samples.
The reason for that in the examples "ready" is always high is that in these examples the valid signal is sometimes asserted low, but in my model it is always high (each clock cycle there is a new ready sample). The question is how to work with such a designs so that the data is not droppped.
Thank you!
Sergei
Sergei 2025-7-23
编辑:Sergei 2025-7-24
@Chandra Adusumalli, for example, see the model attached. In here at some point "ready" signal becomes low. I can either store the samples somewhere (e.g. in FIFO) while they cannot be written to memory and account for this "ready" signal, or make the memory always ready. Or is there a good way to resolve this?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 System on Chip (SoC) 的更多信息

产品


版本

R2025a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by