A from-scratch, zero-CPU-compromise, formally verified 4-Core 64-bit Tile-Dataflow + SIMT Compute GPU SoC (λISA-64) with a 6-Stage PipedTileCore, Direct Z3-Verified TileScoreboardCtrl (u_sb) Submodule, 4-Stage Mixed-Precision BF16 × BF16 → FP32 Tensor Core, True Multi-Block Online-Rescaling FlashAttention-2 (4x8, 0.86% rel error vs. IEEE float64, ZERO extra DSPs!), 4-Beat ARLEN=3 64-Byte ARM AXI4 Burst Interconnect (4× fewer ARs!), Universal End-to-End Compiler Correctness Proof (all arcilator C++ Execution (2.527 MHz sim, 40/40 bit-exact!), and 69.88 MHz Real Post-Route Lattice ECP5-85F Timing — built in Lean 4 on lambda-hdl v0.11 (ZERO Sparkle, ZERO sorry, 55 Lean 4 theorems + 10/10 Z3 CEC/BMC/k-Ind + 4/4 Yosys LEC + Verilator + arcilator + Yosys + nextpnr-ecp5 verified).
-
100% Native 64-bit GPU ISA (
λISA-64) — Zero RISC-V/CPU compromise: 4-bit SASS async barrierwaitMask, 2-bitdepBar, 3-bit lane predication, unified operands,V_MAC,V_DP4A,V_SHFL, RDNAS_AND_SAVEEXEC/XOR/OR, full Softmax FlashAttention-2 ML Vector Ops (V_BF16_RELU,V_BF16_MAX,V_FP32_TO_BF16,V_BF16_TO_FP32,V_FP32_MAX,V_BF16_EXP2,V_BF16_RCP,V_BF16_ADD,V_BF16_SUB,V_BF16_MUL),DMA_PUSH(with 4-beatARLEN=364-byte bursts!),W_MMA_I8,W_MMA_BF16,W_MMA_BF16_F32,T_CLEAR,T_MOV, andTILE_SEND. -
6-Stage
PipedTileCore+ 4-Stage FP32 Tensor Core + DirectTileScoreboardCtrl(u_sb) —69.88 MHzPost-Route ECP5-85F! (PipedTileCore.lean, BF16.lean, ScoreboardBMC.lean):-
Real Post-Route Timing Closure: EX0/EX1 split of
bf16Add+ EX0 precompute ofEXP2/RCP/EA, 4-stage Matrix Engine (M0A [TQUEUE Mux] → M0B [Pure FF → MULT18X18D] → M1 [Dual-Path Align + Add/Sub] → M2 [CLZ + Norm + WB]), and parallel-speculative exponent precompute push real post-route 40nm ECP5-85FFmaxto69.88 MHz(5.79 nslogic +8.52 nsrouting, +55.4% faster than v2.2) and cut XilinxABC9mapped LUT depth tolev = 15(avg1.35),levB = 19! -
Zero Model-Extraction Gap:
PipedTileCoredirectly instantiates the Z3-verifiedTileScoreboardCtrl(submod "u_sb" tileScoreboardCtrl) forTQUEUE(Q0/Q1) andW_MMAoccupancy control! -
Two Proved DSP-Sharing Theorems (
bf16MulToFp32_hi16_eq_bf16Mul&bf16MulFromProd_eq_bf16Mul): proved viabv_decideacross all$2^{32}$ inputs — ONE shared 4-wide matrix multiplier array powers BOTHW_MMA_BF16andW_MMA_BF16_F32, AND Stage EX0's existing integer lane multipliers powerV_BF16_MUL, keeping ZERO extra DSPs (48DSP48E1/ 48MULT18X18D)! -
15 true Xilinx Block RAMs (
1 × RAMB36E1+14 × RAMB18E1) vialambda-hdl's explicitMemKind.syncBRAM(9.88× fewer LUTRAMs than Sparkle v1).
-
Real Post-Route Timing Closure: EX0/EX1 split of
-
Full SoC-Ready 4-Core GPU (
LambdaMesh2x2SoC) with 4-BeatARLEN=3AXI4 Bursts (Mesh2x2SoC.lean):- Preserves 14 true hierarchical submodules through CIRCT
firtool 1.163.0AND compiles cleanly to CIRCTarcilatorLLVM IR (29,334lines for the full 4-core SoC,9,138lines forPipedTileCore):4 × (PipedTileCore + TileScoreboardCtrl u_sb)+ Direct 4×4 Hardware Tile NoC +4 × SplitToAXI4Bridge(with 4-beatARLEN=3burst reads!) +1 × AXI4Mux4(unified 128-bit ARM AXI4 DRAM Master) +1 × AXI4LiteCSR(32-bit ARM AXI4-Lite Host Control & Telemetry CSRs with auto-generatedgen/gpu_soc_csr.h). -
72 live RTL
HAssertinvariants checked simultaneously during Verilator simulation!
- Preserves 14 true hierarchical submodules through CIRCT
-
3-Way Independent Bit-Exact Verification & Closed-Loop Formal Soundness:
-
3 Independent Simulators: Lean 4 Golden Oracle ≡ Verilator 5.054 (
80/80PASS) ≡ Native Compiled CIRCTarcilatorLLVM IR (40/40PASS at2.527 MHz sim!). -
55 zero-
sorryLean 4 theorems (Audit.lean), includingcompileGemm4x4_end_to_end_spec(universal end-to-end 16-step matrix-multiply correctness over all$2^{1024}$ 4×4 inputs!) + 5/5 injected GPU bugs rejected at compile time (bug_injection_test.sh). -
Live Z3 CEC + RTL BMC + Unbounded
$k$ -Induction: 10/10 positive Z3 proofsunsat(8 CEC including parallel-speculative BF16/FP32 + 16-cyc RTL BMC + Unbounded$k$ -Induction on liveTileScoreboardCtrl) + 2/2 non-vacuity mutantssat! -
GPU End-to-End Backend LEC (
make lec): provesDirect SV ≡ CIRCT firtool SVvia Yosys 8-cycle pure-I/O miter SAT across 4/4 GPU controller & SoC interconnect modules + 1/1 mutant REJECTED!
-
3 Independent Simulators: Lean 4 Golden Oracle ≡ Verilator 5.054 (
All 20 kernels × {1-cycle DRAM, 50-cycle DRAM} PASS bit-for-bit across CIRCT firtool SV (Verilator, 40/40), Direct SV (Verilator, 40/40), AND Native Compiled CIRCT arcilator LLVM IR (clang++ -O3, 40/40) = 120/120 single-core runs PASS!
- Head-to-Head Simulator Throughput (
make arcilator-bench, 100× 20-Kernel Suite =652,600GPU cycles):- CIRCT
arcilator(clang++ -O3):652,600cycles in258.23 ms→2.527 MHz(2,527.2 kCycles/sec) - Verilator 5.054 (
-O3):652,600cycles in260.36 ms→2.507 MHz(2,506.5 kCycles/sec)
- CIRCT
flash_online_attn_4x8(True Multi-Block Online-Rescaling FlashAttention-2 across 2 × 4×4 K/V blocks):1,456 cyc@ 1c /1,648 cyc@ 50c DRAM (256mixed-precisionW_MMA_BF16_F32MACs + running(m, l, O)SMEM rescaling), independent IEEE-754float64accuracymax|O_hw - O_f64| = 0.0066(0.86%rel)!flash_softmax_attn_4x4(Single-Block Mixed-Precision Online-Softmax FlashAttention-2):536 cyc@ 1c /632 cyc@ 50c DRAM (128mixed-precision MACs), IEEE-754float64max|rowSum(P) - 1| = 0.0159,max|O_hw - O_f64| = 0.0290(1.65%rel)!tileGemm_4x4_wmma(50c DRAM):166 cycvs.matMul_4x4_simt(2,692 cyc) →16.22×faster (AXI4 AR = 2, 4× burst reduction!)latHide_4warp_16w(50c DRAM):223 cycvs.latHide_1warp_16w(688 cyc) →3.09×SIMT latency hidingtiledGemm_4x16x4_2warp_spec(50c DRAM):321 cycvs. 1-warp (504 cyc) →1.57×double-buffered overlap
2. Full 4-Core GPU SoC (LambdaMesh2x2SoC_firtool.sv) — AXI4-Lite Host CSRs + 4-Beat ARLEN=3 128-Bit AXI4 DRAM
Heterogeneous multi-head 4-core workload (Core 0: Q×Kᵀ --NoC--> Core 1: S×V --NoC--> Core 2: O×W_O → DRAM + concurrent Core 3: Live Online-Softmax FlashAttention-2 (BF16 → FP32)) driven purely via ARM AXI4-Lite CSRs over a single shared 128-bit AXI4 DRAM bus with live staggered backpressure:
- 1-Cycle DRAM:
573wall cyc | CSRmma=320,ret=110|AXI4 AR=8(4.0× fewer ARs!),AW=12, W=12, B=12|CoreWr=[0,0,4,8](0 DRAM bytes spilled forS&O!) | 0/72HAssertviolations | PASS - 50-Cycle DRAM:
672wall cyc | CSRmma=320,ret=110|AXI4 AR=8(4.0× fewer ARs!),AW=12, W=12, B=12|CoreWr=[0,0,4,8](0 DRAM bytes spilled!) | 0/72HAssertviolations | PASS
| Metric | Sparkle v1 Unpipelined lambdaTileCore |
lambda-hdl v2.2 (4-Stage) |
lambda-hdl v2.5 (6-Stage) |
lambda-hdl v2.7 (6-Stage + 4-Stage MMA + Speculative BF16/FP32) |
Delta vs. v1 / v2.2 |
|---|---|---|---|---|---|
Xilinx 7-Series LCs (synth_xilinx -family xc7) |
8,867 | 8,873 | 11,501 | 11,900 | Full FP32 Tensor Core + Softmax + u_sb + 4-Beat Burst |
Xilinx DSP48E1 Slices |
112 | 48 | 48 | 48 | 2.33× fewer DSPs (0 extra for FP32 + Softmax!) |
| True Xilinx Block RAMs | 0 | 15 | 15 | 15 (1 RAMB36E1 + 14 RAMB18E1) |
Real BRAMs for IMEM, SGPR, VGPR |
| Distributed LUTRAMs | 1,264 | 128 | 128 | 128 (RAM64X1S) |
9.88× fewer LUTRAMs |
| Flip-Flops / Latches | 1,543 / 0 | 3,755 / 0 | 5,474 / 0 | 5,991 / 0 | 0 latches |
Yosys ABC9 Pre-Map AIG Depth (lev, avg) |
107 (avg 11.15) | 52 (avg 3.43) | 45 (avg 2.64) | 38 (avg 2.35) | 2.82× peak / 4.74× avg shallower than v1! |
Yosys ABC9 Mapped LUT Depth (lev, avg) |
27 (avg 3.33) | 20 (avg 1.69) | 17 (avg 1.48) | 15 (avg 1.35), levB = 19 |
1.80× peak / 2.47× avg shallower than v1! |
Real Post-Route FPGA Fmax (nextpnr-ecp5, ECP5-85F-8) |
— | 44.96 MHz (10.36ns logic) |
54.15 MHz (6.78ns logic) |
69.88 MHz (5.79ns logic + 8.52ns route; 27% LUT4, 8% FF) |
+55.4% vs v2.2 (+29.0% vs v2.5)! |
nix develop
make all # Build Lean + 55 proofs + static check + FIRRTL/SV + CIRCT firtool + Verilator (Core + Mesh + AXI4 Core + Full 4-Core SoC) + 8/8 Z3 CEC + RTL Z3 BMC/k-Ind + 4/4 Yosys LEC + Compiled CIRCT arcilator C++ Execution (40/40) + Axiom Audit + 5/5 Bug-Injection Audit
make arcilator-bench # Run head-to-head 652,600-cycle throughput benchmark: CIRCT arcilator (-O3) vs Verilator 5.054 (-O3)
make yosys # Run Yosys Xilinx 7-series PPA & ABC9 timing comparison (Sparkle v1 vs lambda-hdl v2.7)
make pnr # Run real Lattice ECP5-85F Place-and-Route timing via yosys + nextpnr-ecp5 --freq 80Original project material is available under either the MIT License or the Apache License 2.0, at your option.