Download presentation
Presentation is loading. Please wait.
Published byFrank Wetzel Modified over 6 years ago
1
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. ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
2
All values now in reg. file Reservation stations and ROB are empty
RF In RF tag value - 54 76 -5 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
3
Code 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. ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
4
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 RF A LW R2, 4(R0) In RF tag value - 54 76 -5 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
5
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 RF A LW R2, 4(R0) In RF tag value - 54 76 -5 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 54 Imm=4 Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
6
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 RF B MULT R3, R1, R2 In RF tag value - 54 76 -5 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 54 Imm=4 Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
7
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 RF B MULT R3, R1, R2 In RF tag value - 54 76 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 1 76 Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
8
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 RF C LW R2, 8(R0) In RF tag value - 54 76 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 1 76 Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
9
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 RF C LW R2, 8(R0) In RF tag value - 54 76 2 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 C 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 2 54 Imm=8 1 76 Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
10
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 RF D ADD R1, R1, R2 In RF tag value - 54 76 2 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 C 3 4 5 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 2 54 Imm=8 1 76 Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
11
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 RF D ADD R1, R1, R2 In RF tag value - 54 3 76 2 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 C 3 R1 D 4 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 3 76 2 1 TAIL Reservation Stations FUs 0 (cache miss) 2 (cache hit) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
12
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 RF E SUB R2, R0, R1 In RF tag value - 54 3 76 2 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 C 3 R1 D 4 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 3 76 2 1 TAIL Reservation Stations FUs 0 (cache miss) 2 (cache hit) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
13
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 RF E SUB R2, R0, R1 In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 C 3 R1 D 4 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 4 54 3 76 2 1 TAIL Reservation Stations FUs 0 (cache miss) 2 (cache hit) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
14
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 RF In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 no C 3 R1 D 4 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 4 54 3 76 667 1 TAIL Reservation Stations FUs 0 (cache miss) 2, 667, no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
15
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 RF In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 no C 3 R1 D 4 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 4 54 3 1 76 TAIL Reservation Stations FUs 0 (cache miss) 3 ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
16
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 RF In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 no C 3 R1 743 D 4 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 4 54 743 1 76 TAIL Reservation Stations FUs 0 (cache miss) 3, 743, no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
17
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 RF In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 No C 3 R1 743 D 4 –689 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 1 76 TAIL Reservation Stations FUs 0 (cache miss) 4, –689, no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
18
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 RF F ADD R0, R1, R2 In RF tag value - 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 No C 3 R1 743 D 4 –689 E 5 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 1 76 TAIL Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
19
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 RF F ADD R0, R1, R2 In RF tag value 5 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 No C 3 R1 743 D 4 –689 E 5 R0 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 5 743 –689 1 76 TAIL Reservation Stations FUs 0 (cache miss) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
20
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 RF In RF tag value 5 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 A 1 R3 B 2 667 No C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 1 76 TAIL Reservation Stations FUs 0 (cache miss) 5, 54, no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
21
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 RF In RF tag value 5 54 3 76 4 -5 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 1 76 650000 TAIL Reservation Stations FUs 0, , no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
22
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 RF In RF tag value 5 54 3 76 4 650000 1 -99 Reg=R2, Tag=0, Val=650000 R0 Note: Tag doesn’t match RF tag, don’t set “In RF” Note: Commit value to register- file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 TAIL Reservation Stations FUs 1 (multiply) ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
23
Two scenarios next… Multiply Scenario #1: Completes without exception
Scenario #2: Raises exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
24
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 RF In RF tag value 5 54 3 76 4 650000 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 TAIL Reservation Stations FUs 1, , no exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
25
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 RF In RF tag value 5 54 3 76 4 650000 - Reg=R3, Tag=1, Val= R0 Note: Tag matches RF tag, so set “In RF” Note: Commit value to register-file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 TAIL Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
26
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 RF In RF tag value 5 54 3 76 4 667 - Reg=R2, Tag=2, Val=667 R0 Note: Tag does not match RF tag, don’t set “In RF” Note: Commit value to register-file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 TAIL Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
27
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 RF In RF tag value 5 54 - 743 4 667 Reg=R1, Tag=3, Val=743 R0 Note: Tag matches RF tag, so set “In RF” Note: Commit value to register-file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 my tag src1 ready tag/value src2 HEAD TAIL Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
28
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 RF In RF tag value 5 54 - 743 – 689 Reg=R2, Tag=4, Val=–689 R0 Note: Tag matches RF tag, so set “In RF” Note: Commit value to register-file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 my tag src1 ready tag/value src2 HEAD TAIL Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
29
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 RF In RF tag value - 54 743 –689 Reg=R0, Tag=5, Val=54 R0 Note: Tag matches RF tag, so set “In RF” Note: Commit value to register file state R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 my tag src1 ready tag/value src2 HEAD TAIL Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
30
Now do scenario #2 Multiply raises exception.
ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
31
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 RF In RF tag value 5 54 3 76 4 650000 1 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 - Yes B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD my tag src1 ready tag/value src2 TAIL Reservation Stations FUs 1, exception ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
32
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 RF In RF tag value - 54 76 650000 -99 R0 R1 R2 ROB R3 Entry Dest Result Exception Completed PC R2 650000 No A 1 R3 - Yes B 2 667 C 3 R1 743 D 4 –689 E 5 R0 54 F 6 7 8 9 10 11 12 13 14 15 HEAD TAIL my tag src1 ready tag/value src2 Reservation Stations FUs ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
33
Other animations Another good animation of reorder buffers is the one by John Kubiatowicz. See or Kubiatowicz-2001f/files/lectures/lec19-memory.ppt. A higher-level visualization of the process is at ECE 463/521, Profs. Conte, Rotenberg, & Gehringer, Dept. of ECE, NC State University
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.