Protocol emulator ASIC
complete (November 2026)
https://github.com/devanandanj/protocol-emulator-asic
Purpose
- My entry for the Jane Street Protocol Emulator ASIC Competition. Deadline is 18 January 2027.
- Target : Tiny Tapeout, March 2027 shuttle on IHP CMOS5L.
- This is my first chip. Everything I did before ended at a bitstream. This one ends at GDS, and if it goes through, a real die comes back.
Tools and technologies
- Verilog RTL
- IHP CMOS5L PDK + IHP 256x16 SRAM macro
- OpenLane through the Tiny Tapeout flow
- C++ cycle accurate model and assembler (my own)
- cocotb + Icarus Verilog for verification
Why not just three blocks
- The obvious way was to build a UART, an SPI master and an I²C master as three separate blocks. That works, but it only ever speaks those three.
- Instead I made one small core whose only job is to read and write pins on an exact cycle. Same idea as the RP2040 PIO and TI’s PRU.
- Load a different program at boot and the same silicon becomes UART, SPI, I²C, PS/2, JTAG, SWD or CAN TX. Once silicon is made you can’t change it, so I wanted it to be able to do more than three things.
Block diagram
Design Decisions
- The ISA has 16 opcodes, a 12 bit PC, eight 8 bit registers and two 16 deep FIFOs to the host. Only the low 8 bits of the PC address the 256 word SRAM. Every instruction I added had to pay for its area, so the protocols decided what stayed.
- The host talks to the chip over SPI. That one port loads the program, moves FIFO data and starts/stops the core. The
uipins are too few for a parallel bus, and this way all 8uiopins stay free for the protocol. - Program memory was first a 64 word flip-flop array. Then I saw it was about 70% of the whole design. Switching to the IHP SRAM macro gave 4x the words in less space.
- The catch was the SRAM’s read port is registered, so the instruction comes a cycle late. I fetch with
pc_nextinstead ofpc, so the word is ready the cycle it executes. Issue stays single cycle and still matches the model cycle for cycle. - There is no clock prescaler. Timing is done in firmware with
DELAY, which counts down a 12 bit stall counter. So the clock divider really moved into the program:uart_tx.pemuhasdelay 432written in for 115200 baud at 50 MHz, and a different clock means new delay values. - Only one program runs at a time. A second core for running protocols side by side was on the table, and area wasn’t the problem: the design used 6.4% of the cells at 6x4. I cut it because a second core is as much verification work again. I also cut a capture and replay engine, because its second SRAM meant redoing the Metal4 power grid bridge, which was the hardest part of the first SRAM integration.
Result
Hardened to GDS : 8x4 tiles @ 50 MHz
DRC / LVS / antenna : 0 violations
Protocol programs : 8 (UART TX/RX, SPI, I²C, PS/2, JTAG, SWD, CAN TX)
- The part I enjoyed most wasn’t a protocol. A readable cycle counter lets a program time its target to the cycle. With
lockprobe.pemuthe chip is the stopwatch: it forwards each guess to a lock and measures how long the lock takes to answer. The host runs the search. A lock that bails at the first wrong byte answers sooner, so the secret leaks out one byte at a time. In simulation, against a model of the lock, it recovers a 3 byte secret.
Verification
- The testbench only touches the chip through its pins, over the SPI host port. Same as a real host would.
- Every protocol program runs on both the C++ model and the RTL, and
pc, registers and pins are compared every single cycle. One cycle of drift and it fails. - Ten random programs go through the same check, so it’s not only my hand written code being tested. They come from a fixed seed, so it’s the same ten every run.
- The model and the RTL are both written by me, so they could share the same bug. To catch that, an independent CAN receiver de-stuffs the chip’s output and checks the CRC-15.
- I broke the design on purpose, in every area, to check the tests could fail. Three of the breaks passed the first time, which meant the tests weren’t checking enough. I found the gaps and fixed all three.
What’s next
- Nothing has run on real hardware yet. Gate level sim is only a smoke test, and there is no coverage report.
- Submit by 18 January 2027, then wait for the March 2027 shuttle.
