
RQPU v2 is a reversible-computing-inspired 4-bit processor for Tiny Tapeout.
It runs a deterministic 4-phase loop:
class, mode, func)A, B)The core includes:
RAM[0:3])ACC, BREG, SHD, FLAGS, MAR, MDR, OUT, TMP0, TMP1, EXT0, EXT1, and previous-state mirrors)The reversible behavior uses compact checkpoint metadata so REVERSE performs a single-step undo of recent architectural changes.
The easiest way to understand the machine is to look at one host-issued operation.
ACC = 6, then add 36 into ACCIssue a CLS_SYS / LOADIMM operation with:
CLS_SYS00x0A = SYS_ACCB = 0x6After P3_OUTPUT, out_q = 6, ACC = 6, and Z = 0.
3Issue a CLS_ALU / ADD with:
CLS_ALU00x0A = 0x0 (unused in immediate mode)B = 0x3After P3_OUTPUT, the core presents:
out_q = 9ACC = 9Z = 0C = 0If you:
ACC = 4BREG = ACLS_REV ACC <-> BREGthen ACC becomes A and BREG becomes 4, and the operation snapshots the old state first.
If you then issue CLS_REV REVERSE, the machine swaps current and previous snapshots, restoring ACC = 4.
That is exactly the behavior the supplied testbench checks.
The public bus contract is:
uo_out[7:6] = phase[1:0]uo_out[5:2] = result/data nibbleuo_out[1] = Zuo_out[0] = CInput protocol:
ui_in[7:5]=class, ui_in[4]=mode, ui_in[3:0]=funcui_in[7:4]=A, ui_in[3:0]=BIn cocotb:
Current tests are under test/test.py and verify:
No external hardware is required. For live demos, a small MCU/FPGA controller can drive phase-aware transactions on ui_in and sample uo_out at phase 11.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | func[0] / B[0] | C flag | |
| 1 | func[1] / B[1] | Z flag | |
| 2 | func[2] / B[2] | result/data[0] | |
| 3 | func[3] / B[3] | result/data[1] | |
| 4 | mode / A[0] | result/data[2] | |
| 5 | class[0] / A[1] | result/data[3] | |
| 6 | class[1] / A[2] | phase[0] | |
| 7 | class[2] / A[3] | phase[1] |