← All projects

NPU · SKY130 130 nm · Clock gating · Scan DFT · Tiny Tapeout · design complete

One-Tile int4 NPU (2x2 MAC Array) for Tiny Tapeout

A 2×2 int4 multiply-accumulate array with 16-bit accumulators, one clock gate per row and a 96-flop scan chain, taken from RTL to a signed-off layout in a single 161 × 112 µm Tiny Tapeout tile. Built for the TTSKY26d shuttle; the demo board's microcontroller drives it over the pins.

50 MHz with timing met at all 12 corners (−40…100 °C, 1.60–1.95 V). DRC, LVS and antenna clean, Tiny Tapeout precheck 15/15. Clock gating cuts core power by 45–59% (vector-based, pre-silicon estimate).

Source on GitHub 3D layout

3D view of the NPU tile layout
3D view of the routed tile, SKY130 layer stack

Specs

OVERVIEW
Chip
ProcessSkyWater SKY130 (130 nm), sky130_fd_sc_hd cells
ShuttleTiny Tapeout TTSKY26d, deadline 2026-11-30
Area1×1 tile, 161.0 × 111.52 µm = 17,955 µm²
Top modulett_um_akln0401_npu
Clock50 MHz; setup +5.70 ns, hold +0.162 ns over 12 corners (−40…100 °C, 1.60–1.95 V)
Cells1,595 placed (excl. fill): 98 flops, 2 clock gates, 914 logic gates, 321 timing/fanout buffers, 22 clock-tree cells, 225 taps, 13 diodes
Utilization84.4% · 32.8 mm of routing on met1–met4
Power0.19–0.28 mW at 50 MHz, typical corner, depending on the workload (vector-based estimate, see clock gating)
Accelerator
Array2×2 processing elements, signed int4 × int4
Accumulators4 × 16-bit, two's-complement wrap; 511 worst-case steps without overflow
Per step4 MACs in one clock (outer product acc[i][j] += a[i]·b[j])
ThroughputOne register write ≥ 6 clocks, a step needs 3 writes → ≤ 2.8M steps/s (11M MAC/s) at 50 MHz; the host's GPIO speed sets the real rate
Interface8-bit write data, 8-bit read data, 3-bit address, write strobe; 7 registers
Clock gating1 ICG (dlclkp_1) per row; a row's clock runs only on step/clear cycles. Saves 45–59% of core power (see clock gating)
TestFull scan: 96 flops in one chain, uio[6] → uio[7] (only the 2 reset-sync flops are off it)

How it works

OPERATION

The chip is a small matrix-multiply engine. The microcontroller on the Tiny Tapeout demo board acts as the host: it writes operands into the chip over the pins, tells it to step, and reads the results back.

  1. Write a register

    The host puts the address on uio[2:0] and the byte on ui[7:0], then raises the strobe uio[3]. The strobe is synchronized to the chip clock (2 flops) and its rising edge loads the byte.

  2. Load operands

    A0 holds two int4 values a[0], a[1] (one column of A), B0 holds b[0], b[1] (one row of B).

  3. Step

    A CTRL step (or, in auto mode, any B1 write) opens each enabled row's clock gate for exactly one cycle, and all four PEs add a[i]·b[j] to their accumulator. K steps compute a 2×2 block of C = A·B with inner dimension K (up to 511 without overflow).

  4. Read back

    Writing RSEL picks an accumulator and a byte; uo[7:0] then shows that byte. Four reads give the 32-bit sign-extended value.

  5. Sleep between steps

    When nothing is stepping, the row clock gates are closed: the 64 accumulator flops and their clock tree get no clock edges (clock gating).

  6. Test on silicon

    test_mode (uio[4]) forces the clocks on and links all 96 flops into one shift register from uio[6] to uio[7], so any internal state can be loaded and read out on the bench (scan chain).

Layout: GDS and 3D model

LIBRELANE 3.0.14

The final GDS from the place-and-route run, rendered with KLayout. It has 39 rows of standard cells (2.72 µm each). The tile's 4 pairs of vertical met4 power stripes cross the whole tile, and the 43 signal pins sit on the top edge, where the Tiny Tapeout mux connects them.

Final GDS of the tile, all layers, SKY130 KLayout colours

Whole tile, all layers, SKY130 colours. Fine texture: standard cells. Line grid: met1–met4 routing and power.

Routing layers only on a dark background

Routing only: met1 blue, met2 red, met3 green, met4 orange; white = met4 power stripes and pins.

Interactive 3D model

The same GDS as a 3D model. Each layer is extruded at its height in the SKY130 stack (heights are exaggerated, ×4 by default; use the slider). Click to interact: drag to rotate, right-drag or shift-drag to pan, wheel or pinch to zoom; ⤢ goes full screen. The Metal preset hides the transistor layers, Cells shows only them.

174,710 shapes in 13 layers (diff, tap, poly, licon, li1, mcon, met1, via, met2, via2, met3, via3, met4), drawn with WebGL2; browsers without WebGL2 show a still image.

3D close-up of the routing layers

Close-up: met4 power stripes (orange) on top, met3 (green) straps and signals, met2 (red) and met1 (blue) routing below, with the via stacks (grey) between them.

Tapeout

SIGNOFF

Signoff on the final layout. The local flow is the same as Tiny Tapeout's GitHub gds action (tt-support-tools + LibreLane 3.0.14), and the precheck is the same set of checks the shuttle runs.

CheckResultEvidence
Physical: Magic DRC, LVS, antenna, routing DRC (flow)0 / 0 / 0 / 0LibreLane signoff
TT precheck: Magic + KLayout DRC (FEOL, BEOL, off-grid), pins, boundary, power, layers15 / 15same checks as the shuttle
Setup, 12 corners+5.70 ns worst at ss, −40 °C, 1.60 V0 violations
Hold, 12 corners+0.162 ns worst at ff, −40 °C, 1.95 V0 violations
Max slew / max cap10 / 0 slew ≤ 0.84 ns vs 0.75 limit, cold slow corner onlyon the read-mux select nets, not a clock or critical path; already in the timing numbers
Power grid, IR drop0 violations, worst drop 0.07 mVLibreLane signoff
RTL simulation (cocotb, through the pins)17 / 17test/: incl. all 256 int4 operand pairs on every MAC unit and exact 16-bit overflow boundaries
Gate-level simulation of the PnR netlist17 / 17same tests, also in CI
Gate level with SDF delays at 50 MHz (ss −40 °C, ss 100 °C, tt, ff −40 °C)8 / 8 eachtest/extra/sdf/
RTL vs. netlist random co-simulation, every output every cycle0 mismatches, 20M cycles + 6M with SDF at 3 cornerstest/extra/cosim/; 3 planted RTL bugs all caught

System

ARCHITECTURE

The microcontroller writes operand bytes and commands over a small register bus, the chip does all four multiply-accumulates in one clock, and the host reads accumulators back one byte at a time through RSEL.

Host MCU RP2040 / RP2350 on the demo board tt_um_akln0401_npu · 1×1 tile ui[7:0]uio[2:0]uio[3] uio[4:6]uo[7:0]uio[7] Pin interface strobe sync + edge detect A / B operand regs CTRL: clear, step, auto ROWEN mask, RSEL step_q / clear_q (registered) test_mode · scan_en · scan_in MAC array (2 × 2) ICG PE 0,0 PE 0,1 ICG PE 1,0 PE 1,1 one gated clock per row · int4 × int4 → 16-bit accumulator step a, b read mux (RSEL) → byte scan_out

Data path (heavy lines), register bus (thin lines), scan chain (dashed lines). uio_oe is fixed at 0x80: only uio[7] is an output, driven 0 unless test_mode.

Register map

INTERFACE

Write-only registers, 3-bit address on uio[2:0]. Operands are signed int4 (−8…7), two per byte.

AddrNameBitsReset
0A0a[0] = [3:0], a[1] = [7:4]0
1A1unused (rows 2–3 do not exist in the 2×2 array)0
2B0b[0] = [3:0], b[1] = [7:4]0
3B1data unused (2×2 array); the write steps the array if CTRL.auto is set0
4CTRL[0] clear all accumulators · [1] step · [2] auto (sticky). Clear beats step in the same writeauto = 0
5ROWEN[1:0] row enable; a disabled row's clock stopsall 1
6RSEL[7] = 0: uo = byte [5:4] of accumulator [3:0] (index 2·i + j, sign-extended to 32 bit) · [7] = 1: uo = ID byte [1:0]0x00
7—reserved

ID bytes: 4E 22 10 01 = 'N', 2×2 array, 16-bit accumulators, version 1. Reset clears every accumulator and the A/B operand registers.

MAC array

DATAPATH

One step is an outer product: for every enabled row i and every column j, acc[i][j] += a[i] · b[j]. A matrix product C = A·B with inner dimension K is K steps, each loading one column of A and one row of B.

// npu_pe.v — one MAC unit, clocked by its row's gated clockif (scan_en)    acc <= {acc[ACC_W-2:0], scan_in};else if (clear) acc <= 0;else if (step)  acc <= acc + sign_extend(a * b);   // int4 × int4 → 8-bit product

Accumulator width: 16 bit

511 worst-case steps

The largest product is −8·−8 = 64. 16-bit accumulators (max 32,767) take 511 worst-case steps, so a whole 64-input dot product (8×8 digit image) fits in one pass; 12-bit would have allowed only 31 (the host would have to split K). Overflow wraps (two's complement).

Clock gating

LOW POWER

Each row has one sky130_fd_sc_hd__dlclkp_1 integrated clock gate (wrapper src/dft/clk_gate.v). The latch is transparent while clk is low, so the enable can't glitch the gated clock.

// functional enableen[i] = (step_q && !scan_en && row_en[i]) || clear_q || !rstn// test mode forces the clock onGATE  = en[i] || test_mode

A row's accumulators and their clock tree toggle only on the cycle after a step or clear. Between steps the host is busy writing operands for dozens of chip clocks, so the array is idle almost all the time. The cocotb test counts the edges of each row's gated clock: for every ROWEN mask, 3 steps give 3 edges on an enabled row and 0 on a disabled one, and test mode keeps both clocks running.

Power saved: vector-based estimate

To find out what the clock gates buy, the post-PnR netlist was simulated running real workloads, and its switching activity went into the signoff timer's power engine with the routed parasitics. Each workload ran twice with identical bus traffic: once normally, and once with test_mode high, which forces both row clocks on. That second run is the design as it would be without clock gating.

58.6% less core power with the clock gates working while the array waits for the host (idle at 50 MHz, typical corner). Across all four workloads and three corners the saving is 45–59%.

0 100 200 300 400 500 600 700 Core power (µW) Idle, clock gating on: 191 µW 191 Idle, no clock gating: 462 µW 462 Idle −58.6% Slow host, clock gating on: 197 µW 197 Slow host, no clock gating: 467 µW 467 Slow host −57.7% Max bus rate, clock gating on: 277 µW 277 Max bus rate, no clock gating: 534 µW 534 Max bus rate −48.2% Max bus rate, row 1 off, clock gating on: 260 µW 260 Max bus rate, row 1 off, no clock gating: 524 µW 524 Max bus rate, row 1 off −50.3% clock gating on no clock gating

Core power at the typical corner (tt, 25 °C, 1.80 V), 50 MHz, 400 µs per run. Activity from unit-delay gate-level simulation; all 4,546 pins annotated.

Table: every workload at three corners
WorkloadCornerGating onNo gatingSaved
Idlett 25 °C 1.80 V191.3 µW461.5 µW270.2 µW (58.6%)
Idleff −40 °C 1.95 V220.6 µW532.5 µW312.0 µW (58.6%)
Idless −40 °C 1.60 V146.9 µW354.6 µW207.7 µW (58.6%)
Slow hosttt 25 °C 1.80 V197.4 µW466.7 µW269.3 µW (57.7%)
Slow hostff −40 °C 1.95 V227.5 µW538.4 µW310.9 µW (57.7%)
Slow hostss −40 °C 1.60 V151.7 µW358.7 µW207.0 µW (57.7%)
Max bus ratett 25 °C 1.80 V276.7 µW533.6 µW256.9 µW (48.2%)
Max bus rateff −40 °C 1.95 V316.7 µW613.4 µW296.6 µW (48.4%)
Max bus ratess −40 °C 1.60 V213.0 µW410.6 µW197.5 µW (48.1%)
Max bus rate, row 1 offtt 25 °C 1.80 V260.0 µW523.6 µW263.6 µW (50.3%)
Max bus rate, row 1 offff −40 °C 1.95 V298.0 µW602.3 µW304.3 µW (50.5%)
Max bus rate, row 1 offss −40 °C 1.60 V200.2 µW402.8 µW202.6 µW (50.3%)
Max bus rate, with SDF delays (glitches included)tt 25 °C 1.80 V308.2 µW561.7 µW253.5 µW (45.1%)

Where it comes from

At the maximum bus rate (typical corner) the saving is all clock: the gated branches of the clock tree and the clock pins of the 64 accumulator flops stop toggling between steps. The logic does the same work either way.

GroupGating onNo gatingDifference
Clock tree130.3 µW266.0 µW−135.7 µW
Flops (incl. their clock pins)79.4 µW200.9 µW−121.5 µW
Logic66.9 µW66.7 µW+0.3 µW
Total276.7 µW533.6 µW−256.9 µW

With the gates working, the NPU's power hardly depends on the workload (191 µW idle, 277 µW at the maximum bus rate). What's left is the always-on part: the root of the clock tree and the 34 interface and synchronizer flops. Turning a row off with ROWEN only saves another 17 µW here, because each row's clock is already off about 95% of the time.

Real netlist, real protocol

The post-PnR netlist (the same file the Tiny Tapeout CI builds) is driven through its pins at 50 MHz by a host model that follows the datasheet write protocol, streaming int4 matrix-multiply steps (A0, B0, CTRL step) with fixed-seed random operands.

Same traffic, gating defeated

The baseline repeats the identical stimulus with test_mode high. That forces both clock gates open, while the MAC units still hold through their own step enables. Both runs end with the same accumulator values, so only the clocking differs.

Switching activity

Icarus Verilog dumps every net to a VCD over a 400 µs window. A second run with SDF back-annotated delays adds the glitches that unit-delay simulation misses.

Power analysis

OpenSTA (LibreLane 3.0.14) reads the routed netlist, the extracted SPEF, the sky130 liberty power models and the VCD; all 4,546 pins get their activity from the simulation. The same is repeated at the typical, fast-cold and slow-cold corners.

Reproducible

audit/power/run_power.sh in the repository rebuilds every number on this page.

This is a pre-silicon estimate of this tile's 1.8 V core only (no pads, Tiny Tapeout multiplexer or other projects). The absolute values depend on the liberty models; the gated/ungated ratio is the robust result. On the bench, the same comparison is one pin: run a workload with uio[4] (test_mode) low, then high with uio[5] low, and compare the core current (≈ 0.15 mA difference expected at 1.8 V).

Scan chain

DFT

Mux-D scan in RTL. test_mode (uio[4]) forces all row clocks on and puts scan_out on uio[7]; scan_en (uio[5]) is ANDed with test_mode; scan_in is uio[6]. Every flop is on the chain except the two reset-synchronizer flops, which stay off it so reset remains controllable in test mode.

uio[6] wr_sync3 a_reg8 b_reg8 auto1 row_en2 rsel8 step, clear2 PE 0,016 PE 0,116 PE 1,016 PE 1,116 uio[7] pin interface · 32 flops MAC array, row-major · 64 flops

Chain order from scan_in to scan_out, with the flop count of each field. Every field shifts in LSB first.

Length = 3 + 8 + 8 + 1 + 2 + 8 + 2 + 4 × 16 = 96 flops. The shift test runs through the pins in RTL and on the gate-level netlist; the per-bit map is generated by test/scan_map.py.

Pinout

I/O
PinDirFunction
ui[7:0]inWrite data byte
uo[7:0]outRead byte selected by RSEL (accumulator byte or ID byte)
uio[2:0]inRegister address
uio[3]inWrite strobe, active high (synchronized, acts on its rising edge)
uio[4]intest_mode: row clocks forced on, scan out enabled
uio[5]inscan_en (only with test_mode)
uio[6]inscan_in
uio[7]outscan_out (0 unless test_mode)
ena—unused

Host code

FIRMWARE

Pseudocode for the demo board's microcontroller; set_pins/read_uo stand in for whatever GPIO API the firmware uses (TT MicroPython SDK or C SDK). Strobe timing is in chip clocks: MicroPython is far slower than 4 chip clocks per pin change, but C code writing the GPIO registers directly can toggle in a few ns, so it needs the explicit waits.

A0, A1, B0, B1, CTRL, ROWEN, RSEL = range(7)def wr(addr, data):    set_pins(ui=data, addr=addr, strobe=0)    set_pins(strobe=1)    wait_chip_clocks(4)     # hold addr/data ≥ 4 chip clocks    set_pins(strobe=0)    wait_chip_clocks(2)     # low ≥ 2 chip clocks before the next writedef nib(lo, hi):            # two signed int4 → one byte    return (lo & 0xF) | (hi & 0xF) << 4def read_acc(n):            # 32-bit sign-extended accumulator n = COLS*i + j    v = 0    for byte in range(4):        wr(RSEL, byte << 4 | n)        v |= read_uo() << (8 * byte)    return v - (1 << 32) if v & 0x80000000 else vdef matmul(A, B):           # A: ROWS×K, B: K×COLS, int4 entries    wr(CTRL, 0b101)         # clear + auto-step on B1 writes    for k in range(len(B)): # K up to 511 with 16-bit accumulators        wr(A0, nib(A[0][k], A[1][k]))                  # column k of A        wr(B0, nib(B[k][0], B[k][1]))                  # row k of B        wr(B1, 0)                                      # B1 data unused at 2×2: just steps    return [[read_acc(COLS*i + j) for j in range(COLS)] for i in range(ROWS)]

For the 2×2 array (ROWS = COLS = 2). Without auto mode, step with wr(CTRL, 0b010) instead of the B1 write. The array size can be read from ID byte 1 (wr(RSEL, 0x81) → 0x22).

Next

ROADMAP
  1. Design, verification, layout

    Done: RTL, tests, PnR and local signoff above.

  2. Repository and CI

    Done: public GitHub repo; Tiny Tapeout gds build, precheck and gate-level test pass in CI.

  3. Submit to TTSKY26d

    Next: before 2026-11-30.

  4. Bring-up on silicon

    After fab: ID bytes 4E 22 10 01, scan chain shift, matmuls against a Python reference, clock-gating current with rows on/off.