The ram-headed god shaped every being on his potter's wheel. This Khnum shapes every memory your silicon needs โ on a laptop.
A zero-dependency, laptop-class generator of verified SRAM, register-file, FIFO and ECC-protected memories โ each instance shipped with its own self-checking testbench, manifest, embedded formal proof, and a proven path to both FPGA and ASIC.
Most designs don't need a hand-crafted 6T bitcell macro from a seven-figure PDK toolchain. They need correct, verified, portable memories today โ SRAMs, register files, FIFOs, ECC โ that synthesize to real BRAM on FPGA and harden to real standard-cell layouts through OpenROAD on ASIC, backed by proofs instead of promises.
Honesty is the brand: a checked roadmap box that isn't mechanically true destroys the point of the project. Every claim below is backed by a test, a formal proof, or a routed GDSII layout you can inspect yourself.
Every kind ships Verilog-2001 RTL, a self-checking testbench, and a JSON manifest โ from one command.
Plus: transparent --ecc (Hamming SECDED, single-correct/double-detect) on any SRAM kind, and --bank-depth/--bank-width composable tiling into larger arrays.
Every generated instance ships a Verilator-driven TB with a shadow-model scoreboard โ init sweep, random phase, final sweep.
Read-first (incl. per-byte-lane), FIFO occupancy and gray-pointer-validity properties โ 9 configs proven, vacuity-checked and mutation-tested.
Independent Python golden models vs. Verilator sim for all 6 kinds โ a verification path distinct from both the Verilog TB and the formal proofs.
All 3 SRAM kinds ร byte-en on/off genuinely infer RAMB18E1/RAMB36E1 (Xilinx) and SB_RAM40_4K (iCE40) โ 12/12 proven via synth_xilinx/synth_ice40, not just asserted.
DFFRAM-style standard-cell hardening through OpenROAD/ORFS, tuned to stay laptop-safe. Two sizes hardened so far:
| design | platform | area (ยตmยฒ) | util | WNS (ns) | route DRC | peak RAM | status |
|---|---|---|---|---|---|---|---|
khnum_sram_1rw_256x32 | sky130hd | 374,736 | 43% | 0.00 | 0 viol | 2.17 GB | โ timing closed |
khnum_sram_1rw_1024x32 | sky130hd | 1,572,503 | 25% | -0.39 | 0 viol | 8.19 GB | ๐ง routes clean, retuning |
Full numbers, gotchas, and the exact recipes: harden/HARDEN_RESULTS.md.
Every phase ends with a checkpoint commit; nothing advances until tools/test_all.py exits 0. A "partial" is never checked as "done."
| Khnum | OpenRAM | DFFRAM | |
|---|---|---|---|
| Dependencies | zero (Python stdlib) | Python + packages + PDK setup | Python + packages |
| Self-checking TB per instance | โ always, automatically | partial | โ |
| Formal proof per instance | โ yosys-smtbmc + z3, vacuity + mutation checked | โ | โ |
| FPGA + ASIC from one config | โ portable RTL, BRAM-inference verified | ASIC only | ASIC only |
| Runs on a 16 GB laptop | โ hard design constraint | heavy | moderate |