Pipelined NTT Butterfly for CKKS
A pipelined modular butterfly for the number-theoretic transform in CKKS homomorphic encryption, taken from verified RTL through synthesis, place-and-route and signoff.
My contribution
I designed, verified and implemented the whole block alone: SystemVerilog RTL, 7,000+ cocotb test vectors, Genus synthesis and Innovus place-and-route to signoff at 4 ns.
- Affiliation
- Independent project
- Dates
- 2026
- Role
- Solo designer
- Topics
- RTL and Physical Design, Computer Architecture
- Tools
- SystemVerilog, cocotb, Cadence Genus, Cadence Innovus 23.1
Contents
01
The problem
The number-theoretic transform (NTT) is the bottleneck in CKKS homomorphic encryption, and the modular multiplier inside it sets the clock frequency. I built the NTT's basic hardware unit, a radix-2 Cooley-Tukey butterfly around a pipelined Montgomery multiplier, and took it from RTL through synthesis on a real 45 nm library to find where it breaks.
02
My contribution
Solo personal project in SystemVerilog, extending my SAFARI homomorphic-encryption work from in-memory data movement into arithmetic hardware. I designed and verified the RTL, adapted my 18-622 digital IC course flow to this design, wrote a new synthesis script, and ran Cadence Genus synthesis and Innovus place-and-route through signoff myself on the CMU ECE servers.
03
Constraints
32-bit data with a fixed modulus Q = 3 × 2^30 + 1 and Montgomery radix 2^32. Synthesis used Cadence's 45 nm GPDK at the slow corner (0.9 V, 125 °C) with the course flow's boundary conditions: 0.1 ns input and output delay, BUFX2 input drivers, 25 fF output loads, 0.05 ns clock uncertainty and 0.14 ns max transition. Low-Vt cells stayed disabled to keep leakage down. Place-and-route ran in Innovus 23.1 at a 4 ns clock (250 MHz).
04
Design decisions
Montgomery reduction replaces a hardware divider with constant multiplies and a shift. Q = 3 × 2^30 + 1 is prime, supports NTTs up to n = 2^30, and is sparse in binary, so its constant multiplies become a few shifts and adds. Four pipeline stages hold at most one expensive operation each (multiply, low-half multiply, add and shift, one conditional subtract), at the cost of 4 cycles of latency and 421 flip-flops. A 4-deep delay line keeps the a input aligned with the multiplier output, and 33-bit intermediates cover a + t reaching 2Q − 2. I stopped at a verified, measured butterfly rather than a half-finished full NTT sequencer. For the clock, I swept the period: 2 ns to find where the design breaks, then 4 ns for a timing-clean netlist going into place-and-route.
05
What was difficult
At a 2 ns clock the design missed setup by 1.44 ns at the slow corner (total negative slack about −69 ns), and every failing path ended in the 32 × 32 multiplier stage. Synthesis sizing and restructuring recovered about 0.5 ns, but the multiply still needs about 3.5 ns, so the fix is architectural: place-and-route can't recover slack the logic doesn't have. I relaxed the clock to 4 ns for place-and-route. There, routing opened two hold violations of 3 ps, which post-route hold optimization fixed. Adapting the course flow also took work. The lab's synthesis script waited for keyboard input and grouped paths by another lab's instance names, so I wrote a new one, and the package file had to be read before the modules that import it.
06
Evidence
Innovus closed timing at 4 ns: at signoff, worst setup slack is +0.036 ns (+0.851 ns register to register) and worst hold slack is +0.009 ns, with all 40 reported paths passing, zero route DRC violations and no congestion overflow. The signed-off block has 4,679 instances in about 12,500 µm² at 56% density, with about 76,100 µm of routed wire. Total power is 3.10 mW at 250 MHz (1.81 mW internal, 1.28 mW switching, 4.6 µW leakage), about 12.4 pJ per butterfly. That is a static, vectorless estimate assuming a 20% toggle rate at the fast corner (1.32 V). Latency is 5 cycles at one result per cycle.
07
Current status
RTL verified in simulation, synthesized in Genus, and placed, routed and signed off in Innovus at 4 ns, with physical verification, a final GDS and a power report. Metal fill is the only remaining step. Nothing was fabricated; this is physical-design signoff, not a tapeout.
08
What I would change next
To reach the 2 ns target, I would split the 32 × 32 multiply across two pipeline stages (partial products in one, the sum in the next) or add a stage and let the tool retime into it, and register the inputs so external input delay stops adding to the multiplier path. I would also run signoff at all four corners, measure power with a real NTT activity file instead of the 20% vectorless assumption, check IR drop, add metal fill, and extend the butterfly into a full NTT.
References and context
Background material and tools. Not personal publications.
- CKKS paper (Cheon, Kim, Kim, Song, ASIACRYPT 2017) — the encryption scheme the butterfly targets
Related work