protocol-emulator

protocol-emulator#

A small chip that bit-bangs protocols from firmware, and won’t start any firmware whose timing it can’t prove. Written in Hardcaml for Jane Street’s protocol emulator ASIC competition, built on IHP CMOS5L through Tiny Tapeout, in 8 x 4 tiles at 48 MHz.

from firmware to silicon

Two small cores drive the pins from firmware, much like the RP2040’s PIO. The difference is time. Each core has a 24-bit clock, a deadline register t and a period p. wait t+ releases on the exact cycle of the deadline and moves it on by one period, so a frame never drifts. A UART bit or an I2C hold time is a deadline written in the program, not a count of instructions you hope adds up.

Each program comes with a certificate, a table of timing bounds with a row for each of its words. A small kernel checks the certificate and refuses anything it can’t check. The kernel is proved against the RTL. If it accepts a program, that program never misses a deadline on the chip, under the assumptions in What is not proved. The chip runs that check itself. Before a start it steps through the program against its certificate, and it refuses the start if a word fails. If a deadline is ever missed anyway, the engine lets go of its pins and halts, and that is proved too.

Start with Getting started, or paste firmware into the playground.

What has been shown#

  • One theorem covers every program: if the kernel accepts it, it never misses a deadline (Verification).

  • 14 protocols we didn’t choose, six drawn by a public random beacon and eight sealed in advance, were all certified from their specs (Flexibility).

  • The 8 x 4 chip’s RTL runs on an Icepi Zero FPGA, where test/board/ holds 42 recorded runs. Nothing has run on silicon yet (Hardware).

  • You can send a job to that board yourself by opening an issue (Run it on the board).

Elsewhere on the site#

  • Firmware timing playground: the assembler, the timing analyser and the kernel, compiled to JavaScript with js_of_ocaml.
  • Live die: the hardened die, cells and wires lit as they switch.
  • Results: the claims CI checks, the job that checks each, and its last run on main.
  • Protocol corpus: each protocol's limits, firmware, certificate and board runs, failures included.
  • 3D viewer: the last green gds run on main in Tiny Tapeout's GDS viewer, also as GDS and OASIS, and its render.