The model machine's main line runs in pure software on a small computer (SBC). This page covers FPGA plus ESP32-C3, a research line that has only run in simulation.
The main line is pure software on an SBC: a runtime we wrote runs the model on a small ARM computer, and fetching firmware from the chain works the same way. See A large model on a small computer. The FPGA plus ESP32-C3 design below is a research line: we designed the circuits ourselves, and so far they have only run in simulation. No physical board exists yet.
Boot chip. Runs the boot firmware, which includes the TapeBoot client
Connects to Wi-Fi and reads the chain; checks signatures and hashes; fetches chunk by chunk; writes DDR3 through the SPI mailbox; watches the heartbeat to decide between commit and rollback
microSD
Attached to the C3
Chunk cache and the two slots, A and B. With no network, it boots from the most recent slot that passed its checks
GW2A-18 FPGA
Target board: Tang Primer 20K
Holds the circuits below. The bitstream stays in the onboard flash. You flash it over USB, not from the chain
rv32ima soft core
M-mode, no MMU, compatible with mini-rv32ima
Starts running from 0x8000_0000 after reset
DDR3
128 MB
The first 16 MB hold the runtime; the rest holds a model of up to 112 MB
Binary multiply-add unit
XNOR + popcount
Computes a whole matrix-vector product in one go, reading DDR3 by itself
UART
8250 subset, 8N1, 115200
Serial output
HDMI text console
80×30 characters, 2 bytes per cell (character + color)
Screen output
Runtime
TBRT bare-metal runtime (main), TapeOut Linux (secondary)
Layout of the TBW1 weight file. The whole file goes on chain as is, into DDR3 as is, and the multiply-add unit reads it directly, with no conversion along the way
The C3 is the host. Mode 0, most significant bit first, SCK no faster than 1/8 of the FPGA clock. One chip-select low period is one command. All multi-byte fields are little-endian.
Command
Format
What it does
0x01 WRITE
addr[4] followed by data
Writes to DDR3. Works only while the soft core is in reset
0x02 READ
addr[4] dummy[2], then read continuously
Reads DDR3. Works only while the soft core is in reset
0x03 RESET
v[1]
bit0 = 1 holds the soft core in reset, 0 releases it. Held by default at power-on
0x04 REG_WR
reg[1] v[4]
For now it can only write 0x00 BOOT_INFO
0x05 REG_RD
reg[1] dummy[1], then read v[4]
Reads a register from the table below
Register
Content
0x00 BOOT_INFO
High 16 bits = low 16 bits of the manifest's seq; low 16 bits = first 2 bytes of the manifest's sha256. Only lets the runtime print which version it is
0x04 HEARTBEAT
The soft core adds 1 every second; cleared during reset
0x08 MSG
Status code from the soft core to the C3; cleared during reset
The FPGA starts from the onboard flash and the DDR3 controller calibrates.
The C3 reads the mailbox version every 10 ms. The FPGA counts as up only when it reads MB01 or MB02. If it reads neither within 2 seconds, it stops: it fetches no files and leaves the slots alone.
Wait for bit4 of STATUS (DDR3 calibration done).
TapeBoot reads the channel, fetches the manifest, checks the signature, then fetches chunk by chunk and checks the hashes. See Fetch firmware from the chain.
Through the mailbox, write the runtime to 0x8000_0000 and TBW1 to 0x8100_0000, then write BOOT_INFO.
Release the soft core reset. The soft core starts running from 0x8000_0000.
If HEARTBEAT goes from 0 to non-zero within 60 seconds, the version counts as healthy and is committed. Otherwise it goes back to the old slot.
The same TapeBoot also runs as a Linux program on a small ARM computer. Fetching, checking and the A/B slots are all the same; the heartbeat goes through a pipe instead. See A large model on a small computer.