How cshieldsce/riscv-5i works
riscv-5i is an RV32I processor implemented as a five-stage SystemVerilog pipeline and integrated with a PYNQ-Z2 FPGA board. Its principal workflow fetches instructions, decodes and executes them, accesses memory, and writes results back; documented pipeline features include forwarding, load-use stalling, and early JAL branch resolution. The README establishes the stages and major modules, but no RTL excerpts were provided, so the graph shows only relationships documented there, not detailed signal-level connections.
Main entry points: id_stage.sv Decode and register read · if_stage.sv Instruction fetch · pipelined_cpu.sv Pipeline controller · ex_stage.sv Execute
Components 18
CPU Pipeline
- Instruction fetch
src/if_stage.sv - Decode and register read
src/id_stage.sv - Execute
src/ex_stage.sv - Memory access
src/mem_stage.sv - Writeback
src/wb_stage.sv - Pipeline controller
src/pipelined_cpu.sv
Pipeline Support
- Instruction memory
src/instruction_memory.sv - Program counter
src/pc.sv - Control decoder
src/control_unit.sv - Register file
src/reg_file.sv - Immediate generator
src/imm_gen.sv - Arithmetic logic unit
src/alu.sv - Hazard handling
src/hazard_unit.sv - Forwarding logic
src/forwarding_unit.sv - Data memory
src/data_memory.sv
FPGA Platform
- PYNQ-Z2 integration
src/pynq_z2_top.sv
Other components
- Program instructions
- Memory-mapped LEDs
Connections 17
- Program instructions → Instruction fetch: provides instructions
README.md - Instruction fetch → Decode and register read: pipeline stage
README.md - Decode and register read → Execute: pipeline stage
README.md - Execute → Memory access: pipeline stage
README.md - Memory access → Writeback: pipeline stage
README.md - Pipeline controller → Instruction fetch: coordinates pipeline
README.md - Instruction fetch → Instruction memory: fetches from
- Instruction fetch → Program counter: uses
- Decode and register read → Control decoder: decodes with
- Decode and register read → Register file: reads registers
- Decode and register read → Immediate generator: generates immediates
- Execute → Arithmetic logic unit: executes with
- Pipeline controller → Hazard handling: handles stalls
README.md - Pipeline controller → Forwarding logic: forwards values
README.md - Memory access → Data memory: accesses memory
- PYNQ-Z2 integration → Pipeline controller: integrates core
- PYNQ-Z2 integration → Memory-mapped LEDs: drives via mapped register
README.md