
A 3x3 output-stationary systolic array that computes one fixed-size matrix product per job,
C (3x3) = A (3x3) x B (3x3), in either INT8 or INT4 precision. The host talks to it over SPI.
a1*b1 + a0*b0 and the two cross multipliers are gated off.OUT_VALID goes high.The first byte of every frame is a header. On MISO the chip always answers the header byte with its ID 0x5A.
| Header | Meaning |
|---|---|
0x00 |
write one job, INT8 |
0x01 |
write one job, INT4 |
0x80 |
read the result |
| other | invalid: the whole frame is ignored and MISO returns 0 |
Each step sends one slice of the shared dimension k: column k of A and row k of B.
Write, INT8 (1 + 18 bytes). Step t (t = 0..2) sends 6 bytes:
A[0][t] A[1][t] A[2][t] B[t][0] B[t][1] B[t][2]
Write, INT4 (1 + 12 bytes). Step s (s = 0, 1) sends 6 bytes, each {high nibble, low nibble}:
{A[0][2s+1],A[0][2s]} ... {A[2][2s+1],A[2][2s]} {B[2s+1][0],B[2s][0]} ... {B[2s+1][2],B[2s][2]}
K = 3 is odd, so in step s = 1 there is no k = 3: the high nibble of each of its 6 bytes is ignored (the chip treats it as 0), and only the low nibble (k = 2) is used.
The array advances one step each time the 6 bytes of a step have arrived; after the last step it is flushed
for 5 more steps and OUT_VALID goes high. Extra bytes are ignored. If CS_N goes high before all data bytes
have arrived, the job is dropped and OUT_VALID stays low.
A write header received while the chip is idle starts a new job at once: it clears OUT_VALID and the previous
results, even if the new job is later dropped. OUT_VALID is cleared only this way; reading does not clear it.
A write header received while BUSY is high is ignored with the rest of its frame (with the timing below this
cannot happen, because a job finishes before the next header can be received).
Read (1 + 27 bytes). Results C00, C01, ..., C22 in row-major order, each sign-extended to 24 bits,
least significant byte first. Reading does not change any state; bytes past the 27th return 0.
Results are valid only while OUT_VALID is high: during a job the accumulators hold partial sums. After reset
all results read as 0.
0x00 or 0x01 followed by the data bytes).OUT_VALID (uo[2]) is high. This takes about 11 clock cycles after the last SCLK rising edge. A host
that only has the four SPI wires can start the read frame right away: the read header alone takes at least
64 clock cycles, so the results are ready before the first result byte is sent.
The SPI frames carry no status (the header reply is always 0x5A), so such a host cannot tell a finished job
from a dropped one: after a dropped job the read returns zeros or partial sums. Check OUT_VALID before
reading whenever a write frame may have been cut short.0x80 followed by 27 dummy bytes) and decode the 9 results.SPI timing requirements (f_clk = 50 MHz, one clock cycle = 20 ns). SCLK, MOSI and CS_N are each synchronized to the system clock with two flip-flops, so every SCLK level must be seen by at least one sample. At the pins of the design:
0x80 that loses its first
bit becomes the write header 0x00 or 0x01, and the dummy bytes are then taken as a new job that replaces
the results.Status outputs: BUSY (uo[1]) is high while a job is being loaded or computed; STATE1:STATE0 (uo[4:3]) is
0 = idle, 1 = loading, 2 = flushing.
Any SPI host, for example the RP2350 on the Tiny Tapeout demo board (RP2040 on older boards).
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | SCLK | MISO_DEBUG | MISO |
| 1 | MOSI | BUSY | |
| 2 | CS_N | OUT_VALID | |
| 3 | STATE0 | ||
| 4 | STATE1 | ||
| 5 | |||
| 6 | |||
| 7 |