ECE 5755: Modern Computer Systems and Architecture
Lecture 7: Out of Order Execution
Lynn Ann Conway, an American computer scientist, electrical engineer, and transgender activist, invested generalized dynamic instruction handling, a key advanced in out-of-order execution. Her work was also instrumental in VLSI chip design and electronic design automation.
Today’s agenda
Photos, illustrations, graphics here.
Intel TopDown & VTune
https://ieeexplore.ieee.org/document/6844459
Photos, illustrations, graphics here.
Intel TopDown & VTune
Photos, illustrations, graphics here.
Intel TopDown & VTune
Photos, illustrations, graphics here.
Intel TopDown & VTune
Photos, illustrations, graphics here.
Intel TopDown & VTune
Photos, illustrations, graphics here.
Lab Compute server specifications
Photos, illustrations, graphics here.
Lab Compute server specifications
Photos, illustrations, graphics here.
Queues to use
srun -p shared -n 1 --mem=1g --pty /bin/bash
srun -p ece5755 -n 1 --mem=1g --pty /bin/bash
Photos, illustrations, graphics here.
Things to keep in mind
Photos, illustrations, graphics here.
Instruction Level Parallelism (ILP)
Photos, illustrations, graphics here.
Overview of score-boarding stages
IF
IS
EX
M
WB
Rd
New Pipeline
I-Buffer/Scoreboard
Photos, illustrations, graphics here.
Scoreboarding stages: Issue (or dispatch)
IF
IS
EX
M
WB
Rd
New Pipeline
I-Buffer/Scoreboard
Photos, illustrations, graphics here.
Scoreboarding stages: Read operands (or issue)
IF
IS
EX
M
WB
Rd
New Pipeline
I-Buffer/Scoreboard
Photos, illustrations, graphics here.
Scoreboarding stages: Execution/Write Result
IF
IS
EX
M
WB
Rd
New Pipeline
I-Buffer/Scoreboard
Photos, illustrations, graphics here.
Scoreboard example
In-order issue; out-of-order execute & commit
Photos, illustrations, graphics here.
Scoreboarding limitations
Photos, illustrations, graphics here.
Another approach: Tomasulo’s algorithm
Photos, illustrations, graphics here.
What are Reservation Stations?
Photos, illustrations, graphics here.
Register renaming
Photos, illustrations, graphics here.
Register Renaming with Tomasulo
Photos, illustrations, graphics here.
The three main stages of Tomasulo Algorithm
1. Issue—get instruction from FP Op Queue
If reservation station free (no structural hazard), �control issues instr & sends operands (renames registers).
2. Execution—operate on operands (EX)
When both operands ready then execute;� if not ready, watch Common Data Bus for result
3. Write result—finish execution (WB)
Write on Common Data Bus to all awaiting units; �mark reservation station available
Photos, illustrations, graphics here.
Tomasulo Organization
Photos, illustrations, graphics here.
Reservation Station Components
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Note: Unlike scoreboarding hardware, this processor can have multiple loads
Photos, illustrations, graphics here.
Tomasulo Example
Note: registers names are removed (“renamed”) in Reservation Stations; MULT issued vs. scoreboard
Load1 completing; what is waiting for Load1?
Photos, illustrations, graphics here.
Tomasulo Example
Load2 completing; what is waiting for Load2?
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Issue ADDD here vs. scoreboard?
Photos, illustrations, graphics here.
Tomasulo Example
Add1 completing; what is waiting for it?
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Add2 completing; what is waiting for it?
Photos, illustrations, graphics here.
Tomasulo Example
Write result of ADDD here vs. scoreboard?
All quick instructions complete in this cycle!
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Photos, illustrations, graphics here.
Tomasulo Example
Once again: In-order issue, out-of-order execution and completion.
Photos, illustrations, graphics here.
Comparing Tomasulo and Scoreboard
Structural Hazards
Lack of forwarding
Photos, illustrations, graphics here.
Tomasulo summary
Photos, illustrations, graphics here.
Tomasulo vs. scoreboarding
Photos, illustrations, graphics here.
Our processor so far…
PC
I$
Register
File
s1
s2
d
D$
+
4
PC
PC
A
B
IR
IR
IR
IR
B
O
O
D
Photos, illustrations, graphics here.
Memory Hierarchy Design
Photos, illustrations, graphics here.
Memory Hierarchy Design
Smaller, fast expensive memory close to the core (Cache, $)
Larger, slower, cheaper memory farther away
Photos, illustrations, graphics here.
Modern Memory Hierarchy (DIMM)
Photos, illustrations, graphics here.
Memory Wall in Modern GPUs
AI and Memory Wall. Gholami et. al. https://arxiv.org/pdf/2403.14123
Photos, illustrations, graphics here.
Processor-Memory Performance Gap, “Memory Wall”
Photos, illustrations, graphics here.
Processor-Memory Performance Gap, “Memory Wall”
Photos, illustrations, graphics here.
Processor-Memory Performance Gap, “Memory Wall”
Photos, illustrations, graphics here.
Memory Hierarchy: An overview
Fact: Large memories are slow and fast memories are small
Speed (cycles):
Size (bytes):
Cost (per size):
½
100’s
Highest
1’s
O(10s) K
10’s
O(M)
100’s
O(10s-100s) G
1000’s
T’s
Lowest
Photos, illustrations, graphics here.
What do we put in smaller, faster memories?
Photos, illustrations, graphics here.
Example: Locality?
sum = 0;
for (i = 0; i < n; i++)
sum += a[i];
return sum;
Photos, illustrations, graphics here.
Basic memory structure
0
1
1021
1022
1023
2
3
1024*256bit
SRAM
bitlines
wordlines
10 bits
Photos, illustrations, graphics here.
Basic memory structure
0
1
1021
1022
1023
2
3
1024*256bit
SRAM
bitlines
wordlines
10 bits
Photos, illustrations, graphics here.
Caches: Indexing to find data
0
1
1021
1022
1023
2
3
[4:0]
[31:15]
index [14:5]
<<
1024*
256bit
SRAM
bitlines
wordlines
data
address
Photos, illustrations, graphics here.
Knowing that You Found It: Tags
0
1
1021
1022
1023
2
3
[4:0]
tag [31:15]
data
index [14:5]
<<
address
=
hit?
wordlines
Photos, illustrations, graphics here.
Memory Performance Metrics
Photos, illustrations, graphics here.