I am beginning with FPGAs and I am working on an accelerator that acquires data from a microphone (Pulse Density Modulation) and extracts a single frequency from the signal.
My accelerator is basically a digital filter, that multiplies each audio sample with a complex phasor and adds everything together. After n
samples it should produce a complex number (representing phase and amplitude of a given frequency) and make it available to a CPU somehow.
My question is: what is the best/simplest strategy to transfer data from the FPGA to the CPU?
Note the following:
- I am using a Zynq UltraScale+ MPSoC from Xilinx (more precisely the zu3eg), and CPU and FPGA are on the same physical chip.
- My accelerator is an AXI slave that should be programmed and started by the CPU
- I need to transfer approximately 240 KB/sec from the FPGA to the CPU
The possibilities I could think of are:
- Create a sort of FIFO within my accelerator: use some registers to store the last
m
results and signal the CPU with an interrupt when this output buffer is getting full. The data would be read by the CPU through the AXI interface. - Use an external FIFO: use one of VIVADO modules to implement a FIFO between my accelerator and the CPU. I guess this forces me to implement an AXI master interface on my accelerator?
- Write the results in the FPGA's BRAM in a circular buffer
Could you explain what are the best design patterns for this type of problem? As I said I am rather new to FPGAs and it would be great to have some advice from someone with more experience. Any pointer to good references would also be greatly appreciated
Thanks a lot!!