Pipelining in Computer Science: Control and Performance, Study notes of Computer Architecture and Organization

A collection of notes from a computer science course on pipelining, focusing on control and performance. It includes explanations of pipelining concepts, quiz questions, and reminders. Topics such as pipelined control, pipeline bubbles, data hazards, and branch hazards.

Typology: Study notes

Pre 2010

Uploaded on 03/28/2010

koofers-user-4x2-1
koofers-user-4x2-1 🇺🇸

10 documents

1 / 42

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Chien CSE141 1 November 12, 2002
Pipelining:Control and
Performance
Last Time
Pipelining and Speedup
Instruction Pipelining (datapath)
Some Hazards
This Time
Quiz #6
Control for Pipelining
Performance and Control Hazards
Branch prediction
Reminders/Announcements
HW4 out this afternoon (check the web)
Read rest of Chapter 6
Graded Lab #2’s returned today
Graded midterms returned in class thursday
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a

Partial preview of the text

Download Pipelining in Computer Science: Control and Performance and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Chien CSE

Pipelining:Control andPerformance „

Last Time

Pipelining and Speedup

Instruction Pipelining (datapath)

Some Hazards

This Time

Quiz

Control for Pipelining

Performance and Control Hazards

Branch prediction

Reminders/Announcements

HW4 out this afternoon (check the web)

Read rest of Chapter 6

Graded Lab #2’s returned today

Graded midterms returned in class thursday

Chien CSE

November 12, 2002

Pipelining (review)^ „

Datapath, instructions in sequence

Fixing the register write address (pipeline the controls)

Fig 6.

Chien CSE

November 12, 2002

Pipelined Control(implementation)

„

Actual datapath and control pipeline

Fig 6.25 and 6.

Chien CSE

Pipelined Control (example)^ „

Two instruction sequence, will illustrate the flow thru the pipeline

Two different instruction classes, note the sequence ofoperations and think about the issues of ordering and control

Fig 6.

Chien CSE

Pipelined Control II

Fetch and decode

Two instructions in the pipeline

Fig 6.

Chien CSE

Pipelined Control III

Decode and Execute

What does each instruction have to do?

Fig 6.

Chien CSE

Pipelined Control V

Memory and Writeback, Instruction completion

Did things happen in the right order?

Fig 6.

Chien CSE

Pipelined Control VI

Instruction completion

Did things happen in the right order?

Fig 6.

Chien CSE

Dependences and Hazards lw

$t0, 160($t1)

add

$t2,$t2,$t

„

Second instruction depends on completion of thefirst.

„

Normal execution: no problem

„

Pipelined Execution: incorrect answer?

„

0: ... lw completes in cycle 4, add needs the value atcycle 2

Chien CSE

Data Hazard^ „

lw writes at cycle 4

„

add reads at cycle 2

„

dependence is backwards in time -> can’t do this!

„

Strictly: data available at end of cycle 4, needed atthe start of cycle 3

„

Still one cycle of “backward dependence”

lw add

Chien CSE

Pipeline Bubbles

What happens to data pipeline?

Bubble sets control to “do nothing”, travels through thepipeline

Fig 6.25 or 6.

Chien CSE

What are possible sources ofhazards?

„

R then R, R then store, R then load; all are fine

„

Load then R (data value dependence)

„

Branch then R (control dependence)

„

These sequences of instructions cause pipelinebubbles.

„

Each bubble reduces performance.

„

Frequency of bubbles <-> effectiveness ofpipelining

„

=> Fraction of “ideal” benefit achieved

Chien CSE

Branch then R^ „

Branch determines new PC in cycle 2

„

Instruction Fetch must wait until after cycle 2

„

Two bubbles must be introduced

„

add instruction is fetched two cycles later

beq add

Pipeline Bubbles

Chien CSE

Detecting Hazards & Forwarding „

What is required to detect Load / R class hazards?

„

What is required to detect Branch / anythinghazards?

„

What is required to do forwarding for R / R classinstructions?