Content deleted Content added
Jdmccalpin (talk | contribs) m →Register renaming: replaced non-word "ordecution" with "out-of-order execution" |
|||
(67 intermediate revisions by 47 users not shown) | |||
Line 1:
{{Short description|Computer architecture hardware algorithm}}
'''
The major innovations of Tomasulo’s algorithm include [[register renaming]] in hardware, [[reservation station
[[Robert Tomasulo]] received the [[
| url =http://awards.acm.org/award_winners/tomasulo_4008463.cfm
| title =Robert Tomasulo – Award Winner
| website =ACM Awards
| publisher =ACM
|
}}</ref>
==Implementation concepts==
[[File:Tomasulo Architecture.png|thumb|right|700px|Tomasulo's floating point unit]]▼
The following are the concepts necessary to the implementation of Tomasulo's Algorithm.▼
===Common data bus===
The Common Data Bus (CDB) connects reservation stations directly to functional units. According to Tomasulo it "preserves precedence while encouraging concurrency".<ref name="tomasulo">
{{cite journal
| last1 = Tomasulo | first1 = Robert
| author1-link = Robert Marco Tomasulo
| title = An Efficient Algorithm for Exploiting Multiple Arithmetic Units
| journal = IBM Journal of Research and Development
Line 27 ⟶ 30:
| date = Jan 1967
| issn = 0018-8646
| doi = 10.1147/rd.111.0025 | s2cid = 8445049
}}</ref>{{rp|33}} This has two important effects: #Functional units can access the result of any operation without involving a floating-point-register, allowing multiple units waiting on a result to
#Hazard Detection and control execution are distributed. The reservation stations control when an instruction can execute, rather than a single dedicated hazard unit.
===Instruction order===
{{Disputed section|Imprecise exceptions|date=December 2023}}
Instructions are issued sequentially so that the effects of a sequence of instructions, such as [[exception (computing)|exception]]s raised by these instructions, occur in the same order as they would on an in-order processor, regardless of the fact that they are being executed out-of-order (i.e. non-sequentially).
▲[[File:Tomasulo Architecture.png|thumb|right|Tomasulo's floating point unit]]
===Register renaming===
Tomasulo's
Each functional unit has a single reservation station. Reservation stations hold information needed to execute a single instruction, including the operation and the operands. The functional unit begins processing when it is free and when all source operands needed for an instruction are real.
===Exceptions===
Practically speaking, there may be exceptions for which not enough status information about an exception is available, in which case the processor may raise a special exception, called an
Programs that experience
==Instruction lifecycle==
The three stages listed below are the stages through which each instruction passes from the time it is issued to the time its execution is complete.
===
*RS - Reservation Status
*RegisterStat - Register Status; contains information about the registers.
*regs[x] - Value of register x
*Mem[A] - Value of memory at address A
*rd - destination register number
*rs, rt - source registration numbers
*imm - sign extended immediate field
*r - reservation station or buffer that the instruction is assigned to
====Reservation Station Fields====
*Op - represents the operation being performed on operands
Line 55 ⟶ 71:
*A - used to hold the memory address information for a load or store
*Busy - 1 if occupied, 0 if not occupied
====Register Status Fields====
*Qi - the reservation station whose result should be stored in this register (if blank or 0, no values are destined for this register)
Line 65 ⟶ 83:
*Otherwise, we can assume the operands are not in the registers, and so use virtual values. The functional unit must calculate the real value to keep track of the functional units that produce the operand.
{|class="wikitable"
{{cite book▼
| last1 = Hennessy | first1 = John L.▼
| first2 = David A.| last2 = Patterson▼
| ___location = Waltham, MA▼
| publisher = [[Elsevier]]▼
| date = 2012▼
| isbn = 978-0123838728 | title-link = Computer Architecture: A Quantitative Approach
}}
</ref>{{rp|180}}▼
|-
!Instruction state
Line 72 ⟶ 100:
!Action or bookkeeping
|-
|FP operation
|Station {{mono|r}} empty
|<
if (RegisterStat[rs].Qi¦0) {
}
else {
Line 86 ⟶ 114:
}
else {
RS[r].Vk ← Regs[rt];
RS[r].Qk ← 0; }
RS[r].Busy ← yes;
RegisterStat[rd].
</syntaxhighlight>
|-
|Load or Store
|Buffer {{mono|r}} empty
|<
if (RegisterStat[rs].Qi¦0) {
RS[r].Qj ← RegisterStat[rs].Qi;
Line 104 ⟶ 133:
RS[r].A ← imm;
RS[r].Busy ← yes;
</syntaxhighlight>
|-
|Load only
|
|<
RegisterStat[rt].Qi ← r;
</syntaxhighlight>
|-
|Store only
|
|<
if (RegisterStat[rt].Qi¦0) {
RS[r].Qk ← RegisterStat[
}
else {
Line 122 ⟶ 151:
RS[r].Qk ← 0
};
</syntaxhighlight>
|}
▲|} <ref name="hennessy">
▲{{cite book
▲ | last1 = Hennessy | first1 = John L.
▲ | first2 = David A.| last2 = Patterson
▲ | title = [[Computer Architecture: A Quantitative Approach]]
▲ | ___location = Waltham, MA
▲ | publisher = [[Elsevier]]
▲ | date = 2012
▲</ref>{{rp|180}}
[[File:Example of Tomasulo's Algorithm.gif|thumb|Example of Tomasulo's
===Stage 2: execute===
In the execute stage, the instruction operations are carried out.
*If one or more of the operands is not yet available then: wait for operand to become available on the CDB.
Line 147 ⟶ 167:
*Else, the instruction is an [[arithmetic logic unit]] (ALU) operation then: execute the instruction at the corresponding functional unit
{|class="wikitable"
|-
!Instruction state
Line 155 ⟶ 175:
|-
|FP operation
| <
(RS[r].Qj = 0) and (RS[r].Qk = 0)
</syntaxhighlight>
|
Compute result: operands are in Vj and Vk
|-
|Load/store step 1
|<code>RS[r].Qj = 0</code> & r is head of load-store queue
|<
RS[r].A ← RS[r].Vj + RS[r].A;
</syntaxhighlight>
|-
|Load step 2
|Load step 1 complete
|
Read from <code>Mem[RS[r].A]</code>
|}
▲|} <ref name="hennessy" /> {{rp|180}}
===Stage 3: write result===
Line 182 ⟶ 199:
* Else, if the instruction was a store then: write the data to memory during this step
{|class="wikitable"
|-
!Instruction state
Line 190 ⟶ 207:
|-
|FP operation or load
|Execution complete at {{mono|r}} & CDB available
|<
∀x(if (RegisterStat[x].Qi = r) {
regs[x] ← result;
RegisterStat[x].Qi =
});
∀x(if (RS[x].Qj = r) {
Line 205 ⟶ 222:
});
RS[r].Busy ← no;
</syntaxhighlight>
|-
|Store
|Execution complete at {{mono|1=r & RS[r].Qk = 0}}
|<
Mem[RS[r].A] ← RS[r].Vk;
RS[r].Busy ← no;
</syntaxhighlight>
|}
▲|}<ref name="hennessy" /> {{rp|180}}
==Algorithm improvements==
Line 220 ⟶ 237:
Reservation stations take on the responsibility of waiting for operands in the presence of data dependencies and other inconsistencies such as varying storage access time and circuit speeds, thus freeing up the functional units. This improvement overcomes long floating point delays and memory accesses. In particular the algorithm is more tolerant of cache misses. Additionally, programmers are freed from implementing optimized code. This is a result of the common data bus and reservation station working together to preserve dependencies as well as encouraging concurrency.<ref name="tomasulo"/>{{rp|33}}
By tracking operands for instructions in the reservation stations and register renaming in hardware the algorithm minimizes [[
An equally important improvement in the algorithm is the design is not limited to a specific pipeline structure. This improvement allows the algorithm to be more widely adopted by [[multiple issue|multiple-issue]] processors. Additionally, the algorithm is easily extended to enable branch speculation.<ref name="hennessy" /> {{rp|182}}
== Applications and legacy ==
Tomasulo's algorithm was
# Once caches became commonplace,
# Dynamic scheduling and
# Proliferation of mass-market software meant that programmers would not want to compile for a specific pipeline structure. The algorithm can function with any pipeline architecture and thus software requires few architecture-specific modifications.<ref name="hennessy" /> {{rp|183}}
Many modern processors implement dynamic scheduling schemes that are
| date = September 2014
| title = Intel
| url = http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-software-developer-vol-1-manual.html
| publisher = Intel
|
}}</ref>{{Failed verification|date=February 2017|reason=The word Tomasulo isn't even mentioned?}}<ref name="adusan">{{cite web|last1=Yoga|first1=Adarsh|title=Differences between Tomasulo's algorithm and dynamic scheduling in Intel Core microarchitecture|url=http://adusan.blogspot.com.au/2010/11/differences-between-tomasulos-algorithm.html|website=The boozier|access-date=4 April 2016}}</ref>
== See also ==
* [[Re-order buffer]] (ROB)
* [[Instruction
== External links ==▼
* [http://www.cs.umd.edu/class/fall2001/cmsc411/projects/dynamic/tomasulo.html Dynamic Scheduling - Tomasulo's Algorithm]▼
* [http://www.dcs.ed.ac.uk/home/hase/webhase/demo/tomasulo.html HASE Java applet simulation of the Tomasulo's Algorithm]▼
== References ==
{{Reflist}}
== Further reading ==
* {{cite web |title=Pipelined and Out-of-Order Execution |author-first=John J. G. |author-last=Savard |date=2018 |orig-year=2014 |work=quadibloc |url=http://www.quadibloc.com/comp/cp07.htm |access-date=2018-07-16 |url-status=live |archive-url=https://web.archive.org/web/20180703004239/http://www.quadibloc.com/comp/cp07.htm |archive-date=2018-07-03}}
▲== External links ==
▲*
▲* [http://www.dcs.ed.ac.uk/home/hase/webhase/demo/tomasulo.html HASE Java applet simulation of the Tomasulo's
[[Category:Algorithms]]
|