![Page 1: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/1.jpg)
04/19/23 445_23 1
Pipelining
ECE-445
Computer Organization
Dr. Ron Hayne
Electrical and Computer Engineering
![Page 2: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/2.jpg)
04/19/23 445_23 2
Pipelining
F1 E1
I1
F2 E2
I2
F3 E3
I3
Sequential Execution
F1 E1I1
F2 E2I2
F3 E3I3
Pipelined Execution
![Page 3: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/3.jpg)
04/19/23 445_23 3
Hardware Organization
InstructionFetchUnit
ExecutionUnit
Interstage BufferB1
![Page 4: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/4.jpg)
04/19/23 445_23 4
Four State Pipeline
Fetch (F) Read the instruction from memory
Decode (D) Decode the instruction and fetch the source operand(s)
Execute (E) Perform the operation specified by the instruction
Write (W) Store the result in the destination location
![Page 5: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/5.jpg)
04/19/23 445_23 5
Four Stage Pipeline
![Page 6: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/6.jpg)
04/19/23 445_23 6
Hardware Organization
![Page 7: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/7.jpg)
04/19/23 445_23 7
Data Hazard
Pipeline stalled Source or destination operands not available at time
expected in the pipeline Execution operation taking more than one clock
cycle
![Page 8: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/8.jpg)
04/19/23 445_23 8
Data Hazard
![Page 9: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/9.jpg)
04/19/23 445_23 9
Data Dependency
![Page 10: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/10.jpg)
04/19/23 445_23 10
Operand Forwarding
![Page 11: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/11.jpg)
04/19/23 445_23 11
Operand Forwarding
![Page 12: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/12.jpg)
04/19/23 445_23 12
Handling Data Hazards in SW
Compiler detect data dependencies and deal with them Insert NOPs Attempt to reorder instructions to perform useful tasks in
NOP slots
Side effects Instruction changes contents of a register other than the
named destination Autoincrement/autodecrement addressing modes Condition code flags
Give rise to multiple dependencies Should be minimized
![Page 13: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/13.jpg)
04/19/23 445_23 13
Instruction Hazards
Pipeline stalled Delay in the availability of an instruction
Cache miss Branch instructions
![Page 14: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/14.jpg)
04/19/23 445_23 14
Instruction Hazard
![Page 15: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/15.jpg)
04/19/23 445_23 15
Instruction Queue and Prefetch
![Page 16: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/16.jpg)
04/19/23 445_23 16
Branch Penalty
![Page 17: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/17.jpg)
04/19/23 445_23 17
Branch Prediction
Attempt to predict whether or not a particular branch will be taken
Speculative execution Continue to execute until outcome of branch evaluated No processor registers or memory can be updated until
branch outcome is confirmed
![Page 18: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/18.jpg)
04/19/23 445_23 18
Branch Prediction
Static Branch Prediction Some branch instructions predicted as taken and others
as not taken End or program loop Beginning of program loop Hardware or compiler
Dynamic Branch Prediction Based on execution history
![Page 19: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/19.jpg)
04/19/23 445_23 19
Structural Hazard
Two instructions require use of a given hardware resource at the same time Access to memory
Separate instruction and data caches Access to register file
Multiple port register file
In general avoided by providing sufficient hardware resources on the processor chip
![Page 20: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/20.jpg)
04/19/23 445_23 20
Structural Hazard
![Page 21: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/21.jpg)
04/19/23 445_23 21
Summary
Pipelining does not result in individual instructions being executed faster
Throughput increases Rate at which instruction execution is completed
Important goal in designing processors is to identify all hazards that may cause the pipeline to stall Find ways to minimize their impact
![Page 22: 7/2/2015445_23 1 Pipelining ECE-445 Computer Organization Dr. Ron Hayne Electrical and Computer Engineering](https://reader030.vdocuments.net/reader030/viewer/2022032522/56649d6d5503460f94a4de7f/html5/thumbnails/22.jpg)
04/19/23 445_23 22
Questions?