All projects

riscv-5i

Finished 2026

A 5-stage pipelined RISC-V core in SystemVerilog, checked against the RISCOF compliance suite, running on a Zynq-7000 and taken through a Sky130 layout.

Chip layout render of the core on Sky130, with routing on metal 2 through 5 and the power grid as long straight stripes

The core

The classic Patterson and Hennessy pipeline: fetch, decode, execute, memory, writeback, with full forwarding, load-use stalling and early resolution of JAL. It implements RV32I and passes all 482 RISCOF compliance tests against Spike.

Result Value
Compliance 482 of 482 RISCOF RV32I tests against Spike
FPGA Zynq-7000 on a PYNQ-Z2, 10 MHz, positive slack
Resources 1972 LUTs (3.7%) and 3326 flip-flops
Sky130 layout 0.247 mm^2, DRC and LVS clean, 27.8 MHz at every corner

I scoped it to RV32I and stopped there: no M extension, no CSRs (SYSTEM and FENCE decode as NOPs), no caches, no exceptions or interrupts. Memory is one flat region with a memory-mapped LED register. The Sky130 run is clean on DRC and LVS and closes timing at every corner, but about 4200 max-slew violations are still flagged at the slow corner. They don’t break timing at 36 ns.

Vivado timing summary at 10 MHz
Utilization on the Zynq-7000

The riscv-5i datapath: five pipeline stages with forwarding paths and hazard logic

A Fibonacci program running on the PYNQ-Z2. The four LEDs show each value mod 16.

Three choices worth a look

The timing diagrams for every hazard case are on the original docs site.

Articles

  1. Architecture
    The datapath, the five stages and the design tradeoffs behind them.
  2. Pipeline stages
    What each stage does and why the logic looks the way it does, with the RTL.
  3. Running on the FPGA
    What synthesis cost, where timing closed and the demo running on a PYNQ-Z2.
  4. Verification
    The RISCOF compliance matrix, the regression set and a branch bug found with a Vivado ILA.
  5. Unit-level cocotb testbenches
    Testbenches for the ALU and the hazard unit, with functional coverage.
  6. Running the core through Sky130
    Taking the core through an open source RTL-to-GDSII flow, with timing closed at every corner at 27.8 MHz.
  7. Setup
    Toolchain install, build and simulation steps.

Source on GitHub