Explaining systolic FIR on FPGA using DSP48 slices
The FIR filter maps each tap to a DSP48 slice performing multiply-accumulate using its multiplier and adder, connected in a cascade chain via PCOUT/PCIN for efficient partial sum passing. Pipelining the adder chain by enabling DSP48 internal registers (AREG, BREG, MREG, PREG, PCREG) or inserting extra pipeline stages breaks long combinational paths, boosting frequency at the cost of increased latency. The transposed form suits this systolic array well, with new samples entering each cycle and partial sums flowing through the cascaded DSPs. Symmetric coefficients can leverage pre-adders inside DSP48 to halve multipliers. Overall, this structure maximizes throughput by balancing pipelining latency against high clock rates through DSP48 cascade and register usage.
A finite impulse response filter of order (N!-!1) computes
[
y[n] = \sum_{k=0}^{N-1} h[k]\cdot x[n-k].
]
Two structural forms are commonly used in hardware:
-
In the “direct form” you build an (N)‑deep delay line for (x[n-k]), multiply each tap by (h[k]) and then add all (N) products in a tree.
-
In the “transposed form” you move the adders to the other side of the multipliers. Each coefficient multiplies the current sample, the products are accumulated down a chain, and the delay elements sit on the accumulator path instead of on the input path. The input comes in at one end, the final sum comes out at the other end.
On an FPGA the transposed form maps very naturally to the vendor’s DSP blocks and gives you a “systolic” array: a regular row of multiply–accumulate cells with local, short‑distance connections. Xilinx’ DSP48E/DSP58, for example, contains:
- input registers on the A/B coefficient and X data paths,
- a 25×18 or 27×18 multiplier,
- an adder/accumulator stage, and
- a dedicated cascade bus (PCIN/PCOUT) that lets you feed a running sum into the next slice without going through general routing.
A simple systolic FIR implementation on such a device is to allocate one DSP slice per tap, preload (h[k]) into its A/B inputs, and connect the PCOUT of slice k to the PCIN of slice k+1. On every clock the new sample x[n] is presented to all slices; each slice multiplies x[n] by its coefficient and adds it to the delayed partial sum arriving on PCIN. The necessary sample delays are just the pipeline registers between DSPs. Because the cascade bus is hard‑wired, this structure meets timing much more easily than dragging all of the products into a fabric adder tree.
When you need to run at a very high clock rate, the limiting path in a long FIR is often the adder chain. A single P‑adder feeding the next P‑adder through the cascade creates a combinational path proportional to the number of taps. There are two techniques to mitigate this:
-
Turn on the internal pipeline stages in the DSP48 itself. Xilinx provide separate registers for A, B, M (multiplier output), P (accumulator output) and PCIN. Enabling AREG/BREG/MREG/PREG/PCREG breaks up the multiplier–adder path into several short stages. The synthesis tools will also infer the use of the cascade pipeline when you set the “number of pipeline stages” on an inferred MAC.
-
For very long filters, insert explicit pipeline stages into the cascade. In Xilinx tools this is done by “cascading in segments”: after, say, every 8–16 DSPs you register the PCOUT before feeding it on to the next segment. That register can be an unused DSP48 configured as a pass‑through, or a fabric register. This breaks the long adder chain into shorter timing islands at the cost of an extra clock of latency at each break.
Both approaches improve the maximum achievable fMAX, but they increase the total latency through the filter. A fully pipelined 64‑tap FIR implemented as a systolic array might have on the order of 64–70 clock cycles of latency from input to output, but it will easily run at several hundred MHz because each combinational path is only a multiplier plus an adder. If latency is critical and throughput is modest, you can reduce or remove these pipeline stages and accept a lower clock frequency.
Modern toolflows encapsulate these trade‑offs in IP cores: the Xilinx FIR Compiler, for instance, will map a symmetric FIR to half as many DSP48s using the pre‑adder, will choose transposed form with DSP48 cascade, and lets you specify the number of “adder chain” pipelines to meet your frequency target.