Systole

Open-Source LLM Inference Accelerator, Architecture to GDSII

A 128×128 systolic array of 8-bit multiply-add cells with 32-bit sums, fed by a 1 MB scratchpad and a 128 KB accumulator. Beside it sit a Saturn vector unit with 256-bit vector registers, a 64-bit Rocket control core and a 512 KB level-2 cache. Each block was laid out on its own, frozen, then placed and routed into one chip.

19.9 mm²die, 5.1 × 3.9 mm
7 nmpredictive process from Arizona State University
24hardened blocks and memories placed as fixed macros
34.7 Mstandard cells of logic across every block, plus 73 M filler cells
1.28 Mnets routed at the top level, between the blocks
2 clocks1 GHz array side, 500 MHz processor side (targets)
The routed Systole chip. The 128x128 array. One 16x16 cluster. One 4x4 cluster. One multiply-add cell.

Overview

Systole is an accelerator for large language model inference: the part of running a model where it answers, one token at a time. It was taken from the first architecture questions all the way to a routed 7 nm chip layout on open-source tools: hardware generated with Chipyard, laid out with OpenROAD through OpenROAD-flow-scripts, on the ASAP7 predictive 7 nm kit from Arizona State University. ASAP7 is a research kit, so nothing here has been to silicon.

ON THE CHIPGEMMINI ACCELERATORMatrix array128 x 128 multiply-add cellsScratchpadinputs and resultsTransposerrows to columnsLoop unrollersconvolution, matrix multiplyReservation stationcommand queueAddress translation, command decodeRocket control coreruns the generation loopFloat unitData cacheSaturn vector unitsoftmax, norms, activationsLevel-2 cache, busesinterrupts, debug, serial linkOff-chip memorymodel weightsHostprompts in, tokens outAll generated with Chipyard. Saturn shares Rocket's floating-point unit for its multiply-adds.
The blocks and what each one does. The array does the matrix multiplies, the vector unit the math that is not a matrix multiply, and the control core runs the generation loop.

The chip is too large to lay out in one piece on a single 62 GB machine, so it was built from the bottom up: each block taken through the whole flow on its own, frozen, and used as a fixed piece one level higher. Most of this page is about the places where that broke, and what fixed them.

Background, on its own page

How a large language model runs →

New to language models, or want the workload in detail? A separate walkthrough covers tokens, the transformer blocks and the key/value cache, where Llama 3 8B's 8 billion weights sit, and an interactive calculator showing why generating text spends most of its time waiting on memory. Skip it if you are here for the physical design.

Choosing the design

Before any layout, three questions were settled with models of Llama 3 8B's real matrix shapes and a synthesized multiply-add cell: how many conversations to serve at once, how big to make the array, and which number format to compute in. The numbers in this section come from that stage, so they are estimates rather than layout results.

How many conversations at once

Generating each token means reading every weight of the model, 7.1 GB at 8 bits, and using each one only once. With one conversation the chip spends its time waiting on memory: at 1 TB/s that is 144 tokens per second however big the array is. Serving several conversations together shares each read between them.

TOKENS PER SECOND AGAINST BATCH SIZE (LLAMA 3 8B, 8-BIT, 1 TB/S MEMORY)waiting on memorythe array is the limit05001,0001,5002,000148163264128256conversations served together (batch)tokens per secondbatch 32: 2,180 tokens/sbatch 1: 144 tokens/sEvery token reads all7.1 GB of weights.A batch shares each read,so traffic per token fallsfrom 7.1 GB to 0.35 GBat batch 32. Past that,more batch buys nothing.
Modelled for a 128×128 array at 1 GHz. Throughput climbs until batch 32, where the array instead of memory becomes the limit. That is the operating point Systole was designed for.

How big an array

Reading a prompt, before the first token comes out, is the phase that needs raw compute, so the array was sized for it. Larger arrays lose a little efficiency at the edges of each matrix, but much less than they gain in speed.

ARRAY SIZE: TIME TO READ A PROMPT, AND WHAT EACH SIZE COSTStime to process the prompt (whole model)busy cellstrillion operationsper second per mm²area16 x 1620.1 s98.6%46.10.033 mm²32 x 325.11 s97.1%45.40.133 mm²64 x 641.31 s94.3%44.10.531 mm²128 x 1280.35 s89.2%41.72.125 mm²Time bars on a log scale. Throughput per mm² barely moves, so a bigger array costs area in proportion and returns speed in proportion.
128×128 is where the curve bends. Llama 3's attention works on 128-wide blocks, which fill a 128-wide array exactly; a wider array would leave columns idle during attention.

Which number format

8-bit floating point keeps a model's accuracy better than 8-bit integers, but the first floating-point cell was 3.5 times larger and ran at a fifth of the speed. The cost was not in the 8-bit inputs at all.

ONE MULTIPLY-ADD CELL, THREE NUMBER FORMATS (POST-SYNTHESIS)cell areaclock speed8-bit integer32-bit integer sum129.7 µm²3.03 GHz8-bit floating point32-bit floating-point sum454.7 µm²0.64 GHz8-bit floating point16-bit floating-point sum197.8 µm²2.70 GHz1 GHzPost-synthesis speeds are optimistic; layout brings them down. The 32-bit floating-point sum could not reach 1 GHz even before layout.
The expensive part was the 32-bit floating-point sum. With a 16-bit sum the floating-point cell is 1.5 times the integer cell and still well over 1 GHz. The trade-off accepted: a 16-bit sum can overflow on the longest reductions, which input scaling has to prevent.

The systolic array

A systolic array is a grid of small identical cells, each wired only to its neighbours. Numbers enter at the edges and move one cell per clock, like a pulse, which is where the name comes from. A number fetched once is used by every cell it passes through. In Systole's version each cell keeps its own running sum and only the inputs move, which is called output-stationary.

ONE CELL, EVERY CLOCK×+suma, from the lefta, passed rightb, from aboveb, passed downThe sum stays in the cell.Only a and b move, onecell per clock.In Systole's design:8-bit floating-point a and b,16-bit floating-point sum
What one cell does each clock. The real array has 16,384 of them, each laid out from about 1,660 standard cells in a 19.6 µm square.

Step through a 3×3 version multiplying two small matrices. Rows of one matrix enter from the left, columns of the other from the top, each one a step later than the last so that matching numbers meet in the right cell.

Seven steps for a 3×3. The same schedule on 128×128 cells keeps all 16,384 busy once the pipeline fills, and every number read from the Scratchpad is used 128 times.

The chip

Around the array sit the parts that keep it fed and tell it what to do. Almost all of it is generated by Chipyard from UC Berkeley's open designs: the Gemmini accelerator (given an 8-bit floating-point datapath for Systole), the Saturn vector unit for the math that is not a matrix multiply, and a Rocket core that runs the generation loop. On top of the generated design sit 33 patches, mostly to make slow blocks fast enough, kept as separate, documented changes in the repository.

Here is the chip from the block diagram above, as it was actually laid out. Click any block, or pick it from the list, to see what it does and how fast it runs on its own.

The routed chip, with every block outlined and named.
Block outlines come from the routed layout's own placement data. Speeds are each block measured alone, register to register, on its routed layout. Metal 9, which inside the blocks is almost all power straps, is hidden so the blocks show through.

Built block by block

Laying out a chip means turning the design into placed and wired transistors that still meet timing once real wire delays are known. Each block went through the same flow, and a finished block was then frozen: reduced to a box with pins, a timing model and its layout, and used as a single cell in the design one level up.

WHAT EVERY BLOCK WENT THROUGHSynthesislogic to gatesFloorplansize, pins, powerPlacementwhere gates goClock treeclock to registersRoutingevery wireExtractionreal wire delaysFreezea box with pinsand a timing modelthe frozen block becomes one cell of the next level's design
Every stage runs on free tools. Why the chip is split the way it is comes in the next section.

These are all 28 blocks that were hardened. Speeds are register to register on each block's routed layout, at the typical corner (0.70 V, 25 °C) and the slow corner (0.63 V, 100 °C). Cells are standard cells of logic, not counting filler; for the array levels they count everything inside, down to the single cells. Click a name to jump to its card, and click any picture to see it full screen.

BlockTypicalSlowSizeCells
The array, bottom to top
Multiply-add cell2,672 MHz1,956 MHz20 × 20 µm1,661
4×4 cluster1,597 MHz1,179 MHz99 × 99 µm29,288
16×16 cluster1,430 MHz1,065 MHz416 × 416 µm470,549
64×64 cluster1,185 MHz901 MHz1,700 × 1,700 µm7.54 M
128×128 array *1,344 MHz1,017 MHz3,488 × 3,488 µm30.15 M
Accelerator
Scratchpad *1 GHznot met1,080 × 1,824 µm1.90 M
Transposer1,540 MHz1,220 MHz418 × 418 µm702,352
Matrix multiply unroller1,647 MHz1,196 MHz86 × 86 µm41,092
Convolution unroller1,052 MHz762 MHz204 × 204 µm199,940
Reservation station1,019 MHz748 MHz104 × 104 µm48,823
Accumulator memory1,498 MHz1,179 MHz388 × 388 µm52,729
Accumulator scaling1,124 MHz904 MHz362 × 362 µm258,956
Beat merger1,024 MHz748 MHz161 × 161 µm84,327
Accelerator address translation1,820 MHz1,335 MHz32 × 32 µm4,910
Processor and vector unit
Rocket control core1,334 MHz978 MHz105 × 105 µm52,201
Control and status registers2,136 MHz1,616 MHz47 × 47 µm10,655
Floating-point unit1,168 MHz863 MHz131 × 131 µm81,400
Data cache1,177 MHz885 MHz249 × 249 µm25,078
Instruction fetch1,286 MHz960 MHz200 × 200 µm33,791
Instruction address translation1,729 MHz1,281 MHz48 × 48 µm10,045
Page-table walker1,662 MHz1,239 MHz140 × 140 µm6,710
Vector backend1,012 MHz734 MHz293 × 293 µm345,675
Vector memory unit1,087 MHz794 MHz93 × 93 µm50,586
Vector compactor1,520 MHz1,130 MHz70 × 70 µm26,866
System
Timer and software interrupts1,981 MHz1,337 MHz21 × 21 µm1,466
Interrupt controller2,965 MHz2,042 MHz13 × 13 µm491
Debug module2,318 MHz1,729 MHz47 × 47 µm9,726
Serial linkno pathno path82 × 82 µm25,968

* See the block's note. Blocks marked as built on their own were hardened to measure them; in the chip their logic sits inside a larger block. Pictures are renders of each block's own routed layout with the top power metal hidden; stand-in memories show as empty boxes.

The array, bottom to top

Five levels, each one sixteen frozen copies of the level below (four at the top).

The routed layout of the multiply-add cell.

Multiply-add cell

PE_256

One cell of the systolic array: an 8-bit integer multiply-add that keeps its own running sum.

2,672 MHztypical
1,956 MHzslow
385 µm²20 × 20 µm
1,661cells of logic, 41 flip-flops

How it closed. Its speed is set by the accumulation loop, the sum feeding back into itself every clock (log entry 7). The fast, super-low threshold voltage cell library took it over 1 GHz at the slow corner as well (entry 13).

The 1 GHz clock in the chip.

The routed layout of the 4×4 cluster.

4×4 cluster

PEClusterInt4

Sixteen frozen multiply-add cells and the registers between them.

1,597 MHztypical
1,179 MHzslow
9,801 µm²99 × 99 µm
29,288cells, everything inside

How it closed. The first level built from frozen blocks, so the first place pins, the power grid and the cells' edges had to line up (log entry 8).

The 1 GHz clock in the chip.

The routed layout of the 16×16 cluster.

16×16 cluster

PEClusterInt16

Sixteen frozen 4×4 clusters: 256 multiply-add cells.

1,430 MHztypical
1,065 MHzslow
0.17 mm²416 × 416 µm
470,549cells, everything inside

How it closed. Above this level each cluster is only frozen blocks plus the wiring and clock between them, so the work moves from logic to clock delivery and pins.

The 1 GHz clock in the chip.

The routed layout of the 64×64 cluster.

64×64 cluster

PEClusterInt64

Sixteen frozen 16×16 clusters: 4,096 multiply-add cells.

1,185 MHztypical
901 MHzslow
2.89 mm²1,700 × 1,700 µm
7.54 Mcells, everything inside

How it closed. The tool's clock tree gave 559.6 ps of skew and 852 MHz. Two conditions in OpenROAD's C++ source stop its clock tree builder from working on a level made only of blocks, so the tree was built by hand and handed to the tool finished: 150.8 ps of skew (log entry 32).

The 1 GHz clock in the chip.

The routed layout of the 128×128 array.

128×128 array

MeshInt128

Four frozen 64×64 clusters: all 16,384 multiply-add cells. In the chip it is the 8-bit integer array behind a wrapper.

1,344 MHztypical
1,017 MHzslow
12.17 mm²3,488 × 3,488 µm
30.15 Mcells, everything inside

How it closed. Routed with a hand-built clock tree. Here the frequency depends almost entirely on where the clock buffers can stand and which metal the clock is routed on (log entries 34 and 35).

Setup only: hold is not met between its four clusters.

The 1 GHz clock in the chip.

Accelerator

The parts of Gemmini that feed the array and tell it what to do.

The routed layout of the scratchpad.

Scratchpad

Scratchpad

The array's on-chip memory: stages weights, inputs and results, with the accumulator inside it.

1 GHztypical
not metslow
1.97 mm²1,080 × 1,824 µm
1.90 Mcells of logic, 56,062 flip-flops

How it closed. At 1.2 million cells it could not be routed flat on a 62 GB machine, so it was split into an accumulator block and a shell around it (patch 0010). Later patches, 0011 to 0033, registered its boundaries and moved its memory-copy engines to half rate. The accumulator block was then closed inside the already-frozen shell (log entries 42 to 45).

Meets 1 GHz at typical (setup +22 ps, hold +2 ps); not met at slow. Cells include the 1.29 million inside the accumulator block.

The 1 GHz clock in the chip.

The routed layout of the transposer.

Transposer

AlwaysOutTransposer

Turns rows into columns on the way into the array. Over 131,000 flip-flops: it holds a full 128×128 tile of bytes.

1,540 MHztypical
1,220 MHzslow
0.18 mm²418 × 418 µm
702,352cells of logic, 131,080 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip.

The routed layout of the matrix multiply unroller.

Matrix multiply unroller

LoopMatmul

Splits a large matrix multiply into array-sized tiles and issues them.

1,647 MHztypical
1,196 MHzslow
7,361 µm²86 × 86 µm
41,092cells of logic, 2,386 flip-flops

How it closed. 850.7 MHz as generated. Its control was rebuilt to run at half rate on the same clock, so its long paths get two cycles (patch 0003).

The 1 GHz clock in the chip.

The routed layout of the convolution unroller.

Convolution unroller

LoopConv

Turns one convolution command into the sequence of array operations it needs.

1,052 MHztypical
762 MHzslow
41,446 µm²204 × 204 µm
199,940cells of logic, 5,542 flip-flops

How it closed. Half-rate control (patch 0002) took it to 942.4 MHz. Splitting its longest address sums across the command pipeline (patch 0005) and registering its per-slot sizes (patch 0006) closed the rest.

The 1 GHz clock in the chip.

The routed layout of the reservation station.

Reservation station

ReservationStation

Queues the accelerator's commands and tracks which ones depend on each other.

1,019 MHztypical
748 MHzslow
10,774 µm²104 × 104 µm
48,823cells of logic, 7,828 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip.

The routed layout of the accumulator memory.

Accumulator memory

AccumulatorMem

The accumulator's memory banks and their control, where the array's results are summed.

1,498 MHztypical
1,179 MHzslow
0.15 mm²388 × 388 µm
52,729cells of logic, 6,368 flip-flops

How it closed. Built on its own to measure it. In the chip this logic sits inside the accumulator block within the Scratchpad.

The 1 GHz clock in the chip.

The routed layout of the accumulator scaling.

Accumulator scaling

AccumulatorScale

Scales results on their way out of the accumulator.

1,124 MHztypical
904 MHzslow
0.13 mm²362 × 362 µm
258,956cells of logic, 12,304 flip-flops

How it closed. Built on its own to measure it. In the chip this logic sits inside the accumulator block within the Scratchpad.

The 1 GHz clock in the chip.

The routed layout of the beat merger.

Beat merger

BeatMerger

Reassembles data arriving from memory into full rows for the Scratchpad.

1,024 MHztypical
748 MHzslow
26,018 µm²161 × 161 µm
84,327cells of logic, 2,141 flip-flops

How it closed. Its buffer shift amounts are now computed one cycle early (patch 0007). In the chip it sits inside the Scratchpad.

The 1 GHz clock in the chip.

The routed layout of the accelerator address translation.

Accelerator address translation

DTLB_2

Translates the accelerator's virtual addresses into physical ones.

1,820 MHztypical
1,335 MHzslow
1,009 µm²32 × 32 µm
4,910cells of logic, 464 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip.

Processor and vector unit

The Rocket control core and the Saturn vector unit, on the half-rate processor clock.

The routed layout of the rocket control core.

Rocket control core

Rocket

Runs the generation loop and sends commands to the array and the vector unit.

1,334 MHztypical
978 MHzslow
11,012 µm²105 × 105 µm
52,201cells of logic, 4,227 flip-flops

How it closed. 974 MHz as generated. Its slowest path ran through six bit-counting instructions that the control code never uses, so they were dropped. Formal checks in Yosys confirmed nothing else changed (patch 0001, log entry 38).

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the control and status registers.

Control and status registers

CSRFile

The control core's configuration and status registers.

2,136 MHztypical
1,616 MHzslow
2,189 µm²47 × 47 µm
10,655cells of logic, 1,241 flip-flops

How it closed. Built on its own to measure it. In the chip it sits inside the Rocket core.

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the floating-point unit.

Floating-point unit

FPU

Floating-point math for the control core, shared with the vector unit for its multiply-adds.

1,168 MHztypical
863 MHzslow
17,284 µm²131 × 131 µm
81,400cells of logic, 5,258 flip-flops

How it closed. 636 MHz as generated. The real limit was one line of Chisel, require(latency <= 2), which blocked any extra pipelining. The multiplier is now pipelined inside (patch 0008, log entry 39).

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the data cache.

Data cache

DCache

The control core's data cache, with its tag and data memories.

1,177 MHztypical
885 MHzslow
62,045 µm²249 × 249 µm
25,078cells of logic, 2,741 flip-flops

How it closed. 744 MHz at first. A faster cell library and a placement density fix closed it.

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the instruction fetch.

Instruction fetch

Frontend

Fetches and predicts the control core's instructions, with the instruction cache.

1,286 MHztypical
960 MHzslow
39,832 µm²200 × 200 µm
33,791cells of logic, 4,900 flip-flops

How it closed. No changes to the generated design were needed.

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the instruction address translation.

Instruction address translation

ITLB

Translates instruction addresses for the control core.

1,729 MHztypical
1,281 MHzslow
2,331 µm²48 × 48 µm
10,045cells of logic, 1,474 flip-flops

How it closed. Built on its own to measure it. In the chip it sits inside instruction fetch.

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the page-table walker.

Page-table walker

PTW

Finds address translations in memory when they are not already cached.

1,662 MHztypical
1,239 MHzslow
19,600 µm²140 × 140 µm
6,710cells of logic, 571 flip-flops

How it closed. No changes to the generated design were needed.

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the vector backend.

Vector backend

VectorBackend

The Saturn vector unit's math: softmax, normalization, activations, position encoding.

1,012 MHztypical
734 MHzslow
86,052 µm²293 × 293 µm
345,675cells of logic, 21,494 flip-flops

How it closed. 613 MHz as generated. One valid flip-flop gated every operand of every unit. It was re-pipelined in Chisel in 19 batches, each verified before the next (patch 0009, log entry 40).

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the vector memory unit.

Vector memory unit

VectorMemUnit

Moves vector data between memory and the vector unit.

1,087 MHztypical
794 MHzslow
8,659 µm²93 × 93 µm
50,586cells of logic, 5,139 flip-flops

How it closed. 810 MHz as generated, limited by a one-cycle loop in its load address generator. Re-pipelined with the vector backend (patch 0009).

Processor clock in the chip: half rate, 500 MHz.

The routed layout of the vector compactor.

Vector compactor

Compactor_4

Packs vector elements together for memory accesses.

1,520 MHztypical
1,130 MHzslow
4,932 µm²70 × 70 µm
26,866cells of logic, 1,224 flip-flops

How it closed. An earlier standalone build. In the chip it sits inside the vector memory unit.

Processor clock in the chip: half rate, 500 MHz.

System

Interrupts, debug and the link to the host.

The routed layout of the timer and software interrupts.

Timer and software interrupts

CLINT

Keeps time and raises software interrupts.

1,981 MHztypical
1,337 MHzslow
433 µm²21 × 21 µm
1,466cells of logic, 129 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip.

The routed layout of the interrupt controller.

Interrupt controller

TLPLIC

Routes external interrupts to the control core.

2,965 MHztypical
2,042 MHzslow
171 µm²13 × 13 µm
491cells of logic, 59 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip.

The routed layout of the debug module.

Debug module

TLDebugModuleInner

Lets a debugger halt the core and read its state.

2,318 MHztypical
1,729 MHzslow
2,207 µm²47 × 47 µm
9,726cells of logic, 993 flip-flops

How it closed. No changes to the generated design were needed.

The 1 GHz clock in the chip, through its own gate.

The routed layout of the serial link.

Serial link

DecoupledSerialPhy

The link to the host: model and prompts in, results out.

no pathtypical
no pathslow
6,757 µm²82 × 82 µm
25,968cells of logic, 5,421 flip-flops

Timing. It has no register-to-register path inside it, so there is no frequency to report.

The 1 GHz clock in the chip.

The hierarchy, and why this one

The chip is a tree. Its top level places 24 frozen blocks and wires them together. Most of those blocks are one flat piece of standard cells. Two were too big for that and have levels of their own: the 128×128 array and the scratchpad.

Why not lay it all out at once

  • It does not fit on the machine. A flat 32×32 piece of the array needed 52 GB to route and was killed on the 62 GB machine. The full 128×128 array could not even be generated as one flat design: the hardware generator ran out of memory at a 40 GB limit. Built instead from frozen cells, a 4×4 cluster routed in 275 MB.
  • Build once, copy many times. The multiply-add cell was laid out once and placed 16,384 times. Every level above it is also one build, copied.

The array: five levels, sixteen at a time

One multiply-add cell, rendered from its layout.
Multiply-add cell19.6 µm1 cell2673 / 1956 MHz
A 4x4 cluster.
4×4 cluster99 µm16 cells1597 / 1179 MHz
A 16x16 cluster.
16×16 cluster416 µm256 cells1430 / 1065 MHz
One 64x64 cluster.
64×64 cluster1700 µm4,096 cells1185 / 901 MHz
The 128x128 array.
128×128 array3488 µm16,384 cells1344 / 1017 MHz *

Frequencies are typical / slow, register to register. * Setup only: hold is not met between the four 64×64 clusters.

  • The registers go in the 4×4 cluster. Gemmini's cell passes its control signals straight through with no register, so four cells side by side made one long path: 474 MHz at the slow corner instead of the single cell's 704. A register on every cell boundary inside the 4×4 cluster brought it to 692 MHz, within 24 ps of one cell. Because each cluster's outputs are registered, no level above needs new logic: no path is ever longer than one cell to its neighbour.
  • Sixteen per level. Each level is a 4×4 grid of the one below, made by one tiling script whose output has the same pin names as its input, so it can be tiled again. 128 is 4×4×4×2, so the top level is a 2×2 of 64×64 clusters.
  • Placed by hand, on a grid. A systolic array only talks to its neighbours, so neighbours have to sit next to each other. In an earlier version of the array the automatic placer put the tiles in a neat lattice but in scrambled order, millimetres from their neighbours. Placement then tried to buffer those long wires, grew from 470 thousand cells to 4.7 million and never finished. Every level now places child (row, column) in slot (row, column).

The scratchpad: split when flat failed

The scratchpad started as one flat block of 1.2 million cells. Its global route reached 53 GB and then failed on congestion around the accumulator's read path. It was split into a shell, an accumulator block and its memories, each of which routes on its own.

Everything else: the generator's own boundaries

The control core, floating-point unit, data cache, vector unit and the rest follow the module boundaries Chipyard already generates. Each one could be patched and rebuilt without touching the others, and the top level was assembled with every block frozen.

What the hierarchy costs

  • Every boundary is a pin the level above has to reach. Pins had to sit on the routing tracks, be wide enough to land a via on, and be kept clear of the block's own metal.
  • The clock is harder. The 16×16 level and everything above it contain no registers of their own, so the tool would not balance the clock to the cells inside. The 64×64 and 128×128 needed a hand-built clock tree (the clock tree), and hold is still not met between the four 64×64 clusters.
  • The power grid runs out of metal. Each level puts its power one metal layer above the level below. The 64×64 already uses the top layer, so the 128×128 had to join its power straps directly onto the clusters' own.

Results

Speed depends on the conditions a chip runs in, so every number here names its corner. Typical is 0.70 V at 25 °C; slow is 0.63 V at 100 °C, the worst case a chip is normally signed off at. The target was 1 GHz at typical, and the slow corner is reported beside it. Every figure is register to register on the block's routed layout, with wire delays extracted from the real wires.

The 128×128 array's numbers are setup only: hold is not met between its four clusters. The Scratchpad meets 1 GHz at typical (setup +22 ps, hold +2 ps) and not at slow; the serial link has no register-to-register path. Some rows are standalone builds of logic that sits inside a larger block in the chip.

Most blocks did not start there. The rest of this page is the five fixes that moved the most, and then what it took to put everything on one die.

BlockBeforeAfterWhat changed
64×64 cluster852 MHz1185 MHzA hand-built clock tree. The clock tree
Rocket control core974 MHz1334 MHzTwo instructions removed, proven safe. The control core
Floating-point unit636 MHz1168 MHzPipelined inside the multiplier. The floating-point unit
Vector backend613 MHz1012 MHzRe-pipelined in 19 verified steps.
Data cache744 MHz1177 MHzFaster cell library plus a density fix.

The clock tree the tool could not build

The 64×64 cluster is sixteen frozen 16×16 blocks and nothing else. It routed at 852 MHz typical while the blocks inside it ran at 1430, and reading its worst path term by term showed why.

THE 64X64'S WORST PATH, SLOW CORNER, TOOL-BUILT CLOCK TREE: 1501.6 PSclock skew559.6 ps (37%)child clock-to-output537.0 ps (36%)child setup408.2 ps (27%)wire from one cluster to the next: 0.28 psOnly the skew can move: the other two terms are the 16x16 block's own timing, frozen one level down.
Over a third of the clock period was skew: the clock reaching the sending cluster later than the receiving one. The wire between clusters cost 0.28 ps, so placement and routing were not the problem.

No tool setting changed the tree, and four different settings gave bit-identical results. The reason was in the OpenROAD source, and the fix was to build the tree by hand. Here are both, exactly as they were routed, traced from the two builds' final layouts:

THE TOOL'S TREE (BUILD V3)852 MHz typical559.6 ps routed skew86 buffers, 9.7 mm of clock wireTHE HAND-BUILT TREE (BUILD V5)1185 MHz typical150.8 ps routed skew62 buffers, 11.7 mm of clock wire
Both clock networks, traced from the clock port through every buffer to the sixteen cluster clock pins in each build's final layout, and drawn to scale (red dots are buffers). The hand-built tree uses more wire, 11.7 mm against 9.7, but every cluster sits the same distance from the root, and that is what removes the skew.
How the tool's tree ends up like this

OpenROAD's clock tree builder sorts the clock pins it finds into two groups, blocks and registers, and only builds a separate tree for the blocks when both groups are non-empty. A level made only of frozen blocks has no registers, so that path is never taken and every block-tree option is accepted and ignored.

The register-side builder splits its pins in half until a group has fewer than 15, a limit with no command-line option. Sixteen pins become two groups of eight, so it stops after a single level and leaves two long nets, each spanning the die. The repair step then chops those into repeater chains, which is the pattern on the left: clusters tap the chain at different points, and that difference is the skew.

Building the tree by hand had two traps of its own. A buffer at the natural branch point lands inside a block, where it cannot legally be placed, so buffers are placed in the channels between blocks from the start. And splitting at the centre of the sinks left the two legs of a branch unequal; splitting at the midpoint and choosing the placement site that best balances the two legs fixed that.

THE SAME 64X64, SAME PLACEMENT, SAME LIBRARY: ONLY THE CLOCK TREE CHANGESrouted skewtypical frequencytool-built tree, any settings559.6 ps852 MHzhand-built, split at the centre of the sinks231.2 ps1084 MHzhand-built, split at the midpoint, balanced legs150.8 ps1185 MHz1 GHz
Same floorplan, placement, constraint and library in all three rows. The detailed route also dropped from 2 hours to 19 minutes, because a balanced clock leaves the router less to fight.

The control core: dropping instructions it did not need

The Rocket core's slowest path ran through the circuit for six bit-counting instructions: counting the set bits, the leading zeros and the trailing zeros of a number. The core only runs the accelerator's control code, which never uses them, so they were dropped. That took the core from 974 to 1334 MHz typical.

THE CONTROL CORE'S SLOWEST PATHtypical, as built1019.0 pstypical, without bit counting790.4 psslow, as built1392.8 psslow, without bit counting1085.7 ps1 GHz typical targetWithout the bit-counting circuit, the slowest remaining path is 22 percent shorter and clears 1 GHz at typical.
The core's slowest path as built, and once the bit-counting circuit is taken out, at both corners.

A program that does use one of the six now stops with an illegal-instruction error instead of getting a wrong answer. Formal checks in Yosys confirmed that nothing else changed:

CheckResult
The edited arithmetic unit gives the same answer as the original for every other operationproven
The new error fires for exactly those six instructionsproven
No other instruction, out of all 232, can reach the removed circuitproven

The floating-point unit: one line of Chisel

At 636 MHz typical, the floating-point unit had been written off as needing a different design. Grouping its failing paths by where they end pointed at one register three times:

Where the failing paths endEndpointsWorst slack, slow
64-bit fused multiply-add result register104−1265 ps
32-bit, same register43−836 ps
16-bit, same register10−501 ps
Register file write (rounding and write-back)about 1200−399 ps

In the generator, the whole multiply and add is computed in one pipeline stage, and the class begins with require(latency <= 2). The obvious latency setting only appends registers after the result, which had been tried and changed nothing. No tool closes a 57 percent gap; the register had to move inside the multiplier.

BEFORE: THE WHOLE MULTIPLY AND ADD IN ONE CLOCK53 x 53-bit multiply, then 106-bit addabout 2165 ps at the slow corner1 GHz typical allowsabout 1377 ps hereAFTER: SPLIT INSIDE THE MULTIPLIER, IN THE GENERATORpartial products, 3:2 compressor treecarry-save: no carry ripplesone carry addsum row + carry rowroundingmoved off the write pathTwo more cycles of latency on scalar floating-point instructions, which are not on the inference datapath.
The textbook fused multiply-add pipeline, written in the Chisel generator rather than in the emitted Verilog, so the vector unit that shares this multiplier regenerated around it from a single configuration number.

Before any layout, the old and new pipelines were simulated side by side on the same inputs every cycle at all three widths, across zero, infinity, not-a-number, subnormal and normal values and every rounding mode: zero mismatches. The standard floating-point test suites passed 23 of 23, and a vector test through the shared multiplier passed 4640 of 4640. The unit went from 636 to 1168 MHz typical for 9.7 percent more area.

Assembling the chip

With every block frozen, the top level puts them on one die and connects them: about 1.06 million cells of logic between 24 blocks and memories, on a 5128 × 3888 µm die. No block could be rebuilt at this stage, so every fix had to happen in the top level itself.

The processor side cannot run at 1 GHz as a whole, so the chip has two clocks: the accelerator and the rest at 1 GHz, and the processor at half rate through synchronous crossings. Every register-transfer-level change for this was simulated before layout, including a full matrix multiply on the full-chip simulator and a 10,000-cycle side-by-side check of the array against its wrapper.

THE CHIP'S CLOCK, MEASURED FROM THE PLACED DESIGNclock input1 GHz1 GHz domain368,987 registers, 17 block clock pinsaccelerator, Scratchpad, uncoreprocessor gate, half rate3,801 registers, 7 blocksRocket, float unit, cache, vector unitdebug gate107 registers, 1 blockdebug module
Every consumer gets its own buffer branch from the clock input, so each branch can be delayed by a different amount.

That freedom is needed because a frozen block brings its own clock delay with it. The array's internal clock tree, built for 16,384 cells across 3.5 mm, takes 5.7 ns to deliver the clock; most other blocks take well under half a nanosecond. If every branch started at the same time, data leaving a small block would reach the array long before the array's registers were clocked. So every branch was padded until it arrives together with the array's.

CLOCK DELAY ALREADY INSIDE EACH FROZEN BLOCK, AND THE TARGET EVERY BRANCH WAS PADDED TOMatrix array5,664 psScratchpad878Transposer369Vector backend282Convolution unroller184Floating-point unit136Data cache136Instruction fetch133Reservation station129Rocket control core124Vector memory unit108Matrix multiply unroller94Timer and interrupts80Page-table walker76Debug module70Accelerator address translation67Interrupt controller586,782 ps targetBlue: delay inside the block, fixed when it was frozen. Grey: delay the top level had to add in front of it. The balance step added 27,394 delay buffers.
Read from each block's exported timing model. Of the top level's 26,673 hold failures, 7,414 are on paths into the array.
POWER GRID

4,270 of 4,270 connections

Each frozen block exposes its power on different metal layers. The top grid bridges into every one, checked connection by connection.

FILLER CELLS

About 16.2 million

The legalizer needs 48 bytes per placement site of the whole core, 65 GB for this die, more than the machine has. Filling ran in four windows, one process each.

Routing the chip

The detailed router draws every wire: 1.28 million nets across the whole chip. It works by cutting the chip into thousands of small square tiles and wiring them a batch at a time, with many tiles in progress at once, one per processor thread. Each tile in progress keeps its own copy of the wires, pins and design rules in its area, including a design-rule checker of its own.

On a 62 GB machine the stock router ran out of memory three times. Two habits of the router caused it:

  • A finished tile kept its design-rule checker in memory until the whole batch was done, so late in each batch most of the memory belonged to tiles that were already finished.
  • Memory freed in the middle of a batch stayed reserved by the router instead of going back to the system.
SEVEN ATTEMPTS AT THE FULL-CHIP DETAILED ROUTEattempt 1out of memoryassigning tracksattempt 2out of memoryfirst passattempt 3out of memoryfirst passattempt 4stoppedtoo slowattempt 5stopped53.6 of 56 GBattempt 6lostshut down at 40%attempt 7finished50 GB peakAttempts 1 to 3 ran out of memory; the router patch made attempts 6 and 7 hold a steady ceiling.

The fix was a patch to the router's C++ source that changes how it manages memory, not what it routes:

  • Drop the checker as soon as a tile is finished, instead of at the end of the batch. This was most of the saving.
  • Give freed memory back to the system once a minute.
  • Wait when memory is high. A new tile does not start while the router is above 48 GB, and before each batch the number of threads is set from how much memory is left.
  • Smaller batches, so less finished work is held at any one time.

The wiring it produces is unchanged; it just never holds more than it needs. With the patch the route ran at a steady level instead of climbing until it was killed:

WHERE THE PATCHED ROUTER'S MEMORY SAT, ON A 62 GB MACHINEbase, after freed memory goes back: about 29 GBworking swing 37.6 to 45.6no new tiles above 48peak 50.0allowed 560 GB20 GB40 GB62 GB
With the patch, memory swung between about 38 and 46 GB, peaked at 50, and never reached the 56 GB the run was allowed.
FIRST PASS, VIOLATIONS AS IT GOESAFTER EACH REPAIR PASSrouting violations00.5 M1.0 M1.5 M2.0 M0%50%100%the jump at 40%: the Scratchpad's area1.75 Mpass 01.44 Mpass 11.36 Mpass 21.36 Mpass 3The count stopped falling after pass 3 (1,359,831 to 1,359,792): the remaining violations are real congestion, not first-pass noise.
The first pass took 7 hours 23 minutes; the repair passes stopped improving after the third.

Where it stands

The chip is placed, routed, has its power grid and filler cells, and is not closed. The router stopped improving at about 1.36 million violations, most of them from congestion over the Scratchpad, and at the typical corner 44,247 paths miss setup and 26,673 miss hold.

SETUP FAILURES BY WHERE THE PATH STARTS AND ENDS, TYPICAL CORNERworst slacktop-level logic to top-level logic28,941−29,992 psScratchpad to top-level logic1,979−5,529 psarray to top-level logic4,102−4,468 pstop-level logic to transposer1,026−15,538 ps44,247 setup failures in all; two thirds of them run between pieces of top-level logic.

So there is no frequency claim for the chip as a whole, only for the blocks. Closing the top would take weeks of congestion and timing work, and the project stops at this assembled checkpoint. The limits, stated plainly:

MEMORIES

Stand-in models

The on-chip memories have the right size, pins and timing, but nothing inside them.

THE ARRAY

8-bit integer in the layout

The hardened array is the integer version; a wrapper adapts it to the 8-bit floating-point chip. It also misses hold between its four clusters.

DESIGN RULES

The router's own count

ASAP7 has no open, calibrated design-rule deck, so violation counts are the router's.

PROCESS

Predictive, not silicon

ASAP7 models a 7 nm process for research. The numbers compare designs; they are not a product's.

The repository

Layout databases, netlists and timing models are build outputs, tens of gigabytes in all, and are not checked in. Everything is rebuilt from the configurations and scripts. The largest steps take most of a 62 GB, 32-core machine.