Skip to content

A SystemVerilog implementation of a single-cycle RISC-V processor supporting RV32I ISA. Features modular design with instruction fetch, decode, ALU, and memory stages. Ideal for FPGA prototyping, computer architecture studies, and educational projects. Synthesizable codebase for hobbyists and developers exploring processor design.

Notifications You must be signed in to change notification settings

Ali-975/risc-v_single_cycle_processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

risc-v_single_cycle_processor

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.


πŸ“š Overview

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.


πŸš€ Features

  • βœ… 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

πŸ“‚ Repository Structure


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


▢️ Simulation Guide

πŸ”Ή Using Xilinx Vivado

# 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 --runall

πŸ”Ή Using Cadence Xcelium

xrun -sv src/rtl/*.sv src/tb/*.sv

πŸ”Ή Instruction Memory

The 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.


πŸ–ΌοΈ Datapath Diagram (Conceptual)

RISC-V Single Cycle Datapath


πŸ“Œ Future Improvements


πŸ“œ License

This project is for educational purposes as part of DV Engineer training. Feel free to fork and extend for your own learning.


✍️ Author

Muddassir Ali Siddiqui

DV Engineer Trainee

NCDC Islamabad

About

A SystemVerilog implementation of a single-cycle RISC-V processor supporting RV32I ISA. Features modular design with instruction fetch, decode, ALU, and memory stages. Ideal for FPGA prototyping, computer architecture studies, and educational projects. Synthesizable codebase for hobbyists and developers exploring processor design.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published