Dynamic scheduling is a hardware technique used in pipelined processors to reorder instructions at runtime to maximize instruction-level parallelism (ILP) while avoiding hazards.
Unlike static scheduling (done by the compiler), dynamic scheduling is performed by the hardware at execution time, allowing instructions to execute out of program order as long as data dependencies are respected.
Dynamic pipelines rely on hardware mechanisms to track hazards and ensure precise exceptions.
Minimize pipeline stalls caused by:
Exploit instruction-level parallelism (ILP) beyond what static scheduling can achieve.
Support out-of-order execution while maintaining program correctness.
Famous dynamic scheduling algorithm that uses:
Consider the following instructions:
I1: R1 = R2 + R3
I2: R4 = R1 + R5
I3: R6 = R7 + R8
Pipeline Execution Order (dynamic):
Cycle 1: I1 fetch
Cycle 2: I1 execute, I3 fetch
Cycle 3: I3 execute, I2 waits (R1 not ready)
Cycle 4: I2 execute (after R1 ready)
Dynamic scheduling reduces idle cycles by reordering instructions on the fly.
Hardware complexity:
Power and area overhead in CPU design.
Precise exception handling is more complex.
| Feature | Static Scheduling | Dynamic Scheduling |
|---|---|---|
| When scheduling occurs | Compile-time | Runtime (hardware) |
| Complexity | Compiler-dependent | Hardware-dependent |
| Flexibility | Fixed at compile-time | Adapts to runtime hazards |
| Hazard handling | Compiler must avoid or reorder instructions | Hardware dynamically resolves hazards |
| ILP Exploitation | Limited by compiler | Higher, runtime optimizations possible |
| Examples | Loop unrolling, software pipelining | Tomasulo’s algorithm, scoreboarding |
Dynamic Scheduling: Hardware reorders instructions at runtime to exploit ILP while avoiding hazards.
Mechanisms include:
Goal: Keep pipelines busy, reduce stalls, support out-of-order execution.
Open this section to load past papers