5.2.9 · D1Processor Datapath & Pipelining

Foundations — Pipeline throughput and CPI

1,975 words9 min readBack to topic

This page builds every piece of vocabulary the parent note Pipeline throughput and CPI leans on. We start from "what is a clock tick?" and stop only when you can read every symbol in the parent without pausing.


1. The clock and the clock period

Look at the top of the figure below: the square wave rising and falling. The width of one full up-and-down box is . Count how many boxes fit in one second, and that count is .

Figure — Pipeline throughput and CPI

Why the topic needs this. Every performance number in the parent — throughput, speedup — is ultimately "work done per second". Since the processor only does work on clock ticks, we must know how long a tick lasts. That is why appears in .


2. An instruction and its stages

To run one instruction the processor does several jobs in order. The classic split is 5 stages, each with a two-letter name:

In the figure below, one instruction is a horizontal strip cut into these 5 coloured blocks. Each block is one job. The delay of a stage is written as — the time that one job needs. The parent writes them as .

Figure — Pipeline throughput and CPI

Why the topic needs this. The pipeline clock period is . You cannot read that line unless you know that is a per-stage time and is the hand-off cost.


3. max and Σ — two ways to combine the stage times

The parent uses two symbols that "fold a list of numbers into one number". They answer opposite questions.

The next figure shows the same five stage-bars twice: on the left, points only at the tallest bar; on the right, stacks all bars end-to-end into one long bar.

Figure — Pipeline throughput and CPI

4. Overlapping instructions — reading a pipeline diagram

Now put many instructions on the assembly line at once. Each instruction is a row; time runs left to right in clock ticks. Because station IF is free the moment instruction 1 moves to ID, instruction 2 can enter IF right behind it. The rows slide diagonally.

Figure — Pipeline throughput and CPI

Read the figure carefully:

  • The fill-up stretch is the first few ticks where the line is not yet full (only some stations busy).
  • Once full, exactly one instruction finishes each tick — that is the whole point.
  • Running instructions through a -stage line takes ticks: ticks to push the first one all the way through, then one extra tick for each of the remaining .

5. CPI, IPC and throughput — the three scoreboards

Now every symbol above lets us define the parent's headline quantities.


6. Hazards, stalls and bubbles — why real CPI is above 1

Why the topic needs this. The whole second half of the parent is about pushing back down toward 1 — using forwarding to erase data stalls and better branch prediction to erase control stalls, and superscalar designs to push CPI below 1 entirely.


7. Speedup — comparing the two worlds

Notice this is exactly the " over " idea from Section 3 — now you can read the formula and know every symbol in it. This connects straight to raw CPU performance metrics.


Prerequisite map

Clock period T and rate f

Throughput = 1 over T times CPI

Instruction split into k stages

Stage delays t_i and t_reg

max gives T_pipe, sum gives T_single

Speedup = sum over max

Overlap diagram: one finish per tick

CPI, IPC, IPS definitions

Hazards cause stalls and bubbles

CPI_actual = 1 plus stalls


Equipment checklist

Test yourself — reveal only after you have answered aloud.

If a clock runs at 2 GHz, what is its period in picoseconds?
ps.
What does stand for, and what does add on top?
is the delay of stage ; is the extra time the pipeline register needs to latch the hand-off between stages.
What does compute, and why does the pipeline care about it?
The single largest stage delay; all stages tick together so the slowest one sets the clock period .
What does compute, and which non-pipelined time does it equal?
The sum of all stage delays end-to-end; it equals the single-cycle period .
Why does CPI approach 1 as ?
Total ticks ; dividing by gives when is far larger than .
State the relationship between CPI and IPC.
They are reciprocals: .
Write throughput in terms of and CPI.
.
What is a bubble and what does it do to throughput?
A NOP inserted during a stall; no instruction completes that tick, so throughput falls.
What is the formula for ?
.
Speedup equals which ratio of two combined stage-time expressions?
over — the sum divided by the max plus register overhead.