The Vitis FFT
For a design, use
SsrFft: the same bits and the same ports, a new frame everyL/Rcycles – 7.5 to 10 times this module’s rate, on the same DSPs.VitisFftis kept as the vendor referenceSsrFftis checked against, and as the worked case of wrapping vendor IP – including how a 10x shortfall passed every functional test.
VitisFft (waveflow.vitis_l1.hw) wraps AMD’s SSR FFT from the Vitis DSP Library
(xf::dsp::fft::fft<>): a fixed-point, forward, natural-order FFT of length L that takes R
complex samples per clock cycle.
Lis the transform length, fixed at build time (ssr_fft_param_struct::N); there is no runtime length. It must be a power ofR(16, 64, 256, 1024, 4096, …).Ris the super-sample rate: the number of parallel lanes in and out. In this library it is also the butterfly radix – the two are tied – and the module supportsR = 4.
Sample n of a frame travels on lane n % R at word n // R, so a frame enters in L/R cycles.
Inside the core
The architecture is the SSR FFT’s, and The SSR FFT explains it in full – the input transposer, the radix-4 stages and their twiddle rotations, the commutators between them (what a commutator actually is), and the digit-reversal reorder. In the vendor’s code those are:
| block | in hls_ssr_fft*.hpp |
|---|---|
| input transposer | swap / InputTransposeChainStreaming, a chain of streamingDataCommutor |
| stages | fftStage, fftStage_1, … – nested; each a fftStageKernelS2S and a commutator |
| last stage | fftStageKernelLastStageS2S: no twiddle rotation |
| reorder | digitReversedDataReOrder: cacheDataDR, then writeBackCacheDataDR |
The arithmetic in those blocks is what waveflow.vitis_l1.fft models bit for bit – and what
SsrFft reuses. The data movement around it is what this page is about next.
Why VitisFft is far below the architecture’s rate
An SSR FFT with R lanes should take a new frame every L/R cycles: the commutators shuffle samples
across frames, so frame k+1 enters while frame k is still inside. AMD’s L1 guide (2020.1) states
exactly that, II = L/R. VitisFft measures 7.5 L/R at L = 64, 256 and 10 L/R from 1024 up –
2,556 cycles a frame at L = 1024 against a nominal 256. Three things stack, and only the first is
VitisFft’s own choice:
- The connection.
VitisFft’s body callsfft<>(in, out), the guide’s non-streaming connection, which wraps the core in buffer-to-stream blocks and serializes frames. The guide’s streaming connection –innerFFTin a DATAFLOW region between producer and consumer processes – overlaps frames: measured in cosim atL = 1024, about 1,420 cycles a frame (5.5L/R) instead of 2,556. Both compile, both are bit-exact, both synthesize; only a timing measurement against the vendor’s stated number tells them apart. - The commutators, as functions. Each commutator in the 2025.1 library runs a fixed
L/R + 2(R−1)·PFiterations per call – the frame plus a fill-and-drain window – because an HLS process in a dataflow region must return. The drain is paid every frame instead of overlapping the next one, which floors the interval at about 2.5L/Rwhatever the connection. (This window is also why an isolated frame’s latency depends on its arrival phase – next section.) - The stage loops and the reorder. Each stage re-enters its butterfly pipeline once per sub-transform, and the digit-reversal reorder fills its buffer and then empties it, one after the other.
None of these is a limit of the FFT or of HLS. They are the “accelerate a function call” idiom applied
to an architecture whose point is that nothing stops. Waveflow’s own SSR FFT,
waveflow.dsp.ssr_fft.SsrFft, keeps this library’s arithmetic – so it is bit-exact with VitisFft –
and rebuilds the data movement as free-running tasks: it measures exactly L/R cycles a frame at every
length from 16 to 4096, on the same DSPs. The evidence for (1)-(3), with every variant’s cosim, is in
plans/witness/vitis_fft_streaming/.
Latency depends on when a frame arrives
The input transposer’s commutator runs on a free-running internal cycle (40 cycles at
L = 64, about 2.5 L/R), restarting even when no data is arriving. A frame that arrives out of
step with it waits inside the transposer for the cycle to come round; every later stage is shifted by
the same amount. So an isolated frame’s latency spreads over a range set by its arrival phase – 105
to 123 cycles of processing at L = 64, 1908 to 2304 at L = 1024. Back to back, frames stay in
step and the interval is exact. The first frame after reset is in step by construction, and is the
fastest frame there is.
The numbers
The arithmetic is modelled bit-exactly (waveflow.vitis_l1.fft, one vectorized pass per stage).
Precision is lost in exactly one place: the inter-stage twiddle rotation, which truncates each
partial product into the first operand’s format. Everything else grows: each stage’s two adder
levels add a bit, so the output is wider than the input –
OUTPUT_WL = in_W + log2(L) + 1 # ap_fixed<16,2> in, L = 1024 -> ap_fixed<27,13> out
VitisFft derives the output format by asking the model what it produced, and the C++ body
static_asserts the same width against the vendor’s own type.
What Waveflow adds
| the bits | waveflow.vitis_l1.fft, bit-exact against the library |
| the module | VitisFft – ports, parameters, run_iter, kernel_task |
| the C++ | waveflow/build/vitis_fft_task.h, copied into the build, not generated |
| the timing and resources | calibrated on waveflow/calib/platforms/rfsoc4x2_bfm_250mhz |
| the evidence | tests/vitis_l1/fft/, and the XSI gates of examples/vitis_fft |
The pages in this section:
- Parameters – constructing a
VitisFft, and every parameter. - Interfaces – the
R-wide port group, the word packing, and wiring it. - Including it in your design – the build steps, and where every file goes.
- Synthesizing a Vitis L1 block – why the body is copied rather than generated.
- Latency and II for a vendor block – the timing model and its calibration.
Table of contents
- FFT parameters - Constructing a VitisFft and every parameter it takes: the build-time HwParams that become C++ template arguments (L, R, the input and twiddle widths), the scaling mode and output order (template arguments too, but plain enum fields), and the timing fields (explicit cycles, or a calibrated platform). What it derives (the output format, the stage count, the ports) and what it refuses.
- FFT interfaces - VitisFft's ports: an R-wide AXI-Stream port group, R slaves in and R masters out, one complex sample per word with the real part in the low bits. The lane layout (sample n on lane n % R), the word widths (the output is wider than the input), how frames are delimited, how to wire the group with StreamIFs in Python, and the C++ signature the generated top calls.
- Including the FFT in your design - The build steps that put a VitisFft into a synthesized design, and where every file goes: the body copied from waveflow/build into your include/ by VitisL1Step, the vendor headers left in the Vitis install and reached by an include path, the generated top and its tcl in gen/, the RTL file list and ROM data in xsi/. Covers the FFT as a design's top and as a child of your own composite, and the reference build in waveflow/vitis_l1/rtl.py.
- Synthesizing a Vitis L1 block - How a Waveflow design ends up calling xf::dsp::fft::fft<> itself: kernel_task() hands the body over, VitisL1Step copies a hand-written header rather than generating one, and render_tcl(include_dirs=...) gives the build an include path to the vendor headers, which are never copied. Covers why the body is an adapter (the vendor wants an array of streams, Waveflow supplies separate ones), why OUT_W is a template argument, how composite_top_spec generates the free-running top (per-port widths, eight template arguments), the measured RTL result, and the path traps that present as a SIGSEGV or as missing headers.
- Latency and II for a vendor block - A bit-exact model predicts what comes out, not when. This page covers why a vendor FFT needs two timing numbers rather than one (latency and initiation interval), why a single sequential run_iter cannot express both, how VitisFft models it with run_iter plus a deferred write (SimObj.call_after) bounded by in-flight slots, and what the synthesized hardware actually measured — 45 and 46 cycles at L=16, meaning no frame overlap, against a plan estimate that would have promised six frames in flight. Also why C-synthesis cannot supply these numbers at all.