This project implements an out-of-order RISC-V CPU using Tomasulo's algorithm for dynamic instruction scheduling. The design allows instructions to execute as soon as their operands are ready, rather than waiting in strict program order, improving performance through instruction-level parallelism.
- Support for RV32I instruction set.
- Out-of-order execution using Tomasulo's algorithm.
- Multiple functional units operating in parallel (ALU, Multiplier, Divider, Memory).
- Dynamic branch prediction with gshare predictor.
- Register renaming through the reservation station tagging system.
- Common Data Bus (CDB) for result broadcasting.
Tomasulo's OOO scheduling algorithm hardware structure:
The algorithm supports:
- Dynamic instruction scheduling - instructions execute when ready, not in program order.
- Register renaming via tagging - architectural registers mapped to ROB entries/reservation station tags to eliminate false dependencies.
- Speculative execution - Uses gshare branch predicotr for predicting the branch targets.
- Precise exceptions - maintains ability to handle interrupts correctly.
- Instruction Fetch (IF) - Fetches instructions with branch prediction.
- Issue (IS) - Decodes instructions and issues to reservation stations.
- Execute (EX) - Out-of-order execution in functional units.
- Commit (WB) - In-order commit via reorder buffer.
- ALU Unit: Single-cycle arithmetic and logic operations.
- Multiplier Unit: Multi-cycle Booth multiplication algorithm.
- Divider Unit: Multi-cycle non-restoring division algorithm.
- Memory Unit: Load/store operations with single-cycle memory access.
- Reservation Stations: Buffer instructions waiting for operands (4 ALU, 2 MUL, 2 DIV, 4 MEM).
- Reorder Buffer: Maintains program order for in-order commit.
- Branch Prediction: gshare predictor with global history register.
- Register Status: Tracks which instructions will write to each register.
- Data Forwarding: Multiple forwarding paths to reduce pipeline stalls.