Skip to content

steven-mu12/RISC-V-Pipelined-Datapath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISC-V 5-Stage Pipelined Datapath

This repository contains the design and implementation of a 5-stage, in-order, pipelined RISC-V processor datapath, written entirely in Verilog. The design was functionally verified in simulation and validated on a PYNQ FPGA platform.

The project focuses on core microarchitectural concepts including pipelining, hazard handling, and memory interfacing.

datapath

What I'm Working On Now

  • Adding caches / memory levels
  • Adding a proper control logic unit, instead of just pipelining all signals
  • Attempting to make this superscalar & implementing a P10K based dynamic scheduling algorithm

Architecture Overview

The processor implements a classic 5-stage RISC pipeline:

  1. IF – Instruction Fetch
  2. ID – Instruction Decode & Register Fetch
  3. EX – Execute / ALU
  4. MEM – Data Memory Access
  5. WB – Write Back

The datapath is fully in-order and supports parallel instruction execution via pipelining.

Key architectural features:

  • Pipeline registers between all stages
  • Data forwarding to resolve RAW hazards
  • Hazard detection and pipeline stalling
  • Separate instruction and data memories
  • Synchronous register file with dual read ports

Implemented Features

  • 5-stage in-order pipelined datapath
  • Data forwarding for ALU and memory dependencies
  • Hazard detection with pipeline stalls
  • Separate instruction and data memories
  • Modular Verilog design with clear stage separation
  • Comprehensive testbenches for functional verification

Verification & Testing

  • Functional verification performed using xsim
  • Custom testbenches written to validate:
    • Instruction execution
    • Pipeline behavior
    • Hazard detection and forwarding paths
  • Hardware testing conducted on a PYNQ FPGA, validating correct execution in real hardware

Toolchain

  • Verilog HDL
  • Xilinx Vivado
  • xsim for simulation
  • PYNQ FPGA for hardware validation

Notes

This project emphasizes understanding, and learning how a simple datapath does things, rather than full ISA completeness.

About

A RISC-V pipelined datapath, featuring support for majority of instructions, as well as advances features such as data forwarding and hazard detection.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors