How gowthamaruthi/rv32i-single-cycle works
This repository is an educational, single-cycle RV32I SystemVerilog CPU with a Python instruction-level reference model. Its main workflow generates directed and seeded-random programs, simulates the RTL, and compares retirements, traps, registers, and memory against the model. The README also documents optional physical-implementation and UPF/output-isolation experiments. The hardware blocks follow the README architecture; sampled verification sources support the regression links. Physical and power implementation details are not sampled, so those branches are shown only at the documented subsystem level.
Main entry points: regress.py Regression runner · rv32i_core.sv ALU and branches · tb_core.sv Core testbench · programs.py Program generators
Components 16
CPU RTL
- RV32I core
rtl/rv32i_core.sv - Program counter
rtl/rv32i_core.sv - Decode and immediates
rtl/rv32i_core.sv - Register file
rtl/rv32i_core.sv - ALU and branches
rtl/rv32i_core.sv - Load and writeback
rtl/rv32i_core.sv
Verification
- Program generators
verification/programs.py - Reference model
verification/model.py - Regression runner
scripts/regress.py - Core testbench
tb/tb_core.sv - Comparison results
scripts/regress.py
Physical experiment
- Physical implementation
physical
Power experiment
- UPF isolation experiment
power
Other components
- Engineer
- Instruction memory
- Data memory
Connections 20
- Engineer → Regression runner: runs checks
README.md - Regression runner → Program generators: loads programs
scripts/regress.py - Regression runner → Reference model: steps reference
scripts/regress.py - Regression runner → RV32I core: compiles RTL
scripts/regress.py - Regression runner → Core testbench: compiles testbench
scripts/regress.py - Core testbench → RV32I core: simulates
- Regression runner → Comparison results: compares traces
scripts/regress.py - RV32I core → Program counter: updates
README.md - Program counter → Instruction memory: requests instruction
README.md - Instruction memory → Decode and immediates: supplies instruction
README.md - Decode and immediates → Register file: selects registers
README.md - Register file → ALU and branches: supplies operands
README.md - Decode and immediates → ALU and branches: supplies control
README.md - ALU and branches → Data memory: requests memory access
README.md - Data memory → Load and writeback: supplies load data
README.md - ALU and branches → Load and writeback: supplies result
README.md - Load and writeback → Register file: writes result
README.md - ALU and branches → Program counter: selects next PC
README.md - Engineer → Physical implementation: runs experiment
README.md - Engineer → UPF isolation experiment: runs experiment
README.md