How rahul-shahtp/pipelined-32-bit-riscv-processor works
This repository implements a five-stage pipelined RV32IM processor, from instruction fetch through writeback, with hazard handling, forwarding, branch resolution, and SRAM-backed data memory. The graph focuses on the documented runtime architecture and its major microarchitectural features. Source excerpts were not provided, so relationships are limited to those stated in the README.
Main entry points: id_to_ex_reg.v ID/EX Register · control_unit.v Decode Control · ex_to_mem_reg.v EX/MEM Register · branch_unit.v Branch Unit
Components 19
Instruction Fetch
- PC Logic
rtl/if_stage/pc_reg.v - Instruction Memory
rtl/if_stage/instr_mem.v - IF/ID Register
rtl/if_stage/if_to_id_reg.v
Decode Control
- Decode Control
rtl/id_stage/control_unit.v - Register File
rtl/id_stage/register_file.v - Immediate Generator
rtl/id_stage/imm_gen.v - Branch Unit
rtl/id_stage/branch_unit.v - Hazard Detection
rtl/id_stage/hazard_detection_unit.v - ID/EX Register
rtl/id_stage/id_to_ex_reg.v
Execute
- ALU
rtl/ex_stage/alu.v - Forwarding Unit
rtl/ex_stage/forwarding_unit.v - MUL/DIV Unit
rtl/ex_stage/mul_div_unit.v - EX/MEM Register
rtl/ex_stage/ex_to_mem_reg.v
Memory Access
- Data Memory
rtl/mem_stage/data_memory.v - SRAM Macro
rtl/mem_stage/sram_1kbyte_1rw1r_8x1024_8_bb.v - MEM/WB Register
rtl/mem_stage/mem_to_wb_reg.v
Writeback
- Writeback Mux
rtl/wb_stage/wb_mux.v
Other components
- Instruction Stream
- RV32IM Core
rtl/top/rv32im_top.v
Connections 25
- Instruction Stream → Instruction Memory: supplies instructions
README.md - RV32IM Core → PC Logic: integrates
README.md - PC Logic → Instruction Memory: selects instruction
README.md - Instruction Memory → IF/ID Register: passes instruction
README.md - IF/ID Register → Decode Control: passes instruction
README.md - Decode Control → Register File: controls reads
README.md - Decode Control → Immediate Generator: decodes immediates
README.md - Decode Control → Branch Unit: resolves branches
README.md - Hazard Detection → IF/ID Register: stalls pipeline
README.md - Hazard Detection → ID/EX Register: inserts bubble
README.md - Branch Unit → PC Logic: redirects fetch
README.md - Branch Unit → ID/EX Register: flushes control
README.md - Register File → ID/EX Register: passes operands
README.md - Immediate Generator → ID/EX Register: passes immediate
README.md - ID/EX Register → Forwarding Unit: provides operands
README.md - Forwarding Unit → ALU: forwards operands
README.md - ID/EX Register → MUL/DIV Unit: dispatches M ops
README.md - ALU → EX/MEM Register: passes result
README.md - MUL/DIV Unit → EX/MEM Register: passes result
README.md - EX/MEM Register → Data Memory: accesses memory
README.md - Data Memory → SRAM Macro: uses four macros
README.md - Data Memory → MEM/WB Register: passes load data
README.md - EX/MEM Register → MEM/WB Register: passes ALU result
README.md - MEM/WB Register → Writeback Mux: selects result
README.md - Writeback Mux → Register File: writes register
README.md