This repository contains the implementation of a RISC-V RV32I single-cycle processor written in SystemVerilog.
It was developed as part of my Design Verification (DV) Engineer training, with a focus on RTL design, verification, and computer architecture.
The processor implements the RV32I base instruction set architecture (ISA) of RISC-V.
It follows a single-cycle datapath design, where each instruction is fetched, decoded, executed, and completed in one clock cycle.
- β Supports RISC-V RV32I instructions
- β Single-cycle datapath
- β ALU supporting arithmetic and logic operations
- β Register file with 32 registers (x0βx31)
- β
Instruction memory (initialized from
instr.mem) - β Data memory for load/store instructions
- β Control unit for decoding instructions
- β Testbench included for simulation
riscv-single-cycle-processor/
β
βββ src/
β βββ rtl/ # RTL modules and top-level design
β β βββ alu.sv
β β βββ control\_unit.sv
β β βββ regfile.sv
β β βββ instr\_mem.sv
β β βββ data\_mem.sv
β β βββ top.sv
β β
β βββ tb/ # Testbench
β β βββ top\_tb.sv
β β
β βββ hex\_file/ # Instruction memory initialization
β βββ instr.mem
β
βββ README.md
# Compile RTL + TB
xvlog src/rtl/*.sv src/tb/*.sv
# Elaborate the top-level testbench
xelab top_tb -s top_sim
# Run the simulation
xsim top_sim --runallxrun -sv src/rtl/*.sv src/tb/*.svThe program to be executed is stored in hex format inside:
src/hex_file/instr.mem
This file is preloaded into the instruction memory during simulation.
- Add 5-stage pipelining (IF, ID, EX, MEM, WB)
- Implement branch prediction
- Add hazard detection and forwarding
- FPGA implementation on Nexys A7 board
- UVM-based verification environment
This project is for educational purposes as part of DV Engineer training. Feel free to fork and extend for your own learning.
Muddassir Ali Siddiqui
DV Engineer Trainee
NCDC Islamabad
