1 / 22

Software-based and Hardware-based Branch Prediction Strategies and Performance Evaluation

Software-based and Hardware-based Branch Prediction Strategies and Performance Evaluation. Gang Luo, Hongfei Guo {gangluo, guo}@cs.wisc.edu. Contents. Background Implementation based on SimpleScalar3.0 Simulation Model Simulation Results Conclusion and Future work. 1. Background.

isha
Download Presentation

Software-based and Hardware-based Branch Prediction Strategies and Performance Evaluation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Software-based and Hardware-based Branch Prediction Strategiesand Performance Evaluation Gang Luo, Hongfei Guo {gangluo, guo}@cs.wisc.edu

  2. Contents • Background • Implementation based on SimpleScalar3.0 • Simulation Model • Simulation Results • Conclusion and Future work

  3. 1. Background • Why branch prediction? • Software-based branch predictors • Hardware-based branch predictors

  4. Why need branch prediction • Avoid control hazard • Predict branch direction and branch address • Avoid stopping pipeline • Speedup program execution

  5. Classification of Branch Prediction Strategies • Software-based static branch predictors • Hardware-based dynamic branch predictors

  6. Software-based Strategy • Always Taken • Always Not Taken • Backward Taken, Forward Not Taken • All branches with certain operation codes Taken, others Not Taken

  7. Hardware-based Strategy • One-bit counter • Two-bit counter • Gag • Pag • Pap • Branch Instruction Table

  8. 2. Implementation based on SS3.0 • Backward taken & forward not taken • one-bit prediction counter • fix a bug ---- Support command line configuration

  9. current branch address Y target address Current address > Target address Predicted address Next inst. address target address N Backward taken & forward not taken branch predictor

  10. 0 1 …… 1 0 address2 Addressn-1 address1 address n target address2 target address n-1 target address1 target address n …… One bit counter (two bits counter) HASH table current branch address HASH Predicted direction Lookup BTB update Predicted target 2 to 1 MUX Predicted inst. address Next inst. address Compare update New inst. address Branch prediction counter

  11. 3. Simulation Model ModeLevel 1 TableLevel 2 Table # of EntriesWidth of SR# of Entries • One-bit -- -- 2048 • Bimode -- -- 2048 • GAg 1 11 2048 • PAg 4 11 2048 • PAp 4 7 2048 • BTB 512 Associ. 4 --

  12. Spec95 Benchmarks Used • Gcc • Compress • Li • M88k • Perl

  13. 4. Simulation Results • Results of software-based Strategies • Results of hardware-based Strategies • Software-based Strategies vs. hardware-based Strategies • Explanations

  14. Performance of Software-based Strategies

  15. Analysis of Software-based Strategies • Always Taken is the best one • Always Not Taken & Backward Taken, Forward Not Taken are equally bad

  16. Explanation • Backward Taken, Forward Not Taken is mainly pointed at the for loop and while loop statement • Most branches in the program are inclined to be taken

  17. Performance of Hardware-based Strategies

  18. Analysis of Hardware-based Strategies • Two-bit counter and Gag are the best two • One-bit counter, Pag, and Pap also achieve high prediction accuracy

  19. Explanation • One-bit counter: intrinsic shortcoming • Pag: all the branch histories share the same global two-bit counter tables, which leads to confusion • Pap: too many branch history pattern tables compared to the number of instructions executed, can’t get enough training

  20. Software-based Strategies vs. Hardware-based Strategies • Hardware-based strategies always achieve high prediction accuracy, greater than 90% • Most software-based strategies achieve low prediction accuracy, less than 70%

  21. Explanation • Different data sets will let the programs have different dynamic branch behaviors • Even for the same data set, the same branch instruction will exhibit different dynamic branch behaviors at different times in the same running

  22. 5. Future Work • Use some AI algorithms to adjust the parameters of the branch prediction strategies, then we can ensure the most proper training time to achieve the highest performance.

More Related