5.2.11 · D1Processor Datapath & Pipelining

Foundations — Deep pipelining trade-offs

2,338 words11 min readBack to topic

0. The picture everything sits on: the assembly line

Before any symbol, look at what a pipeline is.

Figure — Deep pipelining trade-offs

Each instruction (a car body) moves left to right through fixed stations (stages). At every clock tick, everybody shifts one station to the right at the same instant. The red car is the one we follow; the black cars behind it are already being worked on too. That "everybody at once" is the whole trick — while one instruction is being decoded, another is being fetched.

Everything below is a number that describes this picture.


1. Time per tick:

The picture: in the assembly-line figure, is the length of the pause between shifts. Make it shorter → cars move more often → more cars finish per second.

Why the topic needs it: the entire game of deep pipelining is shrinking . Every trade-off is ultimately "did get smaller, and at what cost?"

Because all stations shift together, they all get the same amount of time. So can be no shorter than the slowest station needs — a chain is as slow as its slowest link.


2. Ticks per second: and why

Why this exact formula? If each tick takes seconds, then in one whole second you fit This is just "how many 2-ns gaps fit in 1 second?" — it is not physics, it is counting. We use the reciprocal (one-over) because "time per event" and "events per time" are always reciprocals, the way "seconds per lap" and "laps per second" are.

Why the topic needs it: designers advertise frequency, but frequency is only a disguised statement about cycle time. When the parent says "more stages → higher ", it literally means "thinner stages → smaller ".


3. Work in one stage: (the "combinational delay")

The picture: inside each station, signals ripple through logic gates like dominoes falling. is how long the last domino takes to fall.

Figure — Deep pipelining trade-offs

Why a Greek letter? Just tradition — engineers reserve for "a small delay". No hidden meaning; treat it as "the letter for one stage's think-time".

Why the topic needs it: splitting one big station into two means each half has a smaller . Smaller → shorter cycle → higher . This is the entire motivation for going deeper.


4. The glue between stations: pipeline registers and

Here is the hidden cost the assembly-line picture didn't show. Between two stations there is a holding shelf that grabs a stage's result and holds it steady so the next stage can read it cleanly.

Figure — Deep pipelining trade-offs

That shelf is not instant. It costs time made of three pieces:

Why the topic needs it — the crucial one: is a fixed cost that does not shrink when you add stages. shrinks as you split; does not. So the real cycle time is and no matter how thin you slice, you can never get below . This one fact is the wall the whole parent note circles around.


5. Counting stations: and the total work

Before we can say what happens as grows, we need a name for "the whole job" that the stages together perform.

The picture: is the full length of the domino chain from §3 before you cut it into stations. Cut it into equal pieces and each piece is long.

Why the topic needs it: with named, we can write cycle time as a function of depth . Read as "the cycle time you get when you choose stages" — the parentheses just mean " depends on ", the way "" means price depends on weight.

As grows the first term melts toward zero and — the register floor. That limit is why "deeper" stops helping.


6. Work per tick, and total throughput: CPI and

Frequency alone lies, because not every tick does useful work. We need a second number.

The picture: picture the assembly line hiccupping — sometimes a station has to freeze (a bubble, an empty slot) while waiting. Each frozen tick is a wasted cycle spread across the instructions, raising CPI above the ideal .

Now we can name the thing we actually care about — instructions finished per second.

Why the topic needs it: deep pipelines raise but also raise CPI (more hiccups). If both rise by the same factor, is unchanged — you gain nothing, exactly the Pentium 4 story. is the accountant that catches the hidden losses. The causes of those hiccups have their own note: Pipeline Hazards.


7. Why hiccups get worse when deep: the flush penalty

Figure — Deep pipelining trade-offs

The picture: a wrong guess means every car currently on the line behind the branch is scrapped. A 5-station line scraps up to 4 cars (); a 20-station line scraps up to 19 (). Longer line → far bigger loss per wrong guess. This is why CPI climbs with and why branch prediction accuracy matters so much in deep pipelines.


8. The power symbols: , , ,

Why this shape? Each switch moves an energy (filling a bucket of size to pressure costs energy growing with ), and it happens times per second — energy per event times events per second = power. The is why voltage is the strongest lever, tied to Dynamic Voltage and Frequency Scaling (DVFS).

Why the topic needs it: deep pipelines push up and add sets of registers (more ), so power climbs on two fronts. This is the thermal wall Pentium 4 slammed into.


The prerequisite map

Assembly line picture: stages

Tcycle: time per tick

tau: work in one stage

Pipeline register: t_reg overhead

f = 1 over Tcycle

Tcycle = tau + t_reg

k: number of stages

T0: total logic work

Penalty_misp = k minus 1

CPI: cycles per instruction

R throughput = f over CPI

P_dynamic = C V squared f

Deep pipelining trade-offs

Read it top-down: the picture spawns the timing symbols; timing gives ; depth and total work feed both the timing floor and the hazard cost; and CPI combine into throughput ; the whole thing meets the power ceiling — and that collision is the topic.


Equipment checklist

Cover the right side and try to answer each before revealing.

What does measure, and what sets its minimum?
The time between two clock ticks; its minimum is set by the slowest single stage's delay plus register overhead.
Why is rather than something else?
Because "ticks per second" is the reciprocal of "seconds per tick" — pure counting, like laps/second vs seconds/lap.
What is and what makes it shrink?
The useful logic delay inside one stage; splitting a stage into more, thinner stages shrinks each stage's .
What is and how does it relate to ?
The total logic delay of the whole instruction in one un-split block; splitting it into equal stages gives .
What three pieces make up , and why won't it shrink with depth?
; it is a fixed per-register tax paid every stage no matter how thin the stage.
Write the real cycle time in terms of and .
.
As with fixed total work , what does approach?
— the register floor; deeper cannot beat it.
What does CPI equal for a perfect pipeline, and why does it rise in deep pipelines?
ideally; it rises because deeper pipelines suffer bigger stalls and flushes (bubbles).
How large is the misprediction penalty and why does depth hurt?
cycles; a longer pipe holds more wrongly-fetched instructions to scrap on a wrong guess.
Why does raising frequency raise power roughly quadratically?
: power scales with directly and with voltage squared, and voltage often must rise to hit higher .
Combine and CPI into the one true throughput measure .
— frequency alone can lie if CPI worsens.