Tomasulo's algorithm

Tomasulo's algorithm is a computer architecture hardware algorithm for dynamic scheduling of instructions that allows out-of-order execution and enables more efficient use of multiple execution units. It was developed by Robert Tomasulo at IBM in 1967 and was first implemented in the IBM System/360 Model 91’s floating point unit.[1]

The major innovations of Tomasulo’s algorithm include register renaming in hardware, reservation stations for all execution units, and a common data bus (CDB) on which computed values broadcast to all reservation stations that may need them. These developments allow for improved parallel execution of instructions that would otherwise stall under the use of scoreboarding or other earlier algorithms.

Robert Tomasulo received the Eckert–Mauchly Award in 1997 for his work on the algorithm.[2]

Implementation concepts

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".[1]: 33  This has two important effects:

  1. Functional units can access the result of any operation without involving a floating-point-register, allowing multiple units waiting on a result to proceed without waiting to resolve contention for access to register file read ports.
  2. 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

Instructions are issued sequentially so that the effects of a sequence of instructions, such as exceptions 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).

Register renaming

Tomasulo's algorithm uses register renaming to correctly perform out-of-order execution. All general-purpose and reservation station registers hold either a real value or a placeholder value. If a real value is unavailable to a destination register during the issue stage, a placeholder value is initially used. The placeholder value is a tag indicating which reservation station will produce the real value. When the unit finishes and broadcasts the result on the CDB, the placeholder will be replaced with the real value.

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 imprecise exception. Imprecise exceptions cannot occur in in-order implementations, as processor state is changed only in program order (see Classic RISC pipeline § Exceptions).

Programs that experience precise exceptions, where the specific instruction that took the exception can be determined, can restart or re-execute at the point of the exception. However, those that experience imprecise exceptions generally cannot restart or re-execute, as the system cannot determine the specific instruction that took the exception.

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.

Legend

  • 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
  • Qj, Qk - the reservation station that will produce the relevant source operand (0 indicates the value is in Vj, Vk)
  • Vj, Vk - the value of the source operands
  • 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)

Stage 1: issue

In the issue stage, instructions are issued for execution if all operands and reservation stations are ready or else they are stalled. Registers are renamed in this step, eliminating WAR and WAW hazards.

  • Retrieve the next instruction from the head of the instruction queue. If the instruction operands are currently in the registers, then
    • If a matching functional unit is available, issue the instruction.
    • Else, as there is no available functional unit, stall the instruction until a station or buffer is free.
  • 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.
Pseudocode[3]: 180 
Instruction state Wait until Action or bookkeeping
FP operation Station r empty
if (RegisterStat[rs].Qi¦0) {
	RS[r].Qj  RegisterStat[rs].Qi
}
else {
	RS[r].Vj  Regs[rs];
	RS[r].Qj  0;
}
if (RegisterStat[rt].Qi¦0) { 
	RS[r].Qk  RegisterStat[rt].Qi;
}
else {
	RS[r].Vk  Regs[rt]; 
	RS[r].Qk  0;
}
RS[r].Busy  yes;
RegisterStat[rd].Qi  r;
Load or Store Buffer r empty
if (RegisterStat[rs].Qi¦0) {
	RS[r].Qj  RegisterStat[rs].Qi;
}
else {
	RS[r].Vj  Regs[rs];
	RS[r].Qj  0;
}
RS[r].A  imm;
RS[r].Busy  yes;
Load only
RegisterStat[rt].Qi  r;
Store only
if (RegisterStat[rt].Qi¦0) {
	RS[r].Qk  RegisterStat[rt].Qi;
}
else {
	RS[r].Vk  Regs[rt];
	RS[r].Qk  0
};
Example of Tomasulo's algorithm[4]

Stage 2: execute

In the execute stage, the instruction operations are carried out. Instructions are delayed in this step until all of their operands are available, eliminating RAW hazards. Program correctness is maintained through effective address calculation to prevent hazards through memory.

  • If one or more of the operands is not yet available then: wait for operand to become available on the CDB.
  • When all operands are available, then: if the instruction is a load or store
    • Compute the effective address when the base register is available, and place it in the load/store buffer
      • If the instruction is a load then: execute as soon as the memory unit is available
      • Else, if the instruction is a store then: wait for the value to be stored before sending it to the memory unit
  • Else, the instruction is an arithmetic logic unit (ALU) operation then: execute the instruction at the corresponding functional unit
Pseudocode[3] : 180 
Instruction state Wait until Action or bookkeeping
FP operation
(RS[r].Qj = 0) and (RS[r].Qk = 0)

Compute result: operands are in Vj and Vk

Load/store step 1 RS[r].Qj = 0 & r is head of load-store queue
RS[r].A ← RS[r].Vj + RS[r].A;
Load step 2 Load step 1 complete

Read from Mem[RS[r].A]

Stage 3: write result

In the write Result stage, ALU operations results are written back to registers and store operations are written back to memory.

  • If the instruction was an ALU operation
    • If the result is available, then: write it on the CDB and from there into the registers and any reservation stations waiting for this result
  • Else, if the instruction was a store then: write the data to memory during this step
Pseudocode[3] : 180 
Instruction state Wait until Action or bookkeeping
FP operation or load Execution complete at r & CDB available
	x(if (RegisterStat[x].Qi = r) {
		regs[x]  result;
		RegisterStat[x].Qi = 0
	});
	x(if (RS[x].Qj = r) {
		RS[x].Vj  result;
		RS[x].Qj  0; 
	});
	x(if (RS[x].Qk = r) {
		RS[x].Vk  result;
		RS[x].Qk  0;
	});
	RS[r].Busy  no;
Store Execution complete at r & RS[r].Qk = 0
	Mem[RS[r].A]  RS[r].Vk;
	RS[r].Busy  no;

Algorithm improvements

The concepts of reservation stations, register renaming, and the common data bus in Tomasulo's algorithm presents significant advancements in the design of high-performance computers.

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.[1]: 33 

By tracking operands for instructions in the reservation stations and register renaming in hardware the algorithm minimizes read-after-write (RAW) and eliminates write-after-write (WAW) and Write-after-Read (WAR) computer architecture hazards. This improves performance by reducing wasted time that would otherwise be required for stalls.[1]: 33 

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 processors. Additionally, the algorithm is easily extended to enable branch speculation.[3] : 182 

Applications and legacy

Tomasulo's algorithm was implemented in the System/360 Model 91 architecture. Outside of IBM, it went unused for several years. However, it saw a vast increase in usage during the 1990s for 3 reasons:

  1. Once caches became commonplace, the algorithm's ability to maintain concurrency during unpredictable load times caused by cache misses became valuable in processors.
  2. Dynamic scheduling and branch speculation from the algorithm enables improved performance as processors issued more and more instructions.
  3. 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.[3] : 183 

Many modern processors implement dynamic scheduling schemes that are variants of Tomasulo's original algorithm, including popular Intel x86-64 chips.[5][failed verification][6]

See also

References

  1. ^ a b c d Tomasulo, Robert Marco (Jan 1967). "An Efficient Algorithm for Exploiting Multiple Arithmetic Units". IBM Journal of Research and Development. 11 (1). IBM: 25–33. doi:10.1147/rd.111.0025. ISSN 0018-8646. S2CID 8445049.
  2. ^ "Robert Tomasulo – Award Winner". ACM Awards. ACM. Retrieved 8 December 2014.
  3. ^ a b c d e Hennessy, John L.; Patterson, David A. (2012). Computer Architecture: A Quantitative Approach. Waltham, MA: Elsevier. ISBN 978-0123838728.
  4. ^ "CSE P548 - Tomasulo" (PDF). washington.edu. Washington University. 2006. Retrieved 8 December 2014.
  5. ^ Intel 64 and IA-32 Architectures Software Developer's Manual (Report). Intel. September 2014. Retrieved 8 December 2014.
  6. ^ Yoga, Adarsh. "Differences between Tomasulo's algorithm and dynamic scheduling in Intel Core microarchitecture". The boozier. Retrieved 4 April 2016.

Further reading

Read other articles:

Vasili MerkuryevPAULahir(1904-04-06)6 April 1904Ostrov, Kekaisaran RusiaMeninggal12 Mei 1978(1978-05-12) (umur 74)Leningrad, USSR, RusiaMakamPemakaman VolkovoSaint Petersburg, RussiaKebangsaanRusiaPendidikanAkademi Seni Teater Negeri Sankt-PeterburgPekerjaanAktorTahun aktif1935-1974Suami/istriIrina Meyerhold(1933-1978; kematiannya)AnakPyotr Merkurev Vasili Vasilyevich Merkuryev (bahasa Rusia: Василий Васильевич Меркурьев; 6 April 1904 – ...

 

Arco di TraianoCiviltàRomana UtilizzoArco trionfale EpocaII secolo d.C. LocalizzazioneStato Italia ComuneAncona AmministrazioneVisitabileSi Mappa di localizzazione Modifica dati su Wikidata · ManualeCoordinate: 43°37′31″N 13°30′23.4″E / 43.625278°N 13.5065°E43.625278; 13.5065 L'arco di Traiano di Ancona è un arco trionfale attribuito ad Apollodoro di Damasco, fatto costruire nel II secolo d.C. dal Senato romano per esprimere la propria riconoscenza...

 

Daftar tokoh Aceh adalah daftar yang berisi nama tokoh-tokoh yang berasal dari provinsi Aceh, baik yang dari etnis Aceh maupun etnis lain yang lahir di provinsi Aceh. Khusus untuk tokoh dari etnis Aceh bisa dilihat di Daftar tokoh suku Aceh. Daftar ini belumlah lengkap, pembaca dipersilakan menambahinya dengan nama-nama tokoh lain yang belum masuk daftar ini. Berikut daftar tokoh dari provinsi Aceh. Ahli dan akademisi Ali Hasjmy, akademisi, gubernur Aceh ke 8 Bachtiar Aly, ahli komunikasi pol...

GunungmasigitDesaNegara IndonesiaProvinsiJawa BaratKabupatenBandung BaratKecamatanCipatatKode pos40754[1]Kode Kemendagri32.17.07.2008 Luas... km²Jumlah penduduk... jiwaKepadatan... jiwa/km² Gunung Masigit pada tahun 1917 Gunungmasigit adalah desa di kecamatan Cipatat, Kabupaten Bandung Barat, Jawa Barat, Indonesia. Referensi ^ Kode Pos Kecamatan Cipatat Pranala luar (Indonesia) Keputusan Menteri Dalam Negeri Nomor 050-145 Tahun 2022 tentang Pemberian dan Pemutakhiran Kode, Data...

 

Kesatuan Mahasiswa Hindu Dharma IndonesiaLogo / Lambang Kesatuan Mahasiswa Hindu Dharma IndonesiaSingkatanKMHDITanggal pendirian3 September 1993; 30 tahun lalu (1993-09-03)TipeOrganisasi Kemahasiswaan, Perkaderan dan Perjuangan.Tujuan1. Wadah Pemersatu Mahasiswa Hindu Indonesia; 2. Alat Pendidikan Kader Mahasiswa Hindu Indonesia.Kantor pusatJakarta, IndonesiaBahasa resmi IndonesiaKetua Umum PP KMHDI (2023-2025)I Wayan DarmawanSitus webhttps://kmhdi.org/ Kesatuan Mahasiswa Hindu Dharma In...

 

The list of shipwrecks in 1973 includes ships sunk, foundered, grounded, or otherwise lost during 1973. This is a dynamic list and may never be able to satisfy particular standards for completeness. You can help by adding missing items with reliable sources. table of contents ← 1972 1973 1974 → Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Unknown date References January 1 January List of shipwrecks: 1 January 1973 Ship State Description Donna R  United States Th...

Artikel ini memiliki beberapa masalah. Tolong bantu memperbaikinya atau diskusikan masalah-masalah ini di halaman pembicaraannya. (Pelajari bagaimana dan kapan saat yang tepat untuk menghapus templat pesan ini) Netralitas artikel ini dipertanyakan. Diskusi terkait dapat dibaca pada the halaman pembicaraan. Jangan hapus pesan ini sampai kondisi untuk melakukannya terpenuhi. (Pelajari cara dan kapan saatnya untuk menghapus pesan templat ini) Artikel ini mungkin mengandung riset asli. Anda dapat...

 

For other settlements in Burkina Faso named Gounghin, see Gounghin.Place in Centre-Est Region, Burkina FasoGounghin-PetitCountry Burkina FasoRegionCentre-Est RegionProvinceBoulgou ProvinceDepartmentBissiga DepartmentPopulation (2005 est.) • Total338 Gounghin-Petit is a village in the Bissiga Department of Boulgou Province in south-eastern Burkina Faso. As of 2005, the village has a population of 338.[1] References ^ Burkinabé government inforoute communale Archi...

 

History of the feminist movement in Norway Feminism in NorwayFeminist Hulda Garborg influenced Norwegian civil society in the 19th century.Gender Inequality Index[1]Value0.016 (2021)Rank2nd out of 191 Global Gender Gap Index[2]Value0.845 (2022)Rank3rd out of 146 Part of a series onFeminism History Feminist history History of feminism Women's history American British Canadian German Waves First Second Third Fourth Timelines Women's suffrage Muslim countries US Other women's rig...

1805 battle during the War of the Third Coalition Battle of DonauwörthPart of the War of the Third CoalitionCrossing of the Danube near Donauwörthby Wilhelm von Kobell, 1807Date7 October 1805LocationDonauwörth, Electorate of Bavaria, Holy Roman Empire48°41′47″N 10°48′00″E / 48.6964°N 10.8001°E / 48.6964; 10.8001Result French victoryBelligerents  First French Empire  Austrian EmpireCommanders and leaders Joachim Murat Jean-de-Dieu Soult Michael ...

 

Земская почтаУезды Алатырский Александрийский Ананьевский Ардатовский Арзамасский Аткарский Ахтырский Балашовский Бахмутский Бежецкий Белебеевский Белозерский Бердянский Бобровский Богородский Богучарский Борисоглебский Боровичский Бронницкий Бугульминский Бу�...

 

Virginia International TattooThe Pipes and Drums of the 1st Battalion, Scots Guards at the tattoo in 2015.GenrePatriotic, concert band, military, marchingDatesLate April Each YearLocation(s)Norfolk, Virginia, USAYears active1997–presentWebsiteOfficial website The Virginia International Tattoo is a military tattoo that began in 1997 and is the signature event of the Virginia Arts Festival. Presented annually in Norfolk, Virginia, the tattoo is an exhibition of military bands, massed pipes an...

Questa voce sull'argomento calciatori senegalesi è solo un abbozzo. Contribuisci a migliorarla secondo le convenzioni di Wikipedia. Segui i suggerimenti del progetto di riferimento. Saliou Ciss Nazionalità  Senegal Altezza 173 cm Peso 62 kg Calcio Ruolo Difensore Squadra svincolato CarrieraSquadre di club1 2010-2013 Tromsø71 (2)2013-2017 Valenciennes90 (8)2013-2016 Valenciennes 23 (0)2017-2018 Angers4 (0)2018→  Valenciennes9 (2)2018-2019 Angers0 (...

 

HazaraهزارهPotret suku HazaraJumlah populasic. 13 juta[1]Daerah dengan populasi signifikan Afganistan7,864,056 (2014)[2] Pakistan1,500,000 (2012)[3][4] Iran134,000 (1993)[3] Australia600,000 (2013)[butuh rujukan] Kanada45,3000[5]  Indonesia3,800[6] BahasaBahasa Persia(Persia Hazara • Persia Afganistan/Dar'i • Persia Iran)AgamaMayoritas Islam Syiah (Dua Belas Imam and Ismailiyah), d...

 

Board game This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Mall Madness – news · newspapers · books · scholar · JSTOR (April 2018) (Learn how and when to remove this message) Mall MadnessMall Madness (1988)ManufacturersMilton BradleyPublishersHasbroPublication1988Years active1988 to PresentGenresBoard GamePl...

New York City, the world's principal financial center[1][2] and the epicenter of the principal American metropolitan economy[3] Further information: Technological and industrial history of the United States This article is part of a series on theEconomy of theUnited States Economic history Agricultural history Banking history Petroleum history Shipbuilding Industrial Revolution in the United States History of the United States dollar Lumber history Tariff History Unit...

 

1976 single by Silver ConventionGet Up and BoogieArtwork for German vinyl singleSingle by Silver Conventionfrom the album Get Up and Boogie B-sideSon of a GunReleasedMarch 1976GenreDiscoLength2:49 (single version)4:00 (album version)LabelMidland InternationalSongwriter(s) Sylvester Levay Stephan Prager Producer(s)Stephan PragerSilver Convention singles chronology Fly, Robin, Fly (1975) Get Up and Boogie (1976) Tiger Baby (1976) Get Up and Boogie is a song by German disco act Silver Convention...

 

مايك إسبي (بالإنجليزية: Mike Espy)‏    مناصب عضو مجلس النواب الأمريكي[1][2]   عضو خلال الفترة3 يناير 1987  – 3 يناير 1989  فترة برلمانية الكونغرس الأمريكي الـ100  [لغات أخرى]‏  عضو مجلس النواب الأمريكي[1][2]   عضو خلال الفترة3 يناير 1989  – 3 يناير 19...

Conflicts over Comanche lands, 1706 to 1870s Comanche WarsPart of the Texas–Indian warsA map showing the Comanche lands (Comancheria) during the 1800sDate1706 – 1875LocationSouth-central United States (Texas, Oklahoma, New Mexico, Kansas, Colorado) and northern MexicoResult Comanche victory over Spain and Mexico Final Texan and United States victoryBelligerents  Spain Mexico Republic of TexasChoctaw Republic[1] United States Comanche Texas Comanche wars 183...

 

Julián Jiménez Serrano Alcalde de Linares 19 de abril de 1979-20 de enero de 1982 Diputado en las Cortes Generalespor Jaén 19 de abril de 1977-2 de enero de 1979 Información personalNacimiento 1914 Madrid (España) Fallecimiento 20 de enero de 1982 Linares (España) Nacionalidad EspañolaInformación profesionalOcupación Político Partido político Partido Socialista Obrero Español Miembro de Unión General de Trabajadores [editar datos en Wikidata] Julián Jiménez Serrano (M...