
This is the Tiny Tapeout (SKY130) version of our ECE 284 VGG16 accelerator. The FPGA design is an 8x8 weight-stationary systolic array that computes one 4-bit quantized VGG16 layer (features[27], 8 -> 8 channels, 3x3, pad 1) bit-exactly. This chip keeps the same datapath at a smaller scale:
mac_tile.v). PE(r,c) stores the weight W[c][r]. Activations move
east and partial sums move south. Each PE outputs c_q + a_q * b_q, a 4-bit (unsigned or
signed) activation times a 4-bit signed weight. Psum widths grow down the column
(8 bits in the top row, 10 bits at the bottom).load bit is set, each PE keeps the
first valid word it sees and forwards the rest east. The first word of a new load carries
clr. That bit travels through the array with the data and re-arms each PE it passes,
so a new weight load can follow data with no drain cycles.sfu.v): a 16-bit accumulator with ops LOAD, ADD (sum the kernel
passes), SHADD (acc<<4 + psum, the Part 2 Y0 = 16*W*X_hi + W*X_lo) and HOLD, plus
ReLU on readout. The op travels along the bottom row in step with the data, so each
column applies the right op despite the skew. On the FPGA, the OFIFO valid bits
absorbed this skew.The SRAMs (xmem / pmem / ymem) and the deep FIFOs do not fit, so the host plays their
role, as core_tb.v did on the FPGA. The host writes one vector, steps the array, and
reads back the accumulators. Every register advances only on a STEP command.
uio_in[2:0] = opcode, uio_in[7:3] = arg, ui_in = data. All uio pins are inputs.
| opcode | name | action |
|---|---|---|
| 0 | NOP | nothing |
| 1 | WRX | xbuf[arg] <= ui_in: byte k holds rows 2k (low nibble) and 2k+1 (high nibble) |
| 2 | STEP | push xbuf into the array and advance one step. ui_in = {0, clr, relu, op[1:0], signed, load, valid} |
| 4 | RD | next cycle uo_out = result byte arg: 2c / 2c+1 = column c bits [7:0] / [15:8]; 30 = {COLS-1, ROWS-1}; 31 = {0, last column updated, column 0 updated} |
Timing: if a vector is pushed by STEP number s, column c's accumulator holds its result
after STEP number s + ROWS + c. Push bubbles (valid=0) to drain.
W[c][0..3], then STEP with valid=1, load=1,
and clr=1 on c = 0.valid=1, op=LOAD, and read the
psums.op=LOAD, the rest op=ADD, and the last one sets relu=1.
The host skips all-zero weight tiles, which gives the pass-skipping pruning from the
FPGA project.signed=1, op=LOAD), then X0_lo
(signed=0, op=SHADD) to get Y0 = W*X0. Then push each dXi (signed=1, op=LOAD) and
add Y0 on the host.From test/, run make. The cocotb test drives the command bus and checks every
accumulator after every step against a bit-exact Python model. Tests cover streaming
matrix-vector products, back-to-back weight reloads, the full 8->8 channel 3x3 conv
layer with ReLU (tiled onto the 4x4 array as 2x2 blocks, with one pruned kernel position), and the Part 2
hi/lo + delta flow. make ROWS=8 COLS=8 ZERO_GATE=0 simulates other array sizes.
On the board: drive uio[2:0] and uio[7:3] and ui_in from the RP2040, pulse the
clock, and read uo_out.
None. Use a microcontroller (for example the RP2040 on the TT demo board) as the host.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | data[0] / valid | rd_data[0] | opcode[0] |
| 1 | data[1] / load | rd_data[1] | opcode[1] |
| 2 | data[2] / signed | rd_data[2] | opcode[2] |
| 3 | data[3] / sfu_op[0] | rd_data[3] | arg[0] |
| 4 | data[4] / sfu_op[1] | rd_data[4] | arg[1] |
| 5 | data[5] / relu | rd_data[5] | arg[2] |
| 6 | data[6] / clr | rd_data[6] | arg[3] |
| 7 | data[7] | rd_data[7] | arg[4] |