Computer architecture / RTL verification
Five-Stage Pipelined
MIPS Processor
A synthesizable 32-bit CPU, from instruction fetch to write back. A focused educational MIPS-style subset, not a complete MIPS32 implementation.
SystemVerilog · Icarus Verilog · Verilator · Yosys · GTKWave · Computer Architecture · RTL Verification
View on GitHub ↗
01 / Architecture
Five stages. One datapath.
- IFInstruction fetchPC + 4
- IDInstruction decodeRegister read
- EXExecuteALU · Branch resolution
- MEMMemory accessLoad · Store
- WBWrite backRegister write
Datapath & storage
A 32-bit datapath and 32-register register file, with register zero fixed at zero. Separate instruction and data memories avoid structural memory conflicts.
Four pipeline-register boundaries carry state between stages: IF/ID, ID/EX, EX/MEM, and MEM/WB.
Data dependencies
EX/MEM and MEM/WB forwarding supply both EX operands, including store data. WB-to-ID register-file write-through handles same-cycle reads and writes.
A one-cycle load-use stall holds fetch and decode while inserting a bubble into execution.
Control flow
Static predict-not-taken control flow keeps fetch moving sequentially. Branches and jumps are resolved in EX.
Taken redirects update the program counter and flush younger wrong-path instructions in IF and ID.
View the original project architecture diagram
02 / Verification
Checked against architectural state.
Results recorded in the project’s September 21, 2026 verification run.
- Simulated cycles
- 55
- Register checks passed
- 18
- Memory checks passed
- 2
- Total architectural state checks
- 20
- Load-use stall
- 1
- Control-flow redirects / pipeline flushes
- 3
- Cycles using operand forwarding
- 5
- Yosys structural problems
- 0
How it was verified
A self-checking SystemVerilog testbench executed directed instruction sequences and checked final register values, memory values, forwarding activity, load-use stalls, branch behavior, jumps, and suppression of wrong-path writes.
Yosys completed synthesis and its final structural check with zero problems. These results describe the directed test and structural checks; they are not a timing or area claim.
03 / Instruction set
A focused subset.
No exceptions, interrupts, delay slots, caches, multiplication/division, coprocessors, or virtual memory.
| Class | Instructions |
|---|---|
| Arithmetic | add, sub, addi |
| Logical | and, or, xor, slt |
| Memory | lw, sw |
| Control flow | beq, bne, j |
| Utility | nop |
04 / Implementation
Inside the RTL.
mips_pipeline_cpu.sv connects the pipeline, memories, and control flow. Dedicated modules implement the ALU, decoder, register file, forwarding, and hazard detection; mips_pipeline_tb.sv checks the complete processor.