
This tile is an external return-address checker for a RISC-V (RV32IMC) CPU. It is inspired by the Zicfiss shadow-stack extension, but it is not a Zicfiss implementation. It watches the CPU from the outside instead.
A host (the RP2040 on the demo board, or an FPGA soft core) streams the CPU's retired instructions into the tile, one packet per instruction. The tile spots calls and returns using the RISC-V return-address-stack hints (link registers x1/x5, including all compressed forms). It keeps its own stack of return addresses in on-chip flip-flops that software can't reach. On every return it checks that the next instruction is at the address the matching call expects. If it isn't (for example after a stack-smashing / ROP attack), the sticky FAULT output goes high.
lost counter, so they never cause false faults. Overflow policy WRAP
(default) checks the innermost 6 frames. SATURATE checks the outermost 6.last_bad_pc
register. To fit a 1×1 tile, neither is built in this tapeout: LP_FAULT (uio[6])
always reads 0, CONFIG bit 2 has no effect, and views 5/6 read 0.Full rules: docs/design.md in the project repository.
The host puts a byte on ui_in, sets SOF (uio[1]) for header bytes, then pulses
STROBE (uio[0]) high and low. Data and SOF must stay stable while STROBE is high.
STROBE must stay high and low for at least 3 clocks each. A byte with SOF=1 always starts
a new packet.
| Header | Command | Payload bytes |
|---|---|---|
0x10 / 0x11 |
TRACE (bit 0 = TRAP) | PC[7:0], PC[15:8], INST[7:0], INST[15:8], INST[23:16] |
0x20 |
RESET_STACK | — |
0x30 |
CLEAR_FLAGS | — |
0x40 |
CONFIG | bit0 SATURATE, bit1 underflow→FAULT, bit2 forward-edge check |
0x50 |
SET_VIEW | view number |
For compressed instructions, send the 16-bit encoding in INST[15:0]. INST[23:16] is ignored.
uo_out, selected with SET_VIEW)| View | Value |
|---|---|
| 0 | {depth[3:0], lp_fault, underflow, overflow, fault} |
| 1, 2 | expected return address, low / high byte |
| 3 | fault count |
| 4 | lost frames |
| 5, 6 | last bad PC (not built in this tapeout: reads 0) |
| 7 | ID byte 0x5A |
| 8 | skipped checks (TRAP) |
0x50, 0x07 (SET_VIEW 7): uo_out should read 0x5A.0x50, 0x00 to show status. Then send a call and a correct return:
0x10, 0x00,0x01, 0xEF,0x00,0x00 (jal ra at PC 0x0100): status shows depth 10x10, 0x00,0x02, 0x67,0x80,0x00 (ret at PC 0x0200)0x10, 0x04,0x01, 0x13,0x00,0x00 (lands at 0x0104): no fault, depth 0traces/*.bin) and a MicroPython script (demo/rp2040_replay.py) that replays them
from the demo board's RP2040. The clean trace gives no fault. The attacked one sets
FAULT when the hijacked return lands on win().None required. The demo board's RP2040 acts as the trace host. LEDs on uio[3:5]
show the sticky flags, and the 7-segment display shows uo_out.
We gratefully acknowledge the Center of Excellence (CoE) in Integrated Circuits and Systems (ICAS) and the Department of Electronics and Communication Engineering (ECE) for providing the necessary resources and guidance.
Special thanks to Dr. H V Ravish Aradhya (HoD - ECE), Dr. K R Usha Rani (Associate Dean - PG), Dr. K. S. Geetha (Vice Principal) and Dr. K. N. Subramanya (Principal) for their constant encouragement and support in facilitating this Tiny Tapeout SKY26E submission.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | DATA[0] | READBACK[0] | STROBE (in) |
| 1 | DATA[1] | READBACK[1] | SOF (in) |
| 2 | DATA[2] | READBACK[2] | reserved (in, tie low) |
| 3 | DATA[3] | READBACK[3] | FAULT (out) |
| 4 | DATA[4] | READBACK[4] | OVERFLOW (out) |
| 5 | DATA[5] | READBACK[5] | UNDERFLOW (out) |
| 6 | DATA[6] | READBACK[6] | LP_FAULT (out, always 0 in this build) |
| 7 | DATA[7] | READBACK[7] | BUSY (out) |