How gzhy5111/cpu works
This repository is an incremental Verilog implementation of a MIPS CPU, with chapter directories recording successive feature additions. The documented workflow advances an instruction through fetch, decode, execute, and memory access; later versions add forwarding, arithmetic, HI/LO operations, pipeline stalls, and multi-cycle multiplication and division. The graph uses the latest relevant chapter paths as representative implementations. Source excerpts were unavailable, so edges are limited to relationships stated in the README; detailed module wiring is not verified.
Main entry points: ex.v Execute · openmips.v OpenMIPS Core · id.v Decode · div.v Division Unit
Components 15
CPU Pipeline
- Fetch
codes/Chapter7_3/pc_reg.v - Decode
codes/Chapter7_3/id.v - Execute
codes/Chapter7_3/ex.v - Memory Stage
codes/Chapter7_3/mem.v - Data Forwarding
codes/Chapter5/ex.v - Pipeline Stall
codes/Chapter7_1/ctrl.v - OpenMIPS Core
codes/Chapter7_3/openmips.v
CPU State
- Register File
codes/Chapter7_3/regfile.v - HI/LO Registers
codes/Chapter7_3/hilo_reg.v
Arithmetic Features
- Integer Arithmetic
codes/Chapter7_3/ex.v - Division Unit
codes/Chapter7_3/div.v - Division Control
codes/Chapter7_3/div_fsm.v
Instruction Programs
- MIPS Programs
codes/Chapter7_3/AsmCode - Instruction ROM
codes/Chapter7_3/inst_rom.v
Other components
- CPU Author
Connections 10
- CPU Author → MIPS Programs: writes programs
README.md - Fetch → Decode: fetch then decode
README.md - Decode → Execute: decode then execute
README.md - Execute → Memory Stage: execute then access
README.md - MIPS Programs → Instruction ROM: assemble for ROM
- OpenMIPS Core → Data Forwarding: uses forwarding
README.md - OpenMIPS Core → Pipeline Stall: uses stalls
README.md - Execute → HI/LO Registers: uses HI/LO
README.md - Execute → Division Unit: performs division
README.md - Division Unit → Division Control: multi-cycle control