Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012.

Slides:



Advertisements
Similar presentations
Branch prediction Titov Alexander MDSP November, 2009.
Advertisements

Dynamic History-Length Fitting: A third level of adaptivity for branch prediction Toni Juan Sanji Sanjeevan Juan J. Navarro Department of Computer Architecture.
Lecture 8 Dynamic Branch Prediction, Superscalar and VLIW Advanced Computer Architecture COE 501.
Hardware-based Devirtualization (VPC Prediction) Hyesoon Kim, Jose A. Joao, Onur Mutlu ++, Chang Joo Lee, Yale N. Patt, Robert Cohn* ++ *
Pipelining and Control Hazards Oct
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.
CPE 731 Advanced Computer Architecture ILP: Part II – Branch Prediction Dr. Gheith Abandah Adapted from the slides of Prof. David Patterson, University.
Computer Architecture 2011 – Branch Prediction 1 Computer Architecture Advanced Branch Prediction Lihu Rappoport and Adi Yoaz.
CS 7810 Lecture 7 Trace Cache: A Low Latency Approach to High Bandwidth Instruction Fetching E. Rotenberg, S. Bennett, J.E. Smith Proceedings of MICRO-29.
EECS 470 Branch Prediction Lecture 6 Coverage: Chapter 3.
WCED: June 7, 2003 Matt Ramsay, Chris Feucht, & Mikko Lipasti University of Wisconsin-MadisonSlide 1 of 26 Exploring Efficient SMT Branch Predictor Design.
EE8365/CS8203 ADVANCED COMPUTER ARCHITECTURE A Survey on BRANCH PREDICTION METHODOLOGY By, Baris Mustafa Kazar Resit Sendag.
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.
1 Lecture 8: Branch Prediction, Dynamic ILP Topics: branch prediction, out-of-order processors (Sections )
EECC722 - Shaaban #1 Lec # 10 Fall Conventional & Block-based Trace Caches In high performance superscalar processors the instruction fetch.
Goal: Reduce the Penalty of Control Hazards
Branch Target Buffers BPB: Tag + Prediction
EECC551 - Shaaban #1 lec # 5 Winter Reduction of Control Hazards (Branch) Stalls with Dynamic Branch Prediction So far we have dealt with.
Computer Architecture Instruction Level Parallelism Dr. Esam Al-Qaralleh.
Branch Prediction Dimitris Karteris Rafael Pasvantidιs.
Branch pred. CSE 471 Autumn 011 Branch statistics Branches occur every 4-6 instructions (16-25%) in integer programs; somewhat less frequently in scientific.
Dynamic Branch Prediction
Spring 2003CSE P5481 Control Hazard Review The nub of the problem: In what pipeline stage does the processor fetch the next instruction? If that instruction.
Pipelined Datapath and Control (Lecture #15) ECE 445 – Computer Organization The slides included herein were taken from the materials accompanying Computer.
1 Lecture 7: Branch prediction Topics: bimodal, global, local branch prediction (Sections )
EECC722 - Shaaban #1 Lec # 9 Fall Conventional & Block-based Trace Caches In high performance superscalar processors the instruction fetch.
Branch Prediction CSE 4711 Branch statistics Branches occur every 4-7 instructions on average in integer programs, commercial and desktop applications;
Arvind and Joel Emer Computer Science and Artificial Intelligence Laboratory M.I.T. Branch Prediction.
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.
CSCI 6461: Computer Architecture Branch Prediction Instructor: M. Lancaster Corresponding to Hennessey and Patterson Fifth Edition Section 3.3 and Part.
Branch.1 10/14 Branch Prediction Static, Dynamic Branch prediction techniques.
Korea UniversityG. Lee CRE652 Processor Architecture Dynamic Branch Prediction.
Computer Architecture 2015 – Advanced Branch Prediction 1 Computer Architecture Advanced Branch Prediction By Yoav Etsion and Dan Tsafrir Presentation.
Adapted from Computer Organization and Design, Patterson & Hennessy, UCB ECE232: Hardware Organization and Design Part 13: Branch prediction (Chapter 4/6)
COMPSYS 304 Computer Architecture Speculation & Branching Morning visitors - Paradise Bay, Bay of Islands.
Samira Khan University of Virginia April 12, 2016
Dynamic Branch Prediction
CSL718 : Pipelined Processors
CS203 – Advanced Computer Architecture
Computer Structure Advanced Branch Prediction
Dynamic Branch Prediction
Computer Architecture Advanced Branch Prediction
CS5100 Advanced Computer Architecture Advanced Branch Prediction
COSC3330 Computer Architecture Lecture 15. Branch Prediction
Samira Khan University of Virginia Dec 4, 2017
CMSC 611: Advanced Computer Architecture
Module 3: Branch Prediction
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.
15-740/ Computer Architecture Lecture 24: Control Flow
Dynamic Branch Prediction
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: dynamic branch prediction Prof. Eric Rotenberg
Adapted from the slides of Prof
Dynamic Hardware Prediction
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
So far we have dealt with control hazards in instruction pipelines by:
Samira Khan University of Virginia Mar 6, 2019
Lecture 7: Branch Prediction, Dynamic ILP
Presentation transcript:

Evaluation of Dynamic Branch Prediction Schemes in a MIPS Pipeline Debajit Bhattacharya Ali JavadiAbhari ELE 475 Final Project 9 th May, 2012

 Motivation  Branch Prediction  Simulation Setup & Testing Methodology  Dynamic Branch Prediction  Single Bit Saturating Counter  Two Bit Saturating Counter  Two Level Local Branch History & Single Bit Prediction  Two Level Local Branch History & Two Bit Prediction  Comparison of Performances  Conclusion  Future Work Outline

Why Branch Prediction?  Branches (Conditional & Un-conditional) redirect the stream of instructions – results in dead cycles in the front-end  Branch Cost increases with –  Super-pipeline – delays the branch resolution  e.g. Pentium 3 & 4 have 10 and 20 cycles penalty respectively  Super-scalar – multiplies the dead instructions  e.g. 6-stage MIPS pipe has 3 and 7 dead instructions in their one way and two way implementations respectively

Branch Prediction  Minimizes the dead cycles generated by a “taken” branch  Essential in modern processors to restore the IPC  Two components of prediction –  Direction/Outcome of branch (applies to conditional branches only)  Target of branch (applies to all branches)

Simulation Setup & Testing Methodology  5 Stage MIPS pipeline  Parcv2 instruction set  Pv2byp – configuration from Lab  Own Assembly Test  Micro-benchmarks from Lab  Vector-vector Add  Complex Multiply  Binary Search  Masked Filter

Pv2Byp Pipeline  Target address of J and JAL known at D stage  Target address of JR and JALR known at X stage  Branch direction/outcome known at X stage D X M W

Dynamic Branch Prediction  Performance = f(accuracy, cost of misprediction)  One Level Predictor – Bimodal Prediction  Branch History Table  Branch Target Buffer  Two level Predictor  Branch History Register Table  Pattern History Table  Branch Target Buffer  All the tables are read at the F stage for prediction  All the tables are written in either D or X stage (depending on the resolution of the branch and correctness of prediction

Hardware Description  BHT  Indexed by the lower bits of PC  Holds the prediction bit(s) (1 or 2)  BHR  Indexed by lower bits of PC  Holds the local branch history bits  PHT  Indexed by entries of BHR bits  Holds the prediction bit(s)  BTB  Indexed by lower bits of PC  Holds the rest of the bits of PC as tag  Holds the branch target PC  Holds a valid bit for two level predictor

Hardware Description Predict BitsValidTagTarget PC[bht_IndexSize+1:2] PC[btb_IndexSize+1:2] BHTBTB = PC[31:btb_IndexSize+2] BTB Hit

One Bit Saturating Counter  Exploits Temporal Correlation between two states – T and NT  Always two mispredicts in a backward branch loop Predict T Predict NT T

Two bit Saturating Counter  Needs two consecutive T/NT to change prediction state  Tolerates one branch going unusual direction, still predicts next branch correctly  Works better than One bit Counter in a nested loop Predict T Predict T NT T Predict NT Predict NT Strong Taken Weak Taken Weak Not taken Strong Not taken

Two level Branch Predictor [Yeh & Patt, ’92]  Many branches execute repetitive patterns  Local/Current branch history patterns  Requires Initial settling of counter values 111……….01 S index Pattern History Bit(s) FSM Logic Prediction Bit Branch Result from X stage BHR PHT

Comparison of Performance

Effect of BTB Size 1 Level 2 Bit

Effect of PHT Size 2 Level 2 Bit

Conclusion  Predictor Size – Hardware Cost – Better Prediction Accuracy  Larger BHTs – Smaller BTBs – Reduces Hardware cost – Reuses branch history even if the entry is not present in BTB  Smaller BHTs – Multiple branches alias – degraded prediction  All branches reach unique BHT entry – Accuracy saturates  BHR width must capture the repetitive pattern in two level predictor – Otherwise performs worse than bimodal scheme

Future Work  Global Branch Prediction – Data dependent correlation – nested loops  Gshare and Gselect  Extending to two way superscalar – Pv2ssc

Thank You! Q & A

Backup Slides