You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A fully functional 5-stage pipelined RISC-V processor implementing the RV32I base integer instruction set with RV32M (Multiply/Divide) extension. Designed for simulation and FPGA deployment.
flowchart LR
subgraph IF[IF Stage]
PC[[PC]] --> ADD4["+4"]
PC --> IMEM[["IMEM"]]
ADD4 --> PC_MUX{{PC MUX}}
PC_MUX --> PC
end
subgraph ID[ID Stage]
CTRL["Control"]
IMM["Imm Gen"]
REG[["RegFile"]]
end
subgraph EX[EX Stage]
FWD_A{{Fwd A}}
FWD_B{{Fwd B}}
ALU[["ALU"]]
MULDIV[["MUL/DIV"]]
BRANCH["Branch"]
end
subgraph MEM[MEM Stage]
DMEM[["DMEM"]]
end
subgraph WB[WB Stage]
LOAD["Load Align"]
WB_MUX{{WB MUX}}
end
IF --> ID --> EX --> MEM --> WB
EX -.->|fwd| ID
MEM -.->|fwd| ID
WB -->|write| REG
BRANCH -->|taken| PC_MUX
Loading
Hazard Handling
┌─────────────────────────────────────────────────────────────────┐
│ Hazard Detection Unit │
├─────────────────────────────────────────────────────────────────┤
│ │
│ Load-Use Hazard: │
│ ┌──────┐ ┌──────┐ │
│ │ LOAD │───▶│ USE │ → Stall IF/ID for 1 cycle │
│ │ (EX) │ │ (ID) │ │
│ └──────┘ └──────┘ │
│ │
│ Data Forwarding: │
│ ┌──────┐ ┌──────┐ │
│ │ ALU │═══▶│ ALU │ → Forward from EX/MEM or MEM/WB │
│ │(MEM) │ │ (EX) │ │
│ └──────┘ └──────┘ │
│ │
│ Control Hazard: │
│ ┌────────┐ │
│ │ BRANCH │ → Flush IF/ID on branch taken │
│ │ TAKEN │ │
│ └────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘
Getting Started
Prerequisites
Simulation: Icarus Verilog (iverilog), Verilator, or any Verilog simulator
This project is part of the CS224 Computer Architecture coursework at IIT Guwahati.
Authors
Group 5 - CS224 Computer Architecture Lab
Arkadeb Manna
Mehul Raj
Ashutosh Kumar
Avanish Pandey
Aryan Gupta
Acknowledgments
IIT Guwahati, Department of Computer Science
RISC-V Foundation for the open ISA specification
About
A fully functional 5-stage pipelined RISC-V processor implementing the RV32I base integer instruction set with RV32M (Multiply/Divide) extension. Designed for simulation and FPGA deployment.