Computer Organisation and Architecture · Pipeline Performance
Efficiency/Utilization from Phase-Time Diagram for a Given Load
Overview
Once a pipeline reaches steady state its CPI is 1, but CPI alone does not measure how good the pipeline is.
Pipeline performance is judged by speedup (how much faster than sequential execution) and utilization/efficiency (the fraction of the pipeline's space-time slots doing useful work).
Efficiency is always stated for a given load, and it is computed from the phase-time (space-time) diagram for that load.
Key concepts
- Speedup – how much faster the pipeline is than a non-pipelined (sequential) execution.
- Utilization / Efficiency – the fraction of the pipeline's space-time slots that are actually doing useful work.
- Given load – efficiency depends on the number of instructions : the same pipeline has a different efficiency for 9 instructions than for 100, so efficiency must always be quoted for a specific load.
- Phase-time diagram (space-time diagram) – rows are pipeline stages (phases), columns are clock cycles (time), and each box is one stage occupied by an instruction in one cycle.
- Fill-up and drain staircases – the pipeline fills gradually, not instantly: instruction I2's first stage cannot start until I1 has moved out of that stage, so the leading edge of the diagram is a staircase; the same staircase appears at the end as the pipeline drains.
All these boxes are wasted.
How it works
For a load of 9 instructions on a 4-stage pipeline (each instruction takes 4 phases/cycles):
- Draw the diagram with 4 rows (one per stage) and 12 columns (clock cycles).
The first instruction finishes at cycle 4, and each of the remaining 8 instructions finishes one cycle later, so the last instruction finishes at cycle . - Count total slots (boxes) = rows × columns = .
- Count wasted boxes: 6 at the start (fill-up staircase) + 6 at the end (drain staircase) = 12.
- Used boxes = .
- Efficiency = used slots / total slots = (75%).
Formulas
-
Total slots , where = number of stages and = load (number of instructions); the number of cycles in the diagram is .
-
Wasted slots (the two triangular staircase regions, each of size ).
-
Used slots (each of the instructions uses all stages exactly once).
-
Efficiency (utilization) .
-
Speedup (for a given load) , where time without pipelining cycles and time with pipelining cycles.
-
Phase-time diagram for 9 instructions
Drawing the diagram…
- Space-time diagram showing the fill-up staircase at the start, steady state, and the drain staircase at the end for 9 instructions on a 4-stage pipeline.
Worked examples
9 instructions, 4-stage pipeline
- Step 1: Count the diagram: 4 rows × 12 columns → total boxes .
- Step 2: Count unused boxes: 6 at the start (fill-up staircase) + 6 at the end (drain staircase) = 12.
- Step 3: Used boxes .
- Step 4: Efficiency .
- Check with the formula: . ✓
Comparison
| Quantity | Without pipelining | With pipelining (, ) |
|---|---|---|
| Cycles needed | ||
| Slots used | 36 | 36 |
| Slots available | 36 | 48 |
| Efficiency | 100% |
Revision summary
- Pipeline performance = speedup and utilization/efficiency;
CPI = 1 in steady state is not enough by itself. - Efficiency is always quoted for a given load (e.g. "for 9 instructions the efficiency is 3/4").
- Total slots = rows × columns of the phase-time diagram ( here).
- The pipeline fills gradually; the staircase boxes at the start and end are wasted ( here).
- Efficiency = used slots / total slots .
- Speedup = time without pipelining / time with pipelining, computed from the same diagram.
Previous-year exam insights
- For an ideal equal-stage pipeline, efficiency E and speedup S satisfy S = k × E (because S = nk/(k+n−1) and E = n/(k+n−1));
this allows one to obtain speedup from utilization or vice versa. - As the load n → ∞, efficiency → 1 and speedup → k (the number of stages); for every finite n, efficiency < 1 and speedup < k, so a k-stage pipeline never reaches speedup k for a finite instruction stream.
- Average CPI for n instructions on an ideal k-stage pipeline is (k+n−1)/n = 1 + (k−1)/n;
throughput is n/[(k+n−1)], tending to 1/ in steady state ( = clock period). - Hazards, stalls or bubbles add idle cycles: real time = ideal (k+n−1) + stall cycles, efficiency = useful stage-cycles / total stage-cycles falls, and CPI rises above 1.
- The simple k-stage formulas assume equal stage delays;
with unequal delays the clock period is set by the slowest stage, so speedup = n Σ / [(k+n−1) max ] and balanced stages maximize speedup. - For a single instruction (n = 1), pipelining gives no speedup and efficiency = 1/k;
both speedup and efficiency improve as the number of instructions increases.