Inside Architecture · the slice and the word Vol. 32

Architecture

The bit-slice is a logic plane. The adder is the wire through it.

Fetch, IR, ALU, and register operands are 32-bit. Per nibble: two independent 3-input LUTs plus a ripple adder. The opcode ROM names a practical subset. Dark silicon stays in the catalogs.

Tomato started at the transistor — an 8-bit ALU from 3,488 MOSFETs — and kept climbing: gates, slices, boards, a CPU that can speak dozens of foreign ISAs while remaining one physical machine underneath. Most CPUs hide a small ALU behind a conventional encoding. This one flipped it.

The dual-LUT slice is the center. Matching every LUT pair to its own instruction was never the goal. The 512-row ROM burns what programs need today; the rest of the plane waits.

alu_out = adder( f(a, b, c), g(a, b, c), carry_in )

Dual-LUT nibble: f and g into an adder with carry-in.

Fig. — The nibbleLUT3 feeds the adder. No mode mux at the end of the slice.

The word

Typical packing for ALU register ops. Low bits are often double-booked as immediate or branch overlay, depending on the mnemonic.

9bopcode 5brd 5brA 5brB 5brC 3bbank
FieldBitsSliceRole
Opcode9[31:23]Indexes the 512-row microcode ROM
rd5[22:18]Destination within the selected bank
rA / rB / rC5 each[17:3]ALU operands; rB also imm-high
BANK3[2:0]Bank select · COND · jump mode

Native ALU syntax, conceptual: opcode rd, rA, rB, rC — destination is f + g + cin. Thirty-two GPR times eight banks is 256 addressable registers — enough to wire without widening the datapath.

Decode travels with the board

One central microcode blob is elegant in simulation and miserable on a breadboard. Tomato split decode into small boards with local EEPROMs. They all listen to the same opcode from the IR. Each sits next to the hardware it drives.

Digital schematic of Tomato main: control boards and datapath.

Fig. — main.digalu-control, ir-reg, mem-io, mem-bus, pc, shift-mul

Three facts that do not move

I. Opcode

Nine bits. 512 rows.

Fifty-one burns. The rest are nops — not growth phantoms. See the ISA sheet.

II. Registers

32 GPR × 8 banks.

256 names you can spill to and wire on modular boards. The LUT catalog could name more. We did not.

III. Authority

Digital, then copper, then ROM.

.dig for logic. KiCad for boards. tomato.v1.csv for the opcode. Exported Verilog is read-only.

Classified · boards 01–08

It started as a 270 millimetre transistor board. It is now copper in the mail.

1 of 8 lots in copper · 1 set aside · 6 still on the screen

Routed top copper of 07_alu.
Fig. — Top copper07_alu · DRC clean
KiCad schematic sheet from 07_alu.
Fig. — SchematicCopper authority

ALU sign-off · not the whole CPU

5 / 5

Formal · SymbiYosys


Pass

Documented jobs only. Assert and cover live in the verification tree.

476

Directed · golden


All matched

Against the unified ALU reference. Not toggle coverage. Not “100% CPU.”

8 MHz

FPGA analysis


Honest constraint

Bitstream closed. Board oscillator is 100. The timing we claimed is the timing we closed.