Course project · Digital design
RISC-V Single-Cycle CPU Design
A 32-bit RV32I processor in Verilog, from datapath to control unit, verified through simulation.
How it works
-
01
Fetch
The program counter addresses instruction memory.
-
02
Decode
Main decoder and instruction decoder generate the control signals.
-
03
Execute
The ALU runs arithmetic, logic and branch comparisons.
-
04
Memory
Load and store through the data memory.
-
05
Write-back
Results go back to the register file in the same cycle.
Overview
The goal was a fully working processor for the RV32I base instruction set, written in Verilog, with datapath and control designed together so that every instruction executes correctly within its timing.
Architecture
In a single-cycle design every instruction completes in one clock cycle. The core includes the Program Counter, ALU, Register File, Instruction and Data Memory, an immediate extender, and a control unit split into a main decoder and an instruction (ALU) decoder. The control signals configure the datapath for arithmetic, memory and branch operations.
Verification
A top-level testbench drives the core, and the results were checked with waveform analysis in GTKWave across all instruction types, confirming correct execution.
This core was also the foundation for the HDMI character display built on a full RISC-V SoC.
Tools & techniques
- Verilog
- RISC-V
- RV32I
- GTKWave
- Digital design