arXiv:2608.26206cs.ARAug 2026

Manuscript Offprint

arXiv:2608.26206

Ankhdjet: An Open-Source Compiler for Mask-Programmed Ternary Compute-in-ROM on an Open PDK

Mohnish Pai

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Mohnish Pai

Independent Researcher

mohnishpai7@gmail.com

Abstract—Large-language-model inference is dominated by weight movement: every generated token re-reads every weight. Ternary quantization (BitNet b1.58) shrinks each weight to 1.58 bits with reported quality parity at the 2B-parameter scale, small enough that hardwiring the weights into a read-only mask becomes a plausible implementation, and a commercial chip (Taalas HC1) has validated hardwired weights on an advanced node behind closed tooling. This paper asks whether model-specific silicon can be made reproducible with entirely open infrastructure. We present Ankhdjet, an open-source compiler that lowers a HuggingFace ternary checkpoint (BitNet b1.58 and its kin) to a via-mask program of a fixed compute-in-ROM macro on the open SKY130 process design kit, verified end to end with open tools. We defend two claims: (1) the first open-source weights-to-mask compute-in-ROM compiler on a fabricable open PDK, taken through full open-toolchain signoff (KLayout DRC zero, netgen LVS zero, clean timing) twice with two different weight matrices through an identical flow in which only the mask differs; and (2) the first compute-in-ROM macro submitted for fabrication on an open PDK (TinyTapeout/ChipFoundry SKY130 shuttle ttsky26c, 2026 submission, silicon expected 2027). The compiler's read is fully digital: full-swing bitline sampling into standard cells, so the emission ports to any node by synthesis; an analog comparator readout of the same machine is retained as a measured variant. We report the comparison at every scale the artifacts allow: the digital readout replaces the analog sense function at one eighth the area; the same chip, on the same die and read contract, is signed off in both readout styles through the identical flow, with the digital chip measuring cleaner under the same rule engine; and a compiler-emitted digital tile carrying the same mask program as the analog vehicle makes the fabrication pair a controlled readout-style experiment awaiting silicon. We additionally report the per-level adversarial verification methodology that caught three DRC-invisible silent shorts, a negative result on storing two ternary weights per transistor at 130 nm, and an analysis of which analog sense techniques survive at which process nodes. Read energy is reported from extracted-parasitic simulation (0.98–1.73 pJ per sensed weight across corners); no energy measurements are claimed, and the fabricated vehicles are demonstrators.

Index Terms—compute-in-memory, mask ROM, ternary neural networks, BitNet, open-source EDA, SKY130, hardware compilers

I. INTRODUCTION

Autoregressive inference of a large language model re-reads the entire weight set once per generated token. At edge batch sizes there is no reuse to hide this behind: the working set is the model, and the energy and latency of a token are set by how far the weights have to travel. Software runtimes for ternary models push this wall back on CPUs [1], and FPGA accelerators specialize the datapath around it [2], but as long as the weights live in DRAM or even on-chip SRAM, every token pays to move them.

Ternary quantization changes what is worth building. BitNet b1.58 trains weights directly into {−1,0,+1}\{-1, 0, +1\} with per-tensor scales [3], and the 2B-parameter BitNet b1.58 2B4T release reports quality comparable to full-precision peers of similar size [4]. At 1.58 bits per weight, two things become true at once. First, a weight is small enough to be a structural choice: one transistor's drain either connects to a positive bitline, to a negative one, or to neither. Second, the multiply disappears: a ternary multiply-accumulate is an add, a subtract, or a skip. Weights that never change can therefore be manufactured rather than stored, in a mask-programmed read-only array that is also the compute fabric.

There is now a commercial proof that hardwiring works at scale: the Taalas HC1 hardwires Llama-3.1-8B on an N6-class node, with a mask-programmable 1T ROM cell array described in the company's patent filing, and a model swap that touches only two metal-layer masks [5]–[8]. The HC1 is closed on every axis that matters for reproducibility: proprietary node, proprietary compiler, no published artifacts. The academic side has the opposite gap: BitROM, the closest published architecture, evaluates ternary compute-in-ROM at 65 nm in layout only, with no compiler and no silicon [9].

This paper answers the question left between those two points: can an open compiler, an open and fabricable PDK, and an open verification toolchain make model-specific silicon a reproducible artifact, one that anyone can regenerate from a checkpoint, re-verify, and submit to a foundry shuttle? We present Ankhdjet, an open-source compiler that hardwires ternary weights into compute-in-ROM (CiROM) macros on the SkyWater SKY130 open PDK [10], carried through full physical signoff with open tools only (Magic, KLayout, netgen, ngspice, Yosys, OpenROAD, LibreLane) [11]–[17]. One framing choice governs the paper: ternary deletes the multiplier, so the machine is digital in every variant (a ternary multiply-accumulate is an add, a subtract, or a skip), and what the compiler actually emits is one of two readout tiers of the same architecture. The analog tier reads a precharged bitline with a clocked comparator against a shared reference; the digital tier samples the full-swing bitline into a flop. Which tier wins is an empirical question this paper measures where it can (Section VII) and otherwise leaves to the fabricated instruments.

We defend exactly two novelty claims, scoped precisely in Section II:

  1. The first open-source weights-to-mask CiROM compiler on a fabricable open PDK. A HuggingFace ternary checkpoint (BitNet b1.58 and its kin) lowers to a ternary intermediate representation and then to a via-mask program of a fixed, pre-verified macro. The flow reaches full open-toolchain signoff: KLayout DRC zero, netgen LVS zero, clean static timing. It has done so twice, with two different weight matrices, through byte-identical configuration in which only the mask differs; and it has done so in both readout styles: the same die and read contract sign off with full-swing digital sampling and with the analog comparator bands, the digital chip measuring cleaner under the same rule engine.

  2. The first CiROM macro submitted for fabrication on an open PDK. The test vehicles tt_um_darga_cirom (fully digital readout, matrix-vector products computed on die) and tt_um_azara_cirom (the analog-readout characterization instrument) target the TinyTapeout/ChipFoundry SKY130 shuttle ttsky26c (2026 submission window), with silicon expected in 2027; they carry the same mask program.

Four further contributions support the claims. First, a verification methodology (Section V): every hand-assembled structure is flat-extracted and compared against its own generated transistor-level schematic, a discipline that caught three silent, DRC-legal shorts that chip-level signoff structurally cannot see. Second, a measured readout-tier comparison (Section VII): on the same signed-off implementation, the digital sampler replaces the analog sense function at one eighth the area, the comparators dominate the simulated read energy, and a compiler-emitted digital tile carrying the same mask program as the analog vehicle is hardened through the identical flow, and the full chip is additionally signed off in both readout styles on the same die; the analog tier's remaining advantage is stated as an explicit hypothesis with its test. Third, a negative result (Section VIII): BitROM's two-ternary-weights-per-transistor cell does not port economically to 130 nm; we give a topological disproof for one variant and a measured rail-droop argument for the other, and we bound the node window in which the technique pays. Fourth, a node-handoff analysis (Section IX): the analog techniques in this design (offset oversizing, multi-level sensing, charge-domain binary read) each expire at a different process node, and we map which crossings change the architecture rather than merely the layout.

Throughout, numbers are reported with their provenance. Silicon-flow numbers come from signoff runs of record; simulation numbers name the corner and the extraction level; estimator numbers are labeled as calibrated model estimates. Energy and power appear only as extracted-parasitic simulation and labeled vectorless reports (Section VI-F); nothing is measured, and no efficiency victory over measured silicon is claimed.

References (38)