Part 5 · RISC Microarchitecture · levels 48–67
The fifth part is RISC Lab: you build a 32-bit RISC processor on the RV32I teaching subset in Verilog and take it to a five-stage pipeline — with forwarding, load bubbles and wrong-path flushes that you detect and resolve yourself.
Open in the game →Course curriculum
The main ideas of the part
- A register file instead of an accumulator: 32 registers x0–x31, x0 is always zero; every instruction names its operands explicitly — rs1, rs2 and rd.
- The RV32I teaching subset: 32-bit instructions and data, the R/I/S/B/U/J formats, 26 instructions. Memory is reachable only through lw/sw.
- The control unit, forwarding unit and hazard unit are Verilog blocks you write yourself: you state the "hazard" and the "bubble" in terms of signals.
- Five stages IF—ID—EX—MEM—WB: one instruction walks through all five while its neighbour already stands on the next one.
- The engineering trade-off: the pipeline is measured by two metrics — CPI and the cost of the circuit (delay, gate count).
What you will have built by the end
By the end of the part you will have a pipelined RISC core: the single-cycle RV32I core sliced into five stages with forwarding, the load bubble and branch flush — and the same "Knight Rider" LED program that closed the single-cycle arc, now on the pipeline, with a ZIP export for the Tang Nano 9K.
Levels of the part
- 48. Farewell, Accumulator! Open in the game →
- 49. Anatomy of an R-type Instruction Open in the game →
- 50. A 32-bit ALU Open in the game →
- 51. A Constant Inside the Instruction Open in the game →
- 52. Memory by the Rules Open in the game →
- 53. A Step of Four Open in the game →
- 54. A Loop on BNE Open in the game →
- 55. Array Sum Open in the game →
- 56. Call and Return Open in the game →
- 57. Nested Calls and the Stack Open in the game →
- 58. Assembling RV32I Open in the game →
- 59. Knight Rider RISC Open in the game →
- 60. The Verification Lab Open in the game →
- 61. Why the Cycle Is Long Open in the game →
- 62. Between Stages Open in the game →
- 63. Five Instructions in Flight Open in the game →
- 64. The Short Path Open in the game →
- 65. The Load Bubble Open in the game →
- 66. Ghosts of the Wrong Path Open in the game →
- 67. Knight Rider Pipeline Open in the game →
Each level number leads to its library guide; "Open in the game" goes straight to the level in the simulator.
Up next: the Verilog and FPGA hub →