Skip to content
GG
All projects

Sep 2026 – Present

RISC-V SoC with AXI4-Lite Bus

The next step after the pipelined core: a hand-written RV32I SoC where every fetch, load, and store goes over AXI4-Lite, progressing from simulation to an Artix-7 FPGA and a Tiny Tapeout ASIC.

RV32IAXI4-LiteArtix-7SKY130VerilogVerilatorC++PythonCocotb
SoC block diagram: core_top with a 5-stage pipeline, an AXI4-Lite instruction master and I-RAM, a one-request adapter, an AXI4-Lite data master and D-RAM, and a global bus stall back into the core

Extends the 5-stage pipelined processor. The goal is a full SoC with caches, CSRs, and FreeRTOS, first on an Artix-7, then taped out through Tiny Tapeout on SkyWater 130 nm.

Roadmap: phase 1 pipeline done, phase 2 AXI4-Lite in progress, phases 3 to 5 planned

What I learned

  • Passing tests is not the same as correct. The ISA suite stayed at 38/38 while every load and store hit the bus twice. Only a bus scoreboard with injected latency exposed it.
  • Keep the core memory-agnostic. The core exposes only a fetch port and a data port. Swapping BRAM for AXI, and later for caches, changes soc_top and nothing inside the CPU.
  • A stall must freeze everything. If flush is not masked during a bus stall, a taken branch in EX is lost while a slow fetch completes.
  • Handshakes need explicit states. AW and W are independent channels, so the master needs a state for each order in which they can finish.

Milestones

Oct 19 · ISA regression, two cores at 38/38

A Verilator C++ harness and a Python runner execute the official riscv-tests. A test passes only on ecall with a0 == 0. a0 starts as 0xDEADBEEF, so a run that stops early cannot pass, and a PC frozen for 1000 cycles is reported as a hang. The single-cycle core passed first, then the 5-stage pipeline with forwarding and load-use stalls.

Regression flow: riscv-tests binaries into a Verilator harness with pass, poison, and hang checks, a Python runner, and a passing result

Oct 24 · AXI4-Lite data master

A 5-state FSM turns the core’s one-cycle memory requests into valid/ready handshakes on all five channels. AW and W can complete in either order, and WSTRB comes from the core’s byte enables. A separate read-only master handles instruction fetch.

Data master FSM: IDLE, READ_DATA, WAIT_W, WAIT_AW, and WRITE_RESP

First write and read-back against a cocotb RAM, plotted from the simulation dump:

Waveform: write of 0x12345678 to 0x1000 with AW, W and B handshakes, then a read returning 0x12345678

Oct 25 · AXI4-Lite RAM slave

Three states. It takes AW and W together, gives writes priority over reads, and writes only the byte lanes set in WSTRB. Verified against cocotbext-axi bus models.

RAM slave FSM: IDLE, WRITE_RESP, and READ_RESP

Oct 31 · Whole SoC over AXI4-Lite

The core holds no memory. soc_top adds the two masters and two RAMs (diagram at the top), and a busy bus freezes all five stages while masking flush. Every fetch, load, and store now goes over the bus, still 38/38.

A latency-injecting RAM and a bus scoreboard then found a bug the ISA tests missed. With a slow fetch, each load or store hit the bus twice, which would print every UART character twice. A one-shot request gate fixed it.

Before: the stalled request repeats on the data bus. After: a done flag gates the request, giving zero extra transactions across four delay combinations

Next

UART and bare-metal C over MMIO, then M-mode CSRs with a CLINT timer for FreeRTOS, 2-way caches with AXI4 bursts, FPGA bring-up, and OpenLane sign-off.