Title: CPE 431531 Chapter 6 Enhancing Performance with Pipelining
1CPE 431/531Chapter 6 - Enhancing Performance
with Pipelining
- Swathi T. Gurumani
- Modified From Slides of
- Dr. Rhonda Kay Gaede
- UAH
26.1 An Overview of Pipelining -Control Hazards
Stalling
Performance of Stall on Branch Example on Pg.
380 Branch prediction Method of resolving a
branch hazard that assumes a given outcome for
the branch and proceeds from that assumption
rather than waiting to ascertain the actual
outcome Prediction to handle branches untaken,
taken
36.1 An Overview of Pipelining -Control Hazards
Prediction
46.2 A Pipelined Datapath Identifying the Stages
Control hazard
Data hazard
56.2 A Pipelined Datapath Representing Multiple
Instruction Execution
66.2 A Pipelined Datapath - Adding Pipeline
Registers
128
64
97
64
76.2 A Pipelined Datapath lw Instruction
Execution IF Stage
86.2 A Pipelined Datapath lw Instruction
Execution ID Stage
96.2 A Pipelined Datapath- lw Instruction
Execution EX Stage
106.2 A Pipelined Datapath - lw Instruction
Execution MEM Stage
116.2 A Pipelined Datapath - lw Instruction
Execution WB Stage
126.2 A Pipelined Datapath - sw Instruction
Exection EX stage
136.2 A Pipelined Datapath sw Instruction
Exection MEM stage
146.2 A Pipelined Datapath - sw Instruction
Exection WB stage
156.2 A Pipelined Datapath - Additions for lw and
R-type
166.2 A Pipelined Datapath - Datapath used by lw
176.2 A Pipelined Datapath - Stylized Multiple
Clock Cycle Diagrams
186.2 A Pipelined Datapath - Traditional Multiple
Clock Cycle Diagrams
196.2 A Pipelined Datapath - Single Cycle Diagram
Cycle 5 Slice
206.3 Pipelined Control - Identifying Control
Lines Needed
216.3 Pipelined Control Generating and Saving
Control Lines
226.3 Pipelined Control - Putting it all Together
236.4 Data Hazards and Forwarding - Data
Dependencies
- In the previous example, there were no data
dependencies. Now, the rest of the story. - sub 2, 1, 3
- and 12, 2, 5
- or 13, 6, 2,
- add 14, 2, 2
- sw 15, 100(2)
246.4 Data Hazards and Forwarding - Which Data
Dependencies are Hazards?
- A multiple-clock-cycle diagram is useful for
looking at the effects of data dependencies.
256.4 Data Hazards and Forwarding - Classifying
Hazards
- Type 1 The information needed in the EX stage
by an instruction is the result of the
instruction one stage ahead (found in the EX/MEM
pipeline register) - A. The information is needed in Rrs
- B. The information is needed as Rrt
- Type 2 The information needed in the EX stage
by an instruction is the result of the
instruction two stages ahead (found in the MEM/WB
pipeline register) - A. The information is needed in Rrs
- B. The information is needed as Rrt