
tt_um_yangzhou08_mnist is a complete MNIST handwritten-digit classifier. The host sends the 784 pixels of a
28x28 image, one bit per pixel, and the chip returns the digit (0-9). All neural-network inference, including the
final arg-max, runs on the chip. There are no memories or macros: every weight is constant logic.
Interface
| Pin | Name | Description |
|---|---|---|
ui_in[0] |
DATA | pixel bit, 1 = ink (pixel >= 128) |
ui_in[1] |
STROBE | pixel handshake request (4-phase, see below) |
ui_in[2] |
START | level; while high the chip aborts everything and prepares for a new image |
ui_in[5:3] |
DBG_SEL | bring-up readback: selects the status byte (see below) |
ui_in[6] |
DBG_STEP | bring-up readback: a rising edge while DONE = 1 rotates the ten class scores by one |
ui_in[7] |
DBG_EN | bring-up readback: 1 = drive uio[7:0] with the selected status byte |
uo_out[3:0] |
DIGIT | result, valid while DONE = 1 |
uo_out[4] |
DONE | the result is valid; held until START or reset |
uo_out[5] |
ACK | pixel handshake acknowledge |
uo_out[6] |
BUSY | the chip is computing |
uo_out[7] |
ERR | sticky: a STROBE edge arrived while the chip could not accept a pixel (busy, or after pixel 783) |
uio[7:0] |
DBG | readback byte: outputs only while DBG_EN = 1; otherwise inputs (uio_oe = 0, uio_out = 0) |
uio[0] |
SCAN_EN | input while DBG_EN = 0: scan chain enable (see below). Keep low or undriven for normal use |
uio[1] |
SCAN_IN | input while DBG_EN = 0: scan chain data in |
uio[2] |
SCAN_OUT | driven by the chip only while the scan chain shifts: scan chain data out |
clk |
clock, any frequency up to 25 MHz (sign-off period 40 ns) | |
rst_n |
active-low reset, synchronised inside; hold low for at least 4 clock cycles. Reset also ends scan mode | |
ena |
ignored |
rst_n = 0 for >= 4 clock cycles with ui_in = 0, then rst_n = 1; wait >= 4 cycles. All outputs are 0.Supported idle gaps: the host may wait any time between any two steps. Keep STROBE low until START has fallen, and send a START pulse before every image.
Bring-up readback (optional; the classification does not depend on it). Leave ui_in[7:3] = 0 for normal use.
With DBG_EN = 1 the chip drives uio[7:0] with the byte selected by DBG_SEL, about 4 clock cycles after a change.
Nothing else may drive the uio pins while DBG_EN = 1.
| DBG_SEL | uio[7:0] |
|---|---|
| 0 | bits 7..0 of the class score at the head of the score ring (class 0 right after DONE) |
| 1 | {state[2:0], sub[1:0], 0, score[9:8]}; state: 0 idle, 2 layer 2, 5 classifier, 6 arg-max, 7 done |
| 2 | {row[4:0], col[4:2]} of the next pixel the chip expects |
| 3 | {col[1:0], tap[3:0], pos[1:0]} |
| 4 | {channel[4:0], fpos[2:0]} |
| 5 | {fpos[4:3], m, DONE, ERR, BUSY, best[9:8]} |
| 6 | bits 7..0 of the best score found by the arg-max |
| 7 | the constant 0xA5 (tests the readback path itself) |
Wait at least 4 clock cycles after DBG_EN went low before driving any uio pin from the board.
The chain contains 493 bits. Step the project clock manually during scan.
uio[2].uio[2] is driven by the chip and every further clock shifts
the chain by one. Scan mode needs exactly this sequence (SCAN_EN = 1, DBG_EN = 0, DBG_STEP = 0, DBG_SEL = 5
directly followed by 4): normal traffic (ui_in[7:3] = 0) and the readback (DBG_EN = 1) cannot start it,
whatever level the uio pins have.uio[0], uio[1], set DBG_SEL = 0, restart the clock.None. Only the demo board's RP2040 (or any other host that can drive three inputs and read eight outputs).
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | DATA (pixel bit, 1 = ink) | DIGIT[0] | DBG[0] (output while DBG_EN = 1); else input SCAN_EN |
| 1 | STROBE (pixel handshake request) | DIGIT[1] | DBG[1] (output while DBG_EN = 1); else input SCAN_IN |
| 2 | START (abort / new image) | DIGIT[2] | DBG[2] (output while DBG_EN = 1); SCAN_OUT (output while the scan chain shifts) |
| 3 | DBG_SEL[0] (bring-up readback select) | DIGIT[3] | DBG[3] (readback byte, output only while DBG_EN = 1) |
| 4 | DBG_SEL[1] | DONE (result valid) | DBG[4] (readback byte, output only while DBG_EN = 1) |
| 5 | DBG_SEL[2] | ACK (pixel handshake acknowledge) | DBG[5] (readback byte, output only while DBG_EN = 1) |
| 6 | DBG_STEP (rotate class scores, after DONE) | BUSY | DBG[6] (readback byte, output only while DBG_EN = 1) |
| 7 | DBG_EN (drive uio with the readback byte) | ERR (protocol error, sticky) | DBG[7] (readback byte, output only while DBG_EN = 1) |