
A characterisation chip for a ring-oscillator PUF and for raw TRNG entropy sources. It does readout only.
PUF. 160 rings of 7 Loop-PUF elements and 32 rings of 15. Each element has 1 challenge bit, which selects one of two inverters (two paths of nearly equal delay) through a 2:1 mux. One ring runs at a time. Its rising edges are counted by a ripple counter during a window of 2^(wlog+8) clocks.
The host measures each ring with challenge c and with ¬c. The difference d(c) = Σ ±δⱼ cancels everything common to the ring and leaves the per-element path mismatches δⱼ. Their signs, after masking the weak ones, are the key bits. Extraction, masking, ECC and hashing all run on the host. The raw PUF response leaves the chip: this is a characterisation chip, not a key store.
Raw TRNG sources (op TSRC). The chip does no processing: no debiasing, no health tests, no conditioning. The host gets the samples as they are.
Every TSRC capture ends with a stall word: the number of times sampling had to wait for the link. 0 means the samples are contiguous.
Other modes.
The protocol is in the header of src/asic_ctrl.v.
Set the clock to 50 MHz. Two links carry the same 20-byte command frames (A5 5A 3C C3 and a 16-byte command). Each response goes back on the link its command came in on.
SPI (fast). The chip is the peripheral: mode 0, MSB first, SCK up to 10 MHz (clk / 5). CS_n low to the first SCK edge must be at least 100 ns. Pins:
MISO carries a chain of a status byte {1, 0, busy, 0, n[3:0]} followed by n response words (little-endian), repeating for as long as SCK runs. A host can therefore clock fixed blocks and parse them afterwards. A word cut off at the end of a transaction is sent again.
UART (fallback). 115200 8N1: ui[3] is RX (into the chip), uo[4] is TX. The demoboard's RP2350 can serve it with a hardware UART, for example machine.UART(1, baudrate=115200, tx=tt.pins.ui_in3.raw_pin, rx=tt.pins.uo_out4.raw_pin).
ID (op 0) answers a frame with PUF1, the protocol version (5), the ring banks, the clock frequency and the TRNG / SPI inventory.
uo[0] is high while a command runs. uo[1] shows the measured ring's frequency divided by 256, as a scope check of the ring speed. uo[2] carries the PUF-ring TRNG sample stream.
None. SPI goes over the demoboard's RP2350 (a MicroPython PIO bridge, in the project repository). The UART goes over the RP2350 or any 3.3 V USB-UART adapter on the INPUT / OUTPUT Pmod headers.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | BUSY | SPI_CS_N | |
| 1 | RING_DIV256 | SPI_MOSI | |
| 2 | TRNG_SAMPLE | SPI_MISO | |
| 3 | RX | SPI_RDY | SPI_SCK |
| 4 | TX | ||
| 5 | |||
| 6 | |||
| 7 |