08 Pipeline Design

23
8/13/2019 08 Pipeline Design http://slidepdf.com/reader/full/08-pipeline-design 1/23 Pipelined CPUs (Second Edition: Sections 6.1-6.3 Fourth Edition: Sections 4.5-4.6) from Dr. Andrea Di Blas’ notes

Transcript of 08 Pipeline Design

Page 1: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 1/23

Pipelined CPUs

(Second Edition: Sections 6.1-6.3Fourth Edition: Sections 4.5-4.6)from Dr. Andrea Di Blas’ notes

Page 2: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 2/23

CMPE 110 – Spring 2011 – J. Ferguson 

Outline•  Pipeline Principles

•  Pipelined datapath

•  Pipelined control

8 - 2

Page 3: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 3/23

CMPE 110 – Spring 2011 – J. Ferguson 

Single Cycle Restaurant

8 - 3

Everyone gets one minute to be served,whether they need it or not.

Page 4: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 4/23

CMPE 110 – Spring 2011 – J. Ferguson  8 - 4

Multicycle Restaurant

Everyone spends 15 seconds at each station thatshe orders from.

Page 5: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 5/23

CMPE 110 – Spring 2011 – J. Ferguson  8 - 5

Pipelined Restaurant

Everyone spends 15 seconds at each station thatshe orders from, but each station can serve adifferent customer.

Page 6: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 6/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipelined Datapath•  Just like with multicycle implementation there are

stages,

•  but each stage executes concurrently.•  A new instruction begins execution every clock

cycle.

8 - 6

Page 7: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 7/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipeline concept

8 - 7

•  Break up instruction into tasks

•  Balance the amount of work (time) betweenstages

•  Allow each segment to complete and startnext instruction

Page 8: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 8/23

CMPE 110 – Spring 2011 – J. Ferguson 

Properties of Pipelines•  Latency: the time it takes for a single instruction

to execute. Pipelining makes latency slightly worse.

•  Throughput: number of instructions executed perunit time. Pipelining improves throughput.

•  Five stages in classical pipeline: IF, ID, EX, MEM,WB. Just like our multicycle pipeline.

•  Clock is constrained by slowest stage of pipeline.

•  Pipelining isn’t free: complexities in design andadditional resources (more later).

8 - 8

Page 9: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 9/23

CMPE 110 – Spring 2011 – J. Ferguson 

Multicycle! Pipelined

8 - 9

multicycle

Page 10: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 10/23

CMPE 110 – Spring 2011 – J. Ferguson 

A MIPS pipeline

8 - 10

The “pink” registers hold data between stages

Page 11: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 11/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipeline Performance•  If all instructions took N Cycles, and

•  each of N pipeline stages did 1/Nth of the work,

and•  the clock speed didn’t change,

•  the pipeline implementation’s “throughput” would beN times faster than the multicycle implementation.

• 

Because an instruction would be finished every clockcycle.

8 - 11

Page 12: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 12/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipeline performance… but…

8 - 12

Instr.Class

Instr.Fetch

Reg.Read

ALUOp.

DataAccess

Reg.Write

TotalTime

LoadWord

200ps 100ps 200ps 200ps 100ps 800ps

StoreWord

200ps 100ps 200ps 200ps 700ps

R-Format

200ps 100ps 200ps 100ps 600ps

Branch 200ps 100ps 200ps 500ps

If each instruction type was 25% of the executed

instructions, then average execution time would be650 ps. What would the performance increase be?

650/200 = 3.25

Page 13: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 13/23

CMPE 110 – Spring 2011 – J. Ferguson 

Multicycle vs. Pipeline

8 - 13

Page 14: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 14/23

CMPE 110 – Spring 2011 – J. Ferguson 

MIPS ISA and Pipelining•  All instructions are the same length

•  Few instruction formats (and similar as possible)

•  Memory operands only in load and store and simpleaddressing mode

•  Operands are aligned in memory

8 - 14

Page 15: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 15/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipelining instructions example

•  Concept: relatively simple

lw $10, 20($1)

sub $11, $2, $3

8 - 15

Page 16: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 16/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 1

8 - 16

Page 17: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 17/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 2

8 - 17

Page 18: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 18/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 3

8 - 18

Page 19: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 19/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 4

8 - 19

Page 20: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 20/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 5

8 - 20

Page 21: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 21/23

CMPE 110 – Spring 2011 – J. Ferguson 

Clock Cycle 6

8 - 21

Page 22: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 22/23

CMPE 110 – Spring 2011 – J. Ferguson 

Pipelined Control

•  Generated as before, then pipelined too

8 - 22

Page 23: 08 Pipeline Design

8/13/2019 08 Pipeline Design

http://slidepdf.com/reader/full/08-pipeline-design 23/23

CMPE 110 – Spring 2011 – J. Ferguson  8 - 23