
A radar processing chain in an FPGA can pass simulation, show sensible range-Doppler maps on the bench, and still be wrong in ways that only appear with the wrong input. The check that settles it is bit-exact: stop the board on one frame, read the output of every stage, run the same input through a model that reproduces the hardware’s arithmetic exactly, and require every value to match. Anything short of exact equality needs a tolerance, and a tolerance hides real bugs: with a window ROM read one address late, the largest change is 50 dB below the peak, well inside a 1 % tolerance.
Why simulation and a good-looking plot are not enough
A typical FMCW chain, the one described in Radar Principles 21, runs in the FPGA from the ADC interface to a detection list: window and range FFT, a corner turn to slow-time order, the Doppler FFT that builds the range-Doppler map, magnitude and a sum over receive channels, then CFAR. Each block is usually simulated on its own. The bugs that survive are the ones between blocks and in the corners of the arithmetic: a scaling shift applied in the wrong place, an address counter that starts at 1, a field in your own control register that the RTL and its documentation interpret differently, a list that silently stops at its maximum length.
On the bench these produce plots that look almost right. A target is still a peak; noise still looks like noise. Comparing with a floating-point MATLAB or Python reference does not settle it either, because the fixed-point output never equals the float output, so the comparison needs a tolerance, and the bugs above fit inside one.

The float comparison is still useful, once, to choose word lengths and scaling: it tells you whether the fixed-point design is accurate enough. It cannot tell you whether the hardware implements that design. That is a separate question, and it has an exact answer.
Taps, a frozen frame and a bit-accurate model

1. Taps
Each stage’s output has to be readable. In a chain built around DMA and external memory most of them already are: the raw ADC frame, the range cube and the Doppler cube sit in DDR between stages. Where a stage streams straight into the next one, add a debug copy to memory behind a register bit. The extra memory traffic only exists while you verify.
2. A frozen frame
The taps are overwritten by the next frame, so the frame has to be stopped. The least intrusive way is a hardware breakpoint in the processor code at the point where one frame is finished, for example where it sends its results. When the breakpoint hits, read every tap and a snapshot of the control registers over JTAG, then let the board run on. Apart from any debug copies, which stay in the shipped design, nothing changes and nothing is written to flash, so the board under test is the board that will ship.
3. A model that does what the hardware does
The model takes the raw ADC tap T0 as its input and reproduces the hardware’s arithmetic step by step:
- Window: read the coefficients from the same ROM initialisation file the FPGA uses, not from a window function.
- FFT: use the vendor’s bit-accurate model of the FFT core where one exists (AMD supplies a C model for its FFT core), configured with the same point size, data and twiddle widths, rounding mode and scaling schedule as the hardware. If the FFT is your own RTL, the model is a fixed-point implementation with the same butterfly order and rounding.
- Corner turn: the same index mapping, including any tiling.
- Magnitude: the same algorithm. A CORDIC magnitude, an alpha-max-plus-beta approximation and a true square root give different integers.
- CFAR: two references are better than one. Run the CFAR RTL in the HDL simulator on the RD map taken from the board, and run an independent software model of the same CFAR. If all three agree, the CFAR RTL matches its specification.
Then compare. Every value at every tap must be identical. A single differing integer is a finding, and its position tells you where to look: the first tap that differs is the stage with the bug.
Reading taps over JTAG: what to record with each capture
- The bitstream and the software build that produced it, with dates or hashes.
- The register snapshot at the breakpoint: waveform, FFT sizes, window and scaling settings, CFAR parameters.
- Memory addresses and sizes of each tap, and the sample order inside it.
- The input type (test pattern, tone, scene) and how it was switched on.
Store the captures. When the design changes, the same captures replay through the model and the new board, and a regression check costs minutes.
Four inputs, four questions
| Input | Question it answers | What to look for |
|---|---|---|
| ADC test ramp (counter pattern) | Is the interface right? | Every sample one more than the last on every lane; every bit toggles. A stuck or swapped bit, a slipped word or a dropped sample breaks the ramp at once. |
| A different tone on each channel | Are the channels where they should be? | Each channel’s peak at its own frequency, nothing at the others. Catches swapped or duplicated channels and crosstalk in the data path. |
| Real scene | Does the normal case match? | Exact equality at every tap with realistic data and noise. |
| Near-full-scale tone | Does the arithmetic hold at the limits? | Equality, plus the model’s own overflow check: does any stage exceed its word length? |
The ramp and tones need the ADC’s or the front end’s test-signal modes, which most radar transceivers and ADCs provide; check on the captured data that the pattern actually arrives; on some devices the test mode has to be selected for the interface in use. The real scene is the one most people test with, and it is the one least likely to find corner cases.
What a bit-exact check typically finds
The classes of finding repeat from project to project.
Silent overflow on coherent signals
An FFT’s output can grow by a factor of N for a pure tone but only √N for noise. A scaling schedule chosen on noise-like data, here a one-bit shift on only half of the 10 stages, works on real scenes and wraps around on a strong tone. With wrap-around arithmetic the result is not clipped but garbage spread over the whole spectrum, and a typical FFT core reports it only if its overflow output is enabled and someone reads it.

The bit-exact model finds it because the model wraps the same way, so board and model agree, and the model’s own range check reports the overflow. The fix is a more conservative schedule, block floating point, or saturation plus a status bit that firmware reads every frame. Decide which inputs must never overflow and test with them.
Off-by-one in address and parameter fields
A window read one address late, a guard band that is one cell wider than the register says, a range bin count that keeps one bin too many. In the window example the largest error is 50 dB below the peak, well below any tolerance a float comparison would use, and only an exact comparison sees it.

Parameter fields deserve their own line in the check: compare what the register snapshot says with what the RTL actually did, and update the document or the RTL so they agree.
Limits that only show in busy scenes
Detection lists have a maximum length, and a CFAR in a cluttered frame can fill it. Whether the hardware truncates, wraps or drops the frame, the model should do the same and the firmware should know the list was full. The same applies to FIFOs and DMA descriptors sized for typical frames.
When to run it
Run the full check once after bring-up, then on every change to the bitstream, the FFT configuration or the processing parameters. Keep the captures from the first run as fixtures. A chain that has passed bit-exact at every tap leaves only the algorithm itself to argue about, which is where the effort should go.
We use this approach for radar processing on FPGA and SoC boards; if you need a chain designed, ported or verified, see DSP IP and embedded software development or send the details below.
FAQ
Isn’t RTL simulation with a testbench enough?
It is necessary, but it tests the RTL with the stimulus you thought of, in a simulator. The on-board check tests the bitstream that is actually running, with the real interface, memory layout, register settings and input. Most of the bugs it finds are in how blocks were configured and connected.
What if the FFT core has no bit-accurate model?
Write a fixed-point model of the core’s documented arithmetic and verify it against the core in simulation first, with random inputs, until it matches exactly. Then use it on the board.
Can I compare only the final detection list?
You can, but a mismatch then says nothing about where the error is, and many errors do not change the list for the frames you happen to capture. Comparing every tap localises the fault to one stage.
Does halting the processor disturb the capture?
Not if the breakpoint sits after the frame is complete and before the next one is started. Check that the hardware is not already writing the next frame into the same buffers, and add a frame counter to the register snapshot to confirm what you read.
Sources and method
- AMD, Fast Fourier Transform LogiCORE IP Product Guide (PG109): scaling schedules, overflow output and the bit-accurate C model.
- R. G. Lyons, Understanding Digital Signal Processing, 3rd ed., Prentice Hall, 2011: fixed-point FFT growth and scaling.
- M. A. Richards, Fundamentals of Radar Signal Processing, 2nd ed., McGraw-Hill, 2014: range-Doppler processing and CFAR.
Method: the figures come from a Python model of a 1024-point radix-2 decimation-in-time FFT with a configurable data-path width, 16-bit twiddles, rounding and two’s-complement wrap on overflow, fed with a 12-bit input placed in the top bits of the data path. Signal-to-error ratios compare the model’s output with a double-precision FFT of the same integers. The window case uses a Hann window stored as 16-bit integers and read one address late. These are illustrations of the method; they are not measurements of a particular FFT core.
