Waveflow’s FFT, at full rate

A streaming FFT with four lanes should take a new frame every L/R cycles, forever: that is what its commutators are for. AMD’s Vitis L1 FFT, as shipped, takes 7.5 to 10 times longer (why). SsrFft keeps that library’s arithmetic – so its output is bit-exact with it – and rebuilds the data movement in Waveflow, one free-running task per piece of hardware. This example is the end-to-end run at RTL. The SSR FFT in the guide describes the module.

Learning objectives

What this adds to the examples before it, in the order the pages teach it:

  1. Build a streaming DSP block as a composite of many free-running tasks – here 7 to 20 of them, one per commutator, stage and buffer – whose top is generated from the module graph, and whose pysim is one process per task.
  2. Write a pipeline that runs at one word per cycle without stopping: no per-frame function to return from, frames visible only as a counter, and no blocking read at a loop head.
  3. Keep the bits single-sourced across three backends: one Python model, a pysim that calls it per block, and C++ whose formats and tables are generated from the same geometry.
  4. Measure a block at RTL – interval, latency, isolated-frame latency, resources – and compare it to the vendor core on the same platform.

The design

StreamDriver  ->  SsrFft (L, R = 4)  ->  StreamSink        one RadixWord a beat each way

The golden is the Vitis FFT example’s, on the same input frames: the bits are the vendor’s. The ports are wider than 64 bits – 128 in, 184 out at L = 64 – and travel through the pysim, the scenario files and the XSI BFMs as 64-bit chunks (wide words). With SsrFft(lanes=True) the testbench becomes VitisFft’s four drivers and four sinks instead, and the scenario files are shared with it too.

   
input ap_fixed<16, 2> complex, four a beat: a 128-bit RadixWord (real in each lane’s low half)
output ap_fixed<W, I> complex, W = 16 + log2 L + 1, four a beat: derived from the model
gated length L = 64, both reorders (tests/dsp/ssr_fft/test_xsi.py); measured L = 16 .. 4096
target RFSoC 4x2, xczu48dr-ffvg1517-2-e at 250 MHz

There is no hand-written C++ in the example, and none from a vendor: the task bodies are the framework’s (waveflow/dsp/ssr_fft/src/), the per-configuration header and task wrappers are generated, the top comes from composite_top_spec on the module and the harness from the testbench graph. include/, gen/, xsi/ and vectors/ are build output.

Running it

python -m examples.ssr_fft.ssr_fft                       # pysim: bit-exact + frame timing
python -m examples.ssr_fft.ssr_fft_build                 # generate, then csynth (needs Vitis)
pytest tests/dsp/ssr_fft/test_xsi.py -m xsi              # the RTL gates (needs Vivado)
python -m examples.ssr_fft.ssr_fft_measure               # measure every length at RTL -> measured.json
python -m examples.ssr_fft.ssr_fft_figures               # redraw this example's figures
python -m examples.ssr_fft.ssr_fft_runtime --rtl         # untimed vs pysim vs RTL, per frame

What each of these costs per frame, against an untimed model and the RTL, is measured in Evaluation: the SSR FFT.

The pages

  • The testbench – the graph, the scenarios, how the RTL is timed, the gates.
  • Timing – the interval at every length, a latency that does not depend on arrival, and the pysim against the RTL.
  • Resources – what the full rate costs, against the vendor core.

Table of contents

  • SSR FFT testbench - SsrFftTB, the testbench graph both the pysim and the XSI harness are built from -- a stream driver, the FFT, a sink, one RadixWord a beat (or VitisFft's four lanes each way with lanes=True). The scenarios (frames back to back; isolated frames with random gaps; 500 frames), how the RTL is timed from the BFMs with no waveform, how every run checks every frame, and the gates at three levels: the model, csim, and RTL.
  • SSR FFT timing results - What the RTL measured on the RFSoC 4x2 from L = 16 to 4096: a frame every L/R cycles at every length (7.5 to 10 times the vendor core), a first-frame latency of about 19L/16 cycles, and an isolated frame's latency identical to the back-to-back one -- no dependence on arrival. The pysim against the RTL, and what the SOB reorder costs.
  • SSR FFT resource results - What the full-rate FFT costs on the RFSoC 4x2, L = 16 to 4096, against the vendor core: the same DSPs exactly (12 per stage boundary), comparable LUTs, and from L = 1024 up more BRAM and flip-flops -- the commutators' delay lines and the two-frame reorder buffer, the memory that lets frames overlap. Read from csynth's XML by ssr_fft_measure.