← All papers
First page of Formally Verified Synthesizable Floating-Point Data Types in ARCH HDL

Formally Verified Synthesizable Floating-Point Data Types in ARCH HDL

Shuqing Zhao

cs.CL Jul 26, 2026 · v1 cs.PL
IEEE-754 FP32/BF16 multiplier-bearing operators (mul, FMA) are proved correctly rounded and bit-exact in sorry-free Lean 4.
We report the design and end-to-end verification of first-class IEEE-754 binary32 (FP32) and bfloat16 (BF16) arithmetic for ARCH, a hardware description language intended to be generated by language models. Every operator - comparisons, conversions, add, sub, mul, and fused multiply-add (FMA) - is described once against a single bit-vector IR and rendered three ways from one source: synthesizable SystemVerilog, an SMT-LIB model, and a Lean 4 proof model. The three artifacts cannot drift apart structurally, and the residual per-node printer correspondence is machine-checked: a Yosys-to-SMT miter proves the emitted SystemVerilog equivalent to the SMT model for all 24 operators. Verification splits at the solver-tractability frontier: multiplier-free operators (comparisons, add/sub over all 2^64 inputs, conversions, and all binary BF16 arithmetic) are proved exhaustively equivalent to the SMT-LIB FloatingPoint theory; the SAT-hard multiplier-bearing operators (FP32 mul and FMA) are proved correctly rounded in Lean, sorry-free, against a value-level round-to-nearest-even specification over exact dyadic values. Physical characterization exposed the FMA as the timing outlier: its exact-wide 470-bit datapath does not pipeline in our flow. We reimplemented it as a bounded 98-bit guard/round/sticky datapath that pipelines to 268 MHz on Nangate45, and proved, in Lean and over all 2^96 inputs, that it is bit-identical to the exact-wide reference, so it inherits the reference's proven correct rounding. The equivalence is tractable precisely because the shared multiplier appears on both sides and cancels: neither a SAT solver nor the proof ever solves a multiplier equivalence. (The BF16 FMA is deliberately an FP32-accumulating fusion, characterized as exactly that.) All machine-checked claims are pinned to a tagged open-source release.

Machine-generated hardware in the ARCH HDL needs first-class IEEE-754 FP32 and BF16 arithmetic that is correctly rounded, synthesizable, and trustworthy. Exhaustive equivalence checking is intractable for multiplier-bearing operators like fused multiply-add, and the exact-wide FMA datapath does not meet timing.

Each operator is defined once against a shared bit-vector IR and rendered into synthesizable SystemVerilog, an SMT-LIB model, and a Lean 4 proof model, so the three cannot drift structurally. Multiplier-free operators are proved exhaustively equivalent to the SMT-LIB FloatingPoint theory via a Yosys-to-SMT miter. Multiplier-bearing FP32 mul and FMA are proved correctly rounded in Lean against a value-level round-to-nearest-even specification. A bounded 98-bit guard/round/sticky FMA is proved bit-identical in Lean to the exact-wide reference over all 2^96 inputs, with the shared multiplier cancelling.

All 24 operators are verified end-to-end sorry-free; the multiplier equivalence is never solved by SAT or the proof. The bounded FMA pipelines to 268 MHz on Nangate45 and inherits the reference's proven correct rounding. The development spans about 9,000 lines across 23 Lean modules.

operatorf_maxcells
FP32 mul2766124
FP32 fma (exact-wide)16019152
FP32 fma (sticky fold, comb)18010805
BF16 fma1854872
FP32 add3202263
Per-operator combinational f_max (MHz) and cell count, Nangate45