ROB Example

33
ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University NC State University ILP-1 ROB Example ROB Example We will go through an example of the use of reorder buffers in two scenarios— Completion without exceptions One instruction raises an exception First, let’s consider the data structures in use for the example.

description

ROB Example. We will go through an example of the use of reorder buffers in two scenarios— Completion without exceptions One instruction raises an exception First, let’s consider the data structures in use for the example. All values now in reg. file. Reservation stations and ROB are empty. - PowerPoint PPT Presentation

Transcript of ROB Example

Page 1: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-1

ROB ExampleROB Example We will go through an example of the use of

reorder buffers in two scenarios— Completion without exceptions One instruction raises an exception

First, let’s consider the data structures in use for the example.

Page 2: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-2

Entry Dest Result Exception Completed PC

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAILHEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value – 54 – 76 – -5 – -99

ReservationStations

R0

R1R2

R3

All valuesnow inreg. file Reservation stations

and ROB are empty

Page 3: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-3

Code for the exampleCode for the example

A LW R2, 4(R0)

B MULT R3, R1, R2

C LW R2, 8(R0)

D ADD R1, R1, R2

E SUB R2, R0, R1

F ADD R0, R1, R2

At each step, we will show the changes by coloring the cell backgrounds pink.

Page 4: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-4

Entry Dest Result Exception Completed PC

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAILHEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value – 54 – 76 – -5 – -99

ReservationStations

R0

R1R2

R3

A LW R2, 4(R0)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 5: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-5

Entry Dest Result Exception Completed PC

0 R2 A

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAILHEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

0 54 Imm=4

In RF tag value – 54 – 76

0 -5 – -99

ReservationStations

R0

R1R2

R3

A LW R2, 4(R0)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Entries made inreservation station

and ROB

Page 6: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-6

Entry Dest Result Exception Completed PC

0 R2 A

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAILHEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

0 54 Imm=4

In RF tag value – 54 – 76

0 –5 – – 99

ReservationStations

R0

R1R2

R3

B MULT R3, R1, R2

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 7: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-7

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAIL

HEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 0

In RF tag value – 54 – 76

0 – 5

1 –99

ReservationStations

R0

R1R2

R3

B MULT R3, R1, R2

0 (cache miss)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 8: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-8

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

TAIL

HEAD

FUs

RF

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 0

In RF tag value – 54 – 76

0 –5

1 –99

ReservationStations

R0

R1R2

R3

C LW R2, 8(R0)

0 (cache miss)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 9: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-9

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 C

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

2 54 Imm=8

1 76 0

In RF tag value – 54 – 76

2 –5

1 –99

ReservationStations

R0

R1R2

R3

C LW R2, 8(R0)

TAIL

0 (cache miss)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 10: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-10

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 C

3

4

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

2 54 Imm=8

1 76 0

In RF tag value – 54 – 76

2 –5

1 –99

ReservationStations

R0

R1R2

R3

D ADD R1, R1, R2

TAIL

0 (cache miss)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 11: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-11

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 C

3 R1 D

4

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

3 76 2

1 76 0

In RF tag value – 54

3 76

2 –5

1 –99

ReservationStations

R0

R1R2

R3

D ADD R1, R1, R2

TAIL

0 (cache miss)2 (cache hit)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 12: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-12

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 C

3 R1 D

4

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

3 76 2

1 76 0

In RF tag value – 54

3 76

2 –5

1 –99

ReservationStations

R0

R1R2

R3

E SUB R2, R0, R1

TAIL

0 (cache miss)2 (cache hit)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 13: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-13

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 C

3 R1 D

4 R2 E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

4 54 3

3 76 2

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

E SUB R2, R0, R1

TAIL

0 (cache miss)2 (cache hit)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 14: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-14

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 no C

3 R1 D

4 R2 E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

4 54 3

3 76 667

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

2, 667, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 15: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-15

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 no C

3 R1 D

4 R2 E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

4 54 3

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)3

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 16: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-16

667 + 76 = 743

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 no C

3 R1 743 no D

4 R2 E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

4 54 743

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

3, 743, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 17: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-17

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

4, –689, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

54 – 743 = –689

Page 18: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-18

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 0

In RF tag value – 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

F ADD R0, R1, R2

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 19: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-19

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

5 743 –689

1 76 0

In RF tag value

5 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

F ADD R0, R1, R2

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 20: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-20

Entry Dest Result Exception Completed PC

0 R2 A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 0

In RF tag value

5 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0 (cache miss)

5, 54, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

743 + –689 = 54

Page 21: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-21

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

1 76 650000

In RF tag value

5 54

3 76

4 –5

1 –99

ReservationStations

R0

R1R2

R3

TAIL

0, 650000, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 22: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-22

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54

3 76

4 650000

1 –99

ReservationStations

R0

R1R2

R3

TAIL

Reg=R2, Tag=0, Val=650000

Note: Tag doesn’t match RF tag, don’t set “In RF”Note: Commit value to register- file state

1 (multiply)

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 23: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-23

Two scenarios next…Two scenarios next… Multiply

Scenario #1: Completes without exception Scenario #2: Raises exception

Page 24: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-24

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54

3 76

4 650000

1 –99

ReservationStations

R0

R1R2

R3

TAIL

1, 49400000, no exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

650000 76 = 49400000

Page 25: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-25

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54

3 76

4 650000 – 49400000

ReservationStations

R0

R1R2

R3

TAIL

Reg=R3, Tag=1, Val=49400000

Note: Tag matches RF tag, so set “In RF”Note: Commit value to register-file state

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 26: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-26

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEADmytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54

3 76

4 667 – 49400000

ReservationStations

R0

R1R2

R3

TAIL

Reg=R2, Tag=2, Val=667

Note: Tag does not match RF tag, don’t set “In RF”Note: Commit value to register-file state

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 27: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-27

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEADmytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54 – 743

4 667 – 49400000

ReservationStations

R0

R1R2

R3

TAIL

Reg=R1, Tag=3, Val=743

Note: Tag matches RF tag, so set “In RF”Note: Commit value to register-file state

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 28: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-28

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54 – 743 – – 689 – 49400000

ReservationStations

R0

R1R2

R3

TAIL

Reg=R2, Tag=4, Val=–689

Note: Tag matches RF tag, so set “In RF”Note: Commit value to register-file state

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 29: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-29

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 49400000 No B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value – 54 – 743 – –689 – 49400000

ReservationStations

R0

R1R2

R3

TAIL

Reg=R0, Tag=5, Val=54

Note: Tag matches RF tag, so set “In RF”Note: Commit value to register file state

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0)

D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 30: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-30

Now do scenario #2Now do scenario #2 Multiply raises exception.

Page 31: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-31

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 – Yes B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value

5 54

3 76

4 650000

1 –99

ReservationStations

R0

R1R2

R3

TAIL

1, exception

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 32: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-32

Entry Dest Result Exception Completed PC

0 R2 650000 No A

1 R3 – Yes B

2 R2 667 No C

3 R1 743 No D

4 R2 –689 No E

5 R0 54 No F

6

7

8

9

10

11

12

13

14

15

ROB

FUs

RF

HEAD

mytag

src1ready

src1tag/value

src2ready

src2tag/value

In RF tag value – 54 – 76 – 650000 – –99

ReservationStations

R0

R1R2

R3

TAIL

A LW R2, 4(R0) B MULT R3, R1, R2C LW R2, 8(R0) D ADD R1, R1, R2 E SUB R2, R0, R1 F ADD R0, R1, R2

Page 33: ROB Example

ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE,ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State UniversityNC State University ILP-33

Other animationsOther animations Another good animation of reorder buffers is

the one by John Kubiatowicz. See www.cs.ccu.edu.tw/~chen/arch/reorder-step.ppt

orwww.cs.uit.no/studier/kurs/d241/info/2002h/notes/Berkeley/ Kubiatowicz-2001f/files/lectures/lec19-memory.ppt.

A higher-level visualization of the process is at http://www.ece.lsu.edu/koppel/see/