Skip to content
Projects

RISC-V CPU

Systems / Spring 2023

5-stage pipelined processor with hazard detection and forwarding.

  • Logisim
  • RISC-V
  • Computer Architecture
RISC-V CPU interface

Overview

Designed a complete 5-stage pipelined RISC-V processor in Logisim for Berkeley's CS 61C. Instruction Fetch, Decode, Execute, Memory, Write-Back - the full datapath.

System design

Implemented data hazard detection with register forwarding to minimize pipeline stalls. When an instruction needs a value that's still being computed, forwarding routes it directly from the pipeline stage that has it instead of waiting for write-back.

Built control hazard handling with branch prediction and pipeline flushing. Simulated and debugged the entire processor in Logisim with comprehensive test coverage across all RISC-V instruction types.