Pipelining

#folder

Example

Analogy: doing laundry.

There are 4 Steps to doing 1 load of laundry:

  1. Wash
  2. Dry
  3. Fold
  4. Put away

How should we do 3 loads of laundry?

Since we don't need the washing machine for any steps after than step 1, we can just use it again. The same principle applies to the other stages.

Observations:

Non-pipelined (single-cycle) processor

Diagram

$$t_{\text{cycle}} = 0.8 \mathrm{ns}, CPI = 1$$

Pipelined Processor

Diagram

When the pipeline is full: $$t_{\text{cycle}} = 0.2 \mathrm{ns}, CPI = 1$$
Remark

  • The cycle time must long enough for the slowest stage
  • Since we have 5 datapath stages, the pipeline takes 4 cycles to fill up

Filling Time

Equation

where

Speedup

Speedup (IC = 3): using the diagram, we can calculate

If only given numbers:

Because the pipeline was filling in cycles 1-4, we don't exactly have . If we increase the instruction count, the filling overhead is negligible:

Speedup if :