Docsity

Pipelining Design Techniques-Programming and Computer Architechture-Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Pipelining Design Techniques-Programming and Computer Architechture-Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

Pipelining Design Techniques

Chapter 9

Review (1/3)

Datapath is the hardware that performsoperations necessary to execute programs.

Control instructs datapath on what to donext.

Datapath needs:

■

access to storage (general purpose registersand memory)

■

computational ability (ALU)

■

helper hardware (local registers and PC)

Review Datapath

PC

instruction

memory

rt

rs

rd

registers

ALU

Data

memory

imm

  1. Instruction

Fetch

  1. Decode/

Register

Read

  1. Execute
  2. Memory
  3. Write

Back

Outline

Pipelining Analogy

Pipelining Instruction Execution

Hazards

Sequential Laundry



Sequential laundry takes 8 hours for 4 loads

T

a

s k

O

r

d e

r

B C D

A

Time

6 PM

2 AM

Pipelined Laundry



Pipelined laundry takes 3.5 hours for 4 loads!

T a

s k

O

r

d e

r

B

C D

A

2 AM

6 PM

Time

Pipelining Lessons (1/2)



Pipelining doesn’t helplatency of single task, ithelps throughput of entireworkload



Multiple tasks operatingsimultaneously usingdifferent resources



Potential speedup =Number pipe stages



Time to “fill” pipeline andtime to “drain” it reducesspeedup:2.3X v. 4X in this example

6 PM

Time

B

C D

A

T

a s k

O

r

d e

r

Pipelining Lessons (2/2)



Suppose newWasher takes 20minutes, new Stashertakes 20 minutes.How much faster ispipeline?



Pipeline rate limitedby slowest pipelinestage



Unbalanced lengthsof pipe stages alsoreduces speedup

6 PM

Time

B

C D

A

T

a s k

O

r

d e

r

General Concept



Below is an illustration of the basic differencebetween executing four subtasks of a giveninstruction (in this case fetching

F

, decoding

D

,

execution

E

, and writing the results

W

) using

pipelining and sequential processing.

Performance Measures

In order to formulate some performancemeasures for the goodness of a pipeline inprocessing a series of tasks, a space timechart (called the Gantt's Chart) is used.

The chart shows the succession of the sub-tasks in the pipe with respect to time.

Performance Measures…

Speedup S(n):

■

Consider the execution of

m

tasks (instructions)

using

n

-stages (units) pipeline.

■

n+m-1 time units

are required to complete

m

tasks.

Performance Measures…

Throughput T(n):

Efficiency E(n):

Pipeline Hazard:

Matching socks in later load

A depends on D; stall since folder tied up

T a

s k

O

r

d e

r

B C D

A

E F

bubble

2 AM

6 PM

Time

Pipeline Stall…

Pipeline “Stall” due to InstructionDependency:

■

Instruction dependency refers to the casewhereby fetching of an instruction depends onthe results of executing a previous instruction.

■

Instruction dependency manifests itself in theexecution of a conditional branch instruction.

■

For example, in the case of a "branch if negative“instruction, the next instruction to fetch will not beknown until the result of executing that “branch ifnegative” instruction is known.