Top Banner
Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?
26

Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Dec 14, 2015

Download

Documents

Darius Sperring
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 1

Acceleration

How to improve speed? At what costs?

Page 2: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 2

T=Nq * CPI * Cycletime

Nq, Number of instructions CPI, Cycles Per Instruction Cycletime

Page 3: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 3

Single Cycle Design

CPI = 1 Cycletime = Long (Longest path)

Page 4: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 4

Multiple Cycle

1 < CPI < S Cycletime = Factor 1/S

Page 5: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 5

Pipelined design

CPI = 1, (Constant) Cycletime = Factor 1/S

Page 6: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 6

“THROUGHPUT”

The total amount of work done in a given time

Page 7: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 7

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

INSTRUCTIONMEMORY

INSTRUCTION MEMORY STAGE (IM)

Page 8: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 8

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

INSTRUCTION DECODE STAGE (DE)

Page 9: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 9

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

INSTRUCTION EXECUTE STAGE (EX)

Page 10: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 10

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

DATA MEMORY STAGE (DM)

DATA MEMORY

Page 11: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 11

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

WRITEBACK STAGE (WB)

Page 12: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 12

Pipeline

5 stages, (IM, DE, EX, DM, WB) Writeback NOT in critical path Cut critical path by 4

Page 13: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 13

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

CAN READ/WRITETHE SAME REG!

WRITEBACK STAGE (WB)

Page 14: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 14

Single Cycle

IM

Reg DM Reg

IM

Reg DM Reg

Page 15: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 15

IM

Reg DM Reg

4 Stage Pipe

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg

Page 16: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 16

A Program

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

0x3C sw $5 4($0)

$1 holds value 0x05

Page 17: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 17

IM

Reg DM Reg

4 Stage Pipe

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

0x3C sw $5 4($0)

Page 18: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 18

IM

Reg DM Reg

Step 1

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

0x3C sw $5 4($0)

Page 19: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 19

IM

Reg DM Reg

Step 2

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

0x3C sw $5 4($0)

Page 20: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 20

IM

Reg DM Reg

Step 3

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

0x3C sw $5 4($0)

Page 21: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 21

IM

Reg DM Reg

Step 4

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg0x3C sw $5 4($0)

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

Page 22: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 22

IM

Reg DM Reg

Step 5

IM

Reg DM Reg

IM

Reg DM Reg

IM

Reg DM Reg0x3C sw $5 4($0)

0x30 sub $6 $0 $1

0x34 add $7 $0 $1

0x38 ori $2 $0 0xABCD

Page 23: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 23

Branch

logic

Sgn/Ze

extend

Zero ext.

> 0x30 sub $6 $0 $1 0x34 add $7 $0 $1 0x38 ori $2 $0 0xABCD 0x3C sw $5 4($0)

ALU

A

B

31

0

4+

+

Page 24: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 24

Branch

logic

Sgn/Ze

extend

Zero ext.

0x30 sub $6 $0 $1> 0x34 add $7 $0 $1 0x38 ori $2 $0 0xABCD 0x3C sw $5 4($0)

ALU

A

B

31

0

4+

+

Page 25: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 25

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

0x30 sub $6 $0 $1 0x34 add $7 $0 $1> 0x38 ori $2 $0 0xABCD 0x3C sw $5 4($0)

Page 26: Datorteknik Pipelining bild 1 Acceleration How to improve speed? At what costs?

Datorteknik Pipelining bild 26

Branch

logic

Sgn/Ze

extend

Zero ext.

ALU

A

B

31

0

4+

+

0x30 sub $6 $0 $1 0x34 add $7 $0 $1 0x38 ori $2 $0 0xABCD> 0x3C sw $5 4($0)