SlideShare uma empresa Scribd logo
1 de 22
Baixar para ler offline
CSL718 : Superscalar
    Processors

  Renaming and Reordering
       5th Feb, 2009


      Anshul Kumar, CSE IITD
Why Renaming and Reordering?
• Register Renaming
    – Removes false dependencies (WAR and
      WAW)
• Reordering Buffer (ROB)
    – Ensures sequential consistency of interrupts
      (precise vs imprecise interrupts)
    – Facilitates speculative execution



                                                     slide 2
 Anshul Kumar, CSE IITD
RAW, WAR and WAW
                 (in Static Pipeline)
                 (in Static Pipeline)
                         IF   D RF EX WB
RAW
                              IF   D         RF EX WB

                         IF   D RF EX WB

WAR                           IF   D RF EX WB


                         IF   D RF EX EX EX WB

WAW                           IF   D RF EX        WB


                                                        slide 3
Anshul Kumar, CSE IITD
RAW, WAR and WAW
                    (in Superscalar)
                    (in Superscalar)
                                 b←1
write    IF       IS      DP EX   WB RAW
                                      b←0
read     IF       IS                   DP EX          WB
                                WAW
                                                    WAR
write    IF       IS             DP EX             WB
                                                  b←1


                scoreboard bit set by write, cleared by read
          what happens when there are multiple reads for a write?

                                                               slide 4
 Anshul Kumar, CSE IITD
Implementation using scoreboard bit
 Implementation using scoreboard bit
 in order issue, scoreboard bit set by write, cleared at issue time
               b←0                    b←1
write    IF      IS     DP EX         WB
                                            RAW

read     IF                 IS               DP EX      WB
                                                      WAR
read     IF                      IS          DP EX      WB
                                                      WAR
                                       WAW
write    IF                                          IS   DP EX          WB
                                                  b←0

               issue only if there are no pending reads

                                                               slide 5
   Anshul Kumar, CSE IITD
CDC 6600 like Implementation
        CDC 6600 like

                                 b←φ
              b ← FU1
write    IF      IS     DP EX     WB
                                       RAW

read     IF                 IS                DP EX      WB
                                 WAW
                                                           WAR
write    IF                              IS      DP EX      WB
                                       b ← FU2




                                                         slide 6
   Anshul Kumar, CSE IITD
IBM 360 like Implementation
        IBM 360 like Implementation

              b ← FU1            b←φ
write    IF      IS     DP EX     WB
                                       RAW

read     IF                 IS                DP EX      WB
                                 WAW
                                                           WAR
write    IF                              IS      DP EX      WB
                                       b ← FU2




                                                         slide 7
   Anshul Kumar, CSE IITD
Use of Renaming
                      Use of Renaming


write    IF      IS     DP EX    WB
                                       RAW

read     IF                 IS                DP EX    WB
                                 WAW                     WAR
write    IF                              IS    DP EX      WB




                                                       slide 8
   Anshul Kumar, CSE IITD
Register renaming
                         write R5
write R5
                                    RAW
                  RAW
                         read R5
read R5
                  WAR
                         write R8
write R5
                                    RAW
                  RAW
                         read R8
read R5



                                          slide 9
Anshul Kumar, CSE IITD
Who does renaming?
• Compiler
   – Done statically
   – Limited by registers visible to compiler
• Hardware
   – Done dynamically
   – Limited by registers available to hardware




                                                  slide 10
Anshul Kumar, CSE IITD
Types of renaming buffers
• Separate renaming register file and
  architectural register file
• Combined renaming and architectural
  register file

• Renaming combined with reordering
• Renaming combined with reservation
  stations and reordering
                                        slide 11
Anshul Kumar, CSE IITD
How renaming works?
         (in context of combined reg file)
         (in context of combined reg file)
register address
 from instruction


                            mapping




                                         physical register file
                                      (larger than architectural
                                             register file)

                                                                   slide 12
   Anshul Kumar, CSE IITD
Types of mapping
         Indexed               Associative
• Inexpensive            • Expensive
• Two steps required     • Single step associative
                           access
   – Look up index
   – Read value




                                              slide 13
Anshul Kumar, CSE IITD
Renaming with indexed access

           entry    index         value      value
           valid                             valid
register
number




            mapping table    physical register file




                                                      slide 14
    Anshul Kumar, CSE IITD
Renaming with associative access
                match
register
number
                entry reg         value     value latest
                valid num                   valid




                   physical register file (associative)


                                                           slide 15
    Anshul Kumar, CSE IITD
Handling interrupts


                                 these can “commit”
   status of
 instruction
  execution
at the time of
   interrupt

    completed
    under execution
    not started   program
                    order
                                            slide 16
    Anshul Kumar, CSE IITD
Speculative execution




                          predicted
                           branch


speculative                  don’t commit till correctness
                              of prediction is determined
 execution

                                                     slide 17
 Anshul Kumar, CSE IITD
Reordering
                         instruction enter

                                        i    i
                                                     x
                                                         x
 i: issued
 x: in execution
 f: finished


                                                             x
                                                         f
                                                     x
                                                 f

                            instructions commit/retire
                                                                 slide 18
Anshul Kumar, CSE IITD
Using ROB with RF

                             Register       to reservation
        from FUs
                              File           stations/FUs



                                 Register
from FUs             ROB          File          to reservation
                                                 stations/FUs




                                                     slide 19
    Anshul Kumar, CSE IITD
Future file and history file
                           Register   use in case of
                   ROB      File        interrupts
from FUs
                                      to reservation
                           Future
                                       stations/FUs
                            File
                                      update in case
displaced
                                       of interrupts
 values
                History
                 File      Future     to reservation
from FUs                    File       stations/FUs

                                            slide 20
  Anshul Kumar, CSE IITD
Combining renaming and reordering
Combining renaming and reordering
• Use physical register file as ROB as well
• Maintain status about committed and
  uncommitted values




                                              slide 21
 Anshul Kumar, CSE IITD
How much to speculate?
• Handle exceptions in speculated
  instructions?
   – handle only low cost exception events such as
     first level cache miss
   – wait if expensive exceptional event occurs such
     as second level cache miss or TLB miss
• Speculating through multiple branches
   – needed when branches are frequent or clustered
   – even handling multiple branches in a cycle may
     be required
                                                slide 22
Anshul Kumar, CSE IITD

Mais conteúdo relacionado

Mais de Ravi Soni

Lec 2 Multidisciplinary 183
Lec 2  Multidisciplinary 183Lec 2  Multidisciplinary 183
Lec 2 Multidisciplinary 183
Ravi Soni
 
Lec 5 Structure (Basics) 186
Lec 5  Structure (Basics) 186Lec 5  Structure (Basics) 186
Lec 5 Structure (Basics) 186
Ravi Soni
 
Lec Jan15 2009
Lec Jan15 2009Lec Jan15 2009
Lec Jan15 2009
Ravi Soni
 
Lec Jan29 2009
Lec Jan29 2009Lec Jan29 2009
Lec Jan29 2009
Ravi Soni
 
Lec Jan22 2009
Lec Jan22 2009Lec Jan22 2009
Lec Jan22 2009
Ravi Soni
 
Cs718min1 2008soln View
Cs718min1 2008soln ViewCs718min1 2008soln View
Cs718min1 2008soln View
Ravi Soni
 
Lec Jan12 2009
Lec Jan12 2009Lec Jan12 2009
Lec Jan12 2009
Ravi Soni
 
Lec Feb09 2009
Lec Feb09 2009Lec Feb09 2009
Lec Feb09 2009
Ravi Soni
 
Lec Jan19 2009
Lec Jan19 2009Lec Jan19 2009
Lec Jan19 2009
Ravi Soni
 
Lec Feb02 2009
Lec Feb02 2009Lec Feb02 2009
Lec Feb02 2009
Ravi Soni
 

Mais de Ravi Soni (11)

Lec 2 Multidisciplinary 183
Lec 2  Multidisciplinary 183Lec 2  Multidisciplinary 183
Lec 2 Multidisciplinary 183
 
Lec 1 182
Lec 1 182Lec 1 182
Lec 1 182
 
Lec 5 Structure (Basics) 186
Lec 5  Structure (Basics) 186Lec 5  Structure (Basics) 186
Lec 5 Structure (Basics) 186
 
Lec Jan15 2009
Lec Jan15 2009Lec Jan15 2009
Lec Jan15 2009
 
Lec Jan29 2009
Lec Jan29 2009Lec Jan29 2009
Lec Jan29 2009
 
Lec Jan22 2009
Lec Jan22 2009Lec Jan22 2009
Lec Jan22 2009
 
Cs718min1 2008soln View
Cs718min1 2008soln ViewCs718min1 2008soln View
Cs718min1 2008soln View
 
Lec Jan12 2009
Lec Jan12 2009Lec Jan12 2009
Lec Jan12 2009
 
Lec Feb09 2009
Lec Feb09 2009Lec Feb09 2009
Lec Feb09 2009
 
Lec Jan19 2009
Lec Jan19 2009Lec Jan19 2009
Lec Jan19 2009
 
Lec Feb02 2009
Lec Feb02 2009Lec Feb02 2009
Lec Feb02 2009
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Último (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Lec Feb05 2009

  • 1. CSL718 : Superscalar Processors Renaming and Reordering 5th Feb, 2009 Anshul Kumar, CSE IITD
  • 2. Why Renaming and Reordering? • Register Renaming – Removes false dependencies (WAR and WAW) • Reordering Buffer (ROB) – Ensures sequential consistency of interrupts (precise vs imprecise interrupts) – Facilitates speculative execution slide 2 Anshul Kumar, CSE IITD
  • 3. RAW, WAR and WAW (in Static Pipeline) (in Static Pipeline) IF D RF EX WB RAW IF D RF EX WB IF D RF EX WB WAR IF D RF EX WB IF D RF EX EX EX WB WAW IF D RF EX WB slide 3 Anshul Kumar, CSE IITD
  • 4. RAW, WAR and WAW (in Superscalar) (in Superscalar) b←1 write IF IS DP EX WB RAW b←0 read IF IS DP EX WB WAW WAR write IF IS DP EX WB b←1 scoreboard bit set by write, cleared by read what happens when there are multiple reads for a write? slide 4 Anshul Kumar, CSE IITD
  • 5. Implementation using scoreboard bit Implementation using scoreboard bit in order issue, scoreboard bit set by write, cleared at issue time b←0 b←1 write IF IS DP EX WB RAW read IF IS DP EX WB WAR read IF IS DP EX WB WAR WAW write IF IS DP EX WB b←0 issue only if there are no pending reads slide 5 Anshul Kumar, CSE IITD
  • 6. CDC 6600 like Implementation CDC 6600 like b←φ b ← FU1 write IF IS DP EX WB RAW read IF IS DP EX WB WAW WAR write IF IS DP EX WB b ← FU2 slide 6 Anshul Kumar, CSE IITD
  • 7. IBM 360 like Implementation IBM 360 like Implementation b ← FU1 b←φ write IF IS DP EX WB RAW read IF IS DP EX WB WAW WAR write IF IS DP EX WB b ← FU2 slide 7 Anshul Kumar, CSE IITD
  • 8. Use of Renaming Use of Renaming write IF IS DP EX WB RAW read IF IS DP EX WB WAW WAR write IF IS DP EX WB slide 8 Anshul Kumar, CSE IITD
  • 9. Register renaming write R5 write R5 RAW RAW read R5 read R5 WAR write R8 write R5 RAW RAW read R8 read R5 slide 9 Anshul Kumar, CSE IITD
  • 10. Who does renaming? • Compiler – Done statically – Limited by registers visible to compiler • Hardware – Done dynamically – Limited by registers available to hardware slide 10 Anshul Kumar, CSE IITD
  • 11. Types of renaming buffers • Separate renaming register file and architectural register file • Combined renaming and architectural register file • Renaming combined with reordering • Renaming combined with reservation stations and reordering slide 11 Anshul Kumar, CSE IITD
  • 12. How renaming works? (in context of combined reg file) (in context of combined reg file) register address from instruction mapping physical register file (larger than architectural register file) slide 12 Anshul Kumar, CSE IITD
  • 13. Types of mapping Indexed Associative • Inexpensive • Expensive • Two steps required • Single step associative access – Look up index – Read value slide 13 Anshul Kumar, CSE IITD
  • 14. Renaming with indexed access entry index value value valid valid register number mapping table physical register file slide 14 Anshul Kumar, CSE IITD
  • 15. Renaming with associative access match register number entry reg value value latest valid num valid physical register file (associative) slide 15 Anshul Kumar, CSE IITD
  • 16. Handling interrupts these can “commit” status of instruction execution at the time of interrupt completed under execution not started program order slide 16 Anshul Kumar, CSE IITD
  • 17. Speculative execution predicted branch speculative don’t commit till correctness of prediction is determined execution slide 17 Anshul Kumar, CSE IITD
  • 18. Reordering instruction enter i i x x i: issued x: in execution f: finished x f x f instructions commit/retire slide 18 Anshul Kumar, CSE IITD
  • 19. Using ROB with RF Register to reservation from FUs File stations/FUs Register from FUs ROB File to reservation stations/FUs slide 19 Anshul Kumar, CSE IITD
  • 20. Future file and history file Register use in case of ROB File interrupts from FUs to reservation Future stations/FUs File update in case displaced of interrupts values History File Future to reservation from FUs File stations/FUs slide 20 Anshul Kumar, CSE IITD
  • 21. Combining renaming and reordering Combining renaming and reordering • Use physical register file as ROB as well • Maintain status about committed and uncommitted values slide 21 Anshul Kumar, CSE IITD
  • 22. How much to speculate? • Handle exceptions in speculated instructions? – handle only low cost exception events such as first level cache miss – wait if expensive exceptional event occurs such as second level cache miss or TLB miss • Speculating through multiple branches – needed when branches are frequent or clustered – even handling multiple branches in a cycle may be required slide 22 Anshul Kumar, CSE IITD