Lecture 6
Lecture 6
1
Three 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
2
Adapted from UCB CS252 S98
Issue Stage and Renaming Table
Renames its two source registers (source
renaming)
Assigns it to a free RS
Updates Renaming table (dest renaming)
Also decodes the inst and read register
values in parallel
4
Writeback and Common Data Bus
Normal data bus: data + destination (“go
to” bus)
Common data bus: data + source (“come
from” bus)
64 bits of data + 4 bits of source index
(tag)
Does the broadcast to every instruction in
the fly
Child instructions do tag matching and
update their ready bits and value fields
(if the tag matches theirs)
5
Adapted from UCB CS252 S98, Copyright 1998 USB
Code Example
LD F6,34(R2)
LD F2,45(R3) LD1 LD2
MULTI F0,F2,F4
SUBD MULTI
SUBD F8,F6,F2
DIVD F10,F0,F6 ADD DIVD
ADD F6,F8,F2
6
Tomasulo Example Cycle 0
7
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 1
8
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 2
9
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 3
12
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 6
13
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 7
15
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 9
16
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 10
19
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 13
20
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 14
21
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 15
24
Adapted from UCB CS252 S98, Copyright 1998 USB
Tomasulo Example Cycle 56
27
The Use of Tag
In Tomasulo, RS and
load/store buffer
index is used as tag.
Renaming assign new Why tag is so chosen?
inst a unique tag
RS stores tags to What does tag really
preserve dependences represent?
CDB broadcasts tag
with data for data What else can be used
passing and wakeup as tag?
28
Tomasulo Summary
Reservations stations:
Increases effective register number
29
Adapted from UCB CS252 S98, Copyright 1998 USB