Gang Luo, Hongfei Guo {gangluo,

Slides:



Advertisements
Similar presentations
Bimode Cascading: Adaptive Rehashing for ITTAGE Indirect Branch Predictor Y.Ishii, K.Kuroyanagi, T.Sawada, M.Inaba, and K.Hiraki.
Advertisements

Branch prediction Titov Alexander MDSP November, 2009.
Pipelining V Topics Branch prediction State machine design Systems I.
Hardware-based Devirtualization (VPC Prediction) Hyesoon Kim, Jose A. Joao, Onur Mutlu ++, Chang Joo Lee, Yale N. Patt, Robert Cohn* ++ *
Lecture Objectives: 1)Define branch prediction. 2)Draw a state machine for a 2 bit branch prediction scheme 3)Explain the impact on the compiler of branch.
Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Computer Organization and Architecture (AT70.01) Comp. Sc. and Inf. Mgmt. Asian Institute of Technology Instructor: Dr. Sumanta Guha Slide Sources: Based.
Dynamic Branch Prediction
Pipeline Hazards Pipeline hazards These are situations that inhibit that the next instruction can be processed in the next stage of the pipeline. This.
Branch Prediction in SimpleScalar
CPE 731 Advanced Computer Architecture ILP: Part II – Branch Prediction Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University.
W04S1 COMP s1 Seminar 4: Branch Prediction Slides due to David A. Patterson, 2001.
EECS 470 Branch Prediction Lecture 6 Coverage: Chapter 3.
1 COMP 206: Computer Architecture and Implementation Montek Singh Mon., Oct. 7, 2002 Topic: Instruction-Level Parallelism (Dynamic Branch Prediction)
1 Improving Branch Prediction by Dynamic Dataflow-based Identification of Correlation Branches from a Larger Global History CSE 340 Project Presentation.
EE8365/CS8203 ADVANCED COMPUTER ARCHITECTURE A Survey on BRANCH PREDICTION METHODOLOGY By, Baris Mustafa Kazar Resit Sendag.
EECE476: Computer Architecture Lecture 20: Branch Prediction Chapter extra The University of British ColumbiaEECE 476© 2005 Guy Lemieux.
VLSI Project Neural Networks based Branch Prediction Alexander ZlotnikMarcel Apfelbaum Supervised by: Michael Behar, Spring 2005.
EECC551 - Shaaban #1 lec # 5 Fall Reduction of Control Hazards (Branch) Stalls with Dynamic Branch Prediction So far we have dealt with.
EENG449b/Savvides Lec /17/04 February 17, 2004 Prof. Andreas Savvides Spring EENG 449bG/CPSC 439bG.
Combining Branch Predictors
EECC551 - Shaaban #1 lec # 7 Fall Hardware Dynamic Branch Prediction Simplest method: –A branch prediction buffer or Branch History Table.
Branch Target Buffers BPB: Tag + Prediction
Computer Architecture Instruction Level Parallelism Dr. Esam Al-Qaralleh.
Branch Prediction Dimitris Karteris Rafael Pasvantidιs.
Dynamic Branch Prediction
EENG449b/Savvides Lec /25/05 March 24, 2005 Prof. Andreas Savvides Spring g449b EENG 449bG/CPSC 439bG.
CIS 429/529 Winter 2007 Branch Prediction.1 Branch Prediction, Multiple Issue.
Arvind and Joel Emer Computer Science and Artificial Intelligence Laboratory M.I.T. Branch Prediction.
Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012.
Evaluation of the Gini-index for Studying Branch Prediction Features Veerle Desmet Lieven Eeckhout Koen De Bosschere.
A Hardware-based Cache Pollution Filtering Mechanism for Aggressive Prefetches Georgia Institute of Technology Atlanta, GA ICPP, Kaohsiung, Taiwan,
Analysis of Branch Predictors
ACSAC’04 Choice Predictor for Free Mongkol Ekpanyapong Pinar Korkmaz Hsien-Hsin S. Lee School of Electrical and Computer Engineering Georgia Institute.
1 Dynamic Branch Prediction. 2 Why do we want to predict branches? MIPS based pipeline – 1 instruction issued per cycle, branch hazard of 1 cycle. –Delayed.
Branch Prediction Prof. Mikko H. Lipasti University of Wisconsin-Madison Lecture notes based on notes by John P. Shen Updated by Mikko Lipasti.
CS 6290 Branch Prediction. Control Dependencies Branches are very frequent –Approx. 20% of all instructions Can not wait until we know where it goes –Long.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
Dynamic Branch Prediction
CSL718 : Pipelined Processors
Instruction-Level Parallelism Dynamic Branch Prediction
CS203 – Advanced Computer Architecture
Dynamic Branch Prediction
CS5100 Advanced Computer Architecture Advanced Branch Prediction
COSC3330 Computer Architecture Lecture 15. Branch Prediction
CS 704 Advanced Computer Architecture
Pipeline Implementation (4.6)
CMSC 611: Advanced Computer Architecture
So far we have dealt with control hazards in instruction pipelines by:
Branch statistics Branches occur every 4-6 instructions (16-25%) in integer programs; somewhat less frequently in scientific ones Unconditional branches.
Phase Capture and Prediction with Applications
Dynamic Branch Prediction
Advanced Computer Architecture
Pipelining and control flow
So far we have dealt with control hazards in instruction pipelines by:
Lecture 10: Branch Prediction and Instruction Delivery
Serene Banerjee, Lizy K. John, Brian L. Evans
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
pipelining: static branch prediction Prof. Eric Rotenberg
Adapted from the slides of Prof
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
Wackiness Algorithm A: Algorithm B:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
Aliasing and Anti-Aliasing in Branch History Table Prediction
So far we have dealt with control hazards in instruction pipelines by:
The O-GEHL branch predictor
Phase based adaptive Branch predictor: Seeing the forest for the trees
Presentation transcript:

Gang Luo, Hongfei Guo {gangluo, guo}@cs.wisc.edu 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 Why branch prediction? Software-based branch predictors Hardware-based branch predictors

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

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

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

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

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

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

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

3. Simulation Model Mode Level 1 Table Level 2 Table # of Entries Width 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 --

Spec95 Benchmarks Used Gcc Compress Li M88k Perl

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

Performance of Software-based Strategies

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

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

Performance of Hardware-based Strategies

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

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

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%

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

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.