5 Pipelining
5 Pipelining
Pipelining
Basic Computer Architecture
What is computer architecture
Instruction set architecture
What to do
Computer organization
How to do (Data path and Control)
Instruction 1
Instruction 2
Instruction 3
Original
Improved
Four loads:
Speedup
= 8/3.5 = 2.3
Chapter 4 — The Processor — 7
Pipelining vs Performance
What is performance ?
Latency or response time
How long it takes to do a single task
Throughput
Total work done (all tasks) per unit time
Pipelining increases latency or throughput ?
Only throughput
Focus on 8 inst.:
lw, sw, add, sub, AND, OR, slt, beq
read write
(right shaded) ALU (left shaded)
White background
because add does not access memory
𝐶𝐶 = 9
𝐶𝐶 =104
sw $t3, 12($t0)
lw $t4, 8($t0)
stall
sw $t5, 16($t0)
13 cycles
Chapter 4 — The Processor — 29
(3)Code Scheduling to Avoid Stalls
sw $t3, 12($t0)
sw $t5, 16($t0)
11 cycles
Stall 3 cycles
Stall 1 cycle
Chapter 4 — The Processor — 34
Control Hazards: (3) Branch Prediction
Prediction correct
i.e. branch not taken
Prediction incorrect
i.e. branch taken
http://www.edumips.org
http://www.ecs.umass.edu/ece/koren/architecture/windlx/main.html
Chapter 4 — The Processor — 37
Pipeline Summary
Pipelining improves performance by
increasing instruction throughput
Executes multiple instructions in parallel
Each instruction has the same latency
Pipelining hazards
Structure, data, control
Instruction set design affects complexity of
pipeline implementation