gem5  v21.1.0.2
tage_base.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 The University of Wisconsin
3  *
4  * Copyright (c) 2006 INRIA (Institut National de Recherche en
5  * Informatique et en Automatique / French National Research Institute
6  * for Computer Science and Applied Mathematics)
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are
12  * met: redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer;
14  * redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution;
17  * neither the name of the copyright holders nor the names of its
18  * contributors may be used to endorse or promote products derived from
19  * this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 /* @file
35  * Implementation of a TAGE branch predictor. TAGE is a global-history based
36  * branch predictor. It features a PC-indexed bimodal predictor and N
37  * partially tagged tables, indexed with a hash of the PC and the global
38  * branch history. The different lengths of global branch history used to
39  * index the partially tagged tables grow geometrically. A small path history
40  * is also used in the hash.
41  *
42  * All TAGE tables are accessed in parallel, and the one using the longest
43  * history that matches provides the prediction (some exceptions apply).
44  * Entries are allocated in components using a longer history than the
45  * one that predicted when the prediction is incorrect.
46  */
47 
48 #ifndef __CPU_PRED_TAGE_BASE_HH__
49 #define __CPU_PRED_TAGE_BASE_HH__
50 
51 #include <vector>
52 
53 #include "base/statistics.hh"
54 #include "cpu/null_static_inst.hh"
55 #include "cpu/static_inst.hh"
56 #include "params/TAGEBase.hh"
57 #include "sim/sim_object.hh"
58 
59 namespace gem5
60 {
61 
62 namespace branch_prediction
63 {
64 
65 class TAGEBase : public SimObject
66 {
67  public:
68  TAGEBase(const TAGEBaseParams &p);
69  void init() override;
70 
71  protected:
72  // Prediction Structures
73 
74  // Tage Entry
75  struct TageEntry
76  {
77  int8_t ctr;
78  uint16_t tag;
79  uint8_t u;
80  TageEntry() : ctr(0), tag(0), u(0) { }
81  };
82 
83  // Folded History Table - compressed history
84  // to mix with instruction PC to index partially
85  // tagged tables.
87  {
88  unsigned comp;
91  int outpoint;
93 
95  {
96  comp = 0;
97  }
98 
99  void init(int original_length, int compressed_length)
100  {
101  origLength = original_length;
102  compLength = compressed_length;
103  outpoint = original_length % compressed_length;
104  }
105 
106  void update(uint8_t * h)
107  {
108  comp = (comp << 1) | h[0];
109  comp ^= h[origLength] << outpoint;
110  comp ^= (comp >> compLength);
111  comp &= (1ULL << compLength) - 1;
112  }
113  };
114 
115  public:
116 
117  // provider type
118  enum
119  {
125  };
126 
127  // Primary branch history entry
128  struct BranchInfo
129  {
130  int pathHist;
131  int ptGhist;
132  int hitBank;
134  int altBank;
137 
138  bool tagePred;
139  bool altTaken;
144 
145  // Pointer to dynamically allocated storage
146  // to save table indices and folded histories.
147  // To do one call to new instead of five.
148  int *storage;
149 
150  // Pointers to actual saved array within the dynamically
151  // allocated storage.
153  int *tableTags;
154  int *ci;
155  int *ct0;
156  int *ct1;
157 
158  // for stats purposes
159  unsigned provider;
160 
161  BranchInfo(const TAGEBase &tage)
162  : pathHist(0), ptGhist(0),
163  hitBank(0), hitBankIndex(0),
164  altBank(0), altBankIndex(0),
165  bimodalIndex(0),
166  tagePred(false), altTaken(false),
167  condBranch(false), longestMatchPred(false),
168  pseudoNewAlloc(false), branchPC(0),
169  provider(-1)
170  {
171  int sz = tage.nHistoryTables + 1;
172  storage = new int [sz * 5];
174  tableTags = storage + sz;
175  ci = tableTags + sz;
176  ct0 = ci + sz;
177  ct1 = ct0 + sz;
178  }
179 
180  virtual ~BranchInfo()
181  {
182  delete[] storage;
183  }
184  };
185 
186  virtual BranchInfo *makeBranchInfo();
187 
193  virtual int bindex(Addr pc_in) const;
194 
203  virtual int gindex(ThreadID tid, Addr pc, int bank) const;
204 
212  virtual int F(int phist, int size, int bank) const;
213 
221  virtual uint16_t gtag(ThreadID tid, Addr pc, int bank) const;
222 
230  template<typename T>
231  static void ctrUpdate(T & ctr, bool taken, int nbits);
232 
240  static void unsignedCtrUpdate(uint8_t & ctr, bool up, unsigned nbits);
241 
249  virtual bool getBimodePred(Addr pc, BranchInfo* bi) const;
250 
258  void baseUpdate(Addr pc, bool taken, BranchInfo* bi);
259 
268  void updateGHist(uint8_t * &h, bool dir, uint8_t * tab, int &PT);
269 
280  void update(ThreadID tid, Addr branch_pc, bool taken, BranchInfo* bi);
281 
294  virtual void updateHistories(
295  ThreadID tid, Addr branch_pc, bool taken, BranchInfo* b,
296  bool speculative,
297  const StaticInstPtr & inst = nullStaticInstPtr,
298  Addr target = MaxAddr);
299 
313  virtual void squash(
314  ThreadID tid, bool taken, BranchInfo *bi, Addr target);
315 
328  virtual void condBranchUpdate(
329  ThreadID tid, Addr branch_pc, bool taken, BranchInfo* bi,
330  int nrand, Addr corrTarget, bool pred, bool preAdjustAlloc = false);
331 
340  bool tagePredict(
341  ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo* bi);
342 
349  virtual void updateStats(bool taken, BranchInfo* bi);
350 
354  virtual void buildTageTables();
355 
360  virtual void calculateParameters();
361 
366  virtual void calculateIndicesAndTags(
367  ThreadID tid, Addr branch_pc, BranchInfo* bi);
368 
373  virtual unsigned getUseAltIdx(BranchInfo* bi, Addr branch_pc);
374 
380  virtual void adjustAlloc(bool & alloc, bool taken, bool pred_taken);
381 
385  virtual void handleAllocAndUReset(
386  bool alloc, bool taken, BranchInfo* bi, int nrand);
387 
391  virtual void handleUReset();
392 
396  virtual void handleTAGEUpdate(
397  Addr branch_pc, bool taken, BranchInfo* bi);
398 
402  virtual void resetUctr(uint8_t & u);
403 
408  virtual void extraAltCalc(BranchInfo* bi);
409 
410  virtual bool isHighConfidence(BranchInfo* bi) const
411  {
412  return false;
413  }
414 
415  void btbUpdate(ThreadID tid, Addr branch_addr, BranchInfo* &bi);
416  unsigned getGHR(ThreadID tid, BranchInfo *bi) const;
417  int8_t getCtr(int hitBank, int hitBankIndex) const;
418  unsigned getTageCtrBits() const;
419  int getPathHist(ThreadID tid) const;
420  bool isSpeculativeUpdateEnabled() const;
421  size_t getSizeInBits() const;
422 
423  protected:
425  const unsigned nHistoryTables;
426  const unsigned tagTableCounterBits;
427  const unsigned tagTableUBits;
428  const unsigned histBufferSize;
429  const unsigned minHist;
430  const unsigned maxHist;
431  const unsigned pathHistBits;
432 
435 
439 
440  // Keep per-thread histories to
441  // support SMT.
443  {
444  // Speculative path history
445  // (LSB of branch address)
446  int pathHist;
447 
448  // Speculative branch direction
449  // history (circular buffer)
450  // @TODO Convert to std::vector<bool>
451  uint8_t *globalHistory;
452 
453  // Pointer to most recent branch outcome
454  uint8_t* gHist;
455 
456  // Index to most recent branch outcome
457  int ptGhist;
458 
459  // Speculative folded histories.
462  };
463 
465 
469  virtual void initFoldedHistories(ThreadHistory & history);
470 
473  int *tableTags;
474 
476  int64_t tCounter;
477  uint64_t logUResetPeriod;
478  const int64_t initialTCounterValue;
479  unsigned numUseAltOnNa;
480  unsigned useAltOnNaBits;
481  unsigned maxNumAlloc;
482 
483  // Tells which tables are active
484  // (for the base TAGE implementation all are active)
485  // Some other classes use this for handling associativity
487 
489 
490  const unsigned instShiftAmt;
491 
493 
495  {
497  // stats
508 
511  } stats;
512 };
513 
514 } // namespace branch_prediction
515 } // namespace gem5
516 
517 #endif // __CPU_PRED_TAGE_BASE_HH__
gem5::statistics::Scalar
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:1927
gem5::branch_prediction::TAGEBase::getSizeInBits
size_t getSizeInBits() const
Definition: tage_base.cc:792
gem5::branch_prediction::TAGEBase::BranchInfo::provider
unsigned provider
Definition: tage_base.hh:159
gem5::branch_prediction::TAGEBase::BranchInfo::hitBankIndex
int hitBankIndex
Definition: tage_base.hh:133
gem5::branch_prediction::TAGEBase::speculativeHistUpdate
const bool speculativeHistUpdate
Definition: tage_base.hh:488
gem5::branch_prediction::TAGEBase::squash
virtual void squash(ThreadID tid, bool taken, BranchInfo *bi, Addr target)
Restores speculatively updated path and direction histories.
Definition: tage_base.cc:629
gem5::branch_prediction::TAGEBase::buildTageTables
virtual void buildTageTables()
Instantiates the TAGE table entries.
Definition: tage_base.cc:166
gem5::branch_prediction::TAGEBase::initialTCounterValue
const int64_t initialTCounterValue
Definition: tage_base.hh:478
gem5::branch_prediction::TAGEBase::tagTableUBits
const unsigned tagTableUBits
Definition: tage_base.hh:427
gem5::branch_prediction::TAGEBase::threadHistory
std::vector< ThreadHistory > threadHistory
Definition: tage_base.hh:464
gem5::branch_prediction::TAGEBase::TAGEBaseStats::TAGEBaseStats
TAGEBaseStats(statistics::Group *parent, unsigned nHistoryTables)
Definition: tage_base.cc:725
gem5::branch_prediction::TAGEBase::BranchInfo::ptGhist
int ptGhist
Definition: tage_base.hh:131
gem5::branch_prediction::TAGEBase::ThreadHistory::globalHistory
uint8_t * globalHistory
Definition: tage_base.hh:451
gem5::branch_prediction::TAGEBase::ThreadHistory::computeIndices
FoldedHistory * computeIndices
Definition: tage_base.hh:460
gem5::branch_prediction::TAGEBase::isSpeculativeUpdateEnabled
bool isSpeculativeUpdateEnabled() const
Definition: tage_base.cc:786
gem5::branch_prediction::TAGEBase::makeBranchInfo
virtual BranchInfo * makeBranchInfo()
Definition: tage_base.cc:82
gem5::branch_prediction::TAGEBase::handleAllocAndUReset
virtual void handleAllocAndUReset(bool alloc, bool taken, BranchInfo *bi, int nrand)
Handles Allocation and U bits reset on an update.
Definition: tage_base.cc:444
gem5::branch_prediction::TAGEBase::BranchInfo::tagePred
bool tagePred
Definition: tage_base.hh:138
gem5::branch_prediction::TAGEBase::getTageCtrBits
unsigned getTageCtrBits() const
Definition: tage_base.cc:774
gem5::branch_prediction::TAGEBase::getBimodePred
virtual bool getBimodePred(Addr pc, BranchInfo *bi) const
Get a branch prediction from the bimodal predictor.
Definition: tage_base.cc:293
gem5::branch_prediction::TAGEBase::FoldedHistory::init
void init(int original_length, int compressed_length)
Definition: tage_base.hh:99
gem5::branch_prediction::TAGEBase::TAGE_LONGEST_MATCH
@ TAGE_LONGEST_MATCH
Definition: tage_base.hh:121
gem5::branch_prediction::TAGEBase::calculateIndicesAndTags
virtual void calculateIndicesAndTags(ThreadID tid, Addr branch_pc, BranchInfo *bi)
On a prediction, calculates the TAGE indices and tags for all the different history lengths.
Definition: tage_base.cc:340
gem5::branch_prediction::TAGEBase::BranchInfo::pathHist
int pathHist
Definition: tage_base.hh:130
gem5::ArmISA::up
Bitfield< 23 > up
Definition: types.hh:124
gem5::branch_prediction::TAGEBase::ThreadHistory::pathHist
int pathHist
Definition: tage_base.hh:446
gem5::branch_prediction::TAGEBase::BranchInfo::hitBank
int hitBank
Definition: tage_base.hh:132
gem5::branch_prediction::TAGEBase::maxNumAlloc
unsigned maxNumAlloc
Definition: tage_base.hh:481
gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalProviderWrong
statistics::Scalar bimodalProviderWrong
Definition: tage_base.hh:505
gem5::branch_prediction::TAGEBase::BranchInfo::altTaken
bool altTaken
Definition: tage_base.hh:139
gem5::branch_prediction::TAGEBase::BranchInfo::tableTags
int * tableTags
Definition: tage_base.hh:153
gem5::branch_prediction::TAGEBase::updateStats
virtual void updateStats(bool taken, BranchInfo *bi)
Update the stats.
Definition: tage_base.cc:662
gem5::branch_prediction::TAGEBase::useAltOnNaBits
unsigned useAltOnNaBits
Definition: tage_base.hh:480
gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderWrong
statistics::Scalar altMatchProviderWrong
Definition: tage_base.hh:503
gem5::branch_prediction::TAGEBase::BranchInfo::altBank
int altBank
Definition: tage_base.hh:134
gem5::branch_prediction::TAGEBase::isHighConfidence
virtual bool isHighConfidence(BranchInfo *bi) const
Definition: tage_base.hh:410
gem5::branch_prediction::TAGEBase::FoldedHistory::comp
unsigned comp
Definition: tage_base.hh:88
gem5::branch_prediction::TAGEBase::FoldedHistory
Definition: tage_base.hh:86
gem5::branch_prediction::TAGEBase::F
virtual int F(int phist, int size, int bank) const
Utility function to shuffle the path history depending on which tagged table we are accessing.
Definition: tage_base.cc:213
gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderWrong
statistics::Scalar longestMatchProviderWrong
Definition: tage_base.hh:502
gem5::branch_prediction::TAGEBase::FoldedHistory::outpoint
int outpoint
Definition: tage_base.hh:91
gem5::statistics::Vector
A vector of scalar stats.
Definition: statistics.hh:2003
std::vector< unsigned >
gem5::branch_prediction::TAGEBase::ctrUpdate
static void ctrUpdate(T &ctr, bool taken, int nbits)
Updates a direction counter based on the actual branch outcome.
Definition: tage_base.cc:261
gem5::branch_prediction::TAGEBase::TAGE_ALT_MATCH
@ TAGE_ALT_MATCH
Definition: tage_base.hh:123
gem5::branch_prediction::TAGEBase::noSkip
std::vector< bool > noSkip
Definition: tage_base.hh:486
gem5::PowerISA::bi
Bitfield< 20, 16 > bi
Definition: types.hh:80
gem5::branch_prediction::TAGEBase::gtag
virtual uint16_t gtag(ThreadID tid, Addr pc, int bank) const
Computes the partial tag of a tagged table.
Definition: tage_base.cc:248
gem5::branch_prediction::TAGEBase::unsignedCtrUpdate
static void unsignedCtrUpdate(uint8_t &ctr, bool up, unsigned nbits)
Updates an unsigned counter based on up/down parameter.
Definition: tage_base.cc:279
gem5::branch_prediction::TAGEBase::TageEntry
Definition: tage_base.hh:75
gem5::branch_prediction::TAGEBase::logRatioBiModalHystEntries
const unsigned logRatioBiModalHystEntries
Definition: tage_base.hh:424
gem5::branch_prediction::TAGEBase::tagTableCounterBits
const unsigned tagTableCounterBits
Definition: tage_base.hh:426
gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalAltMatchProviderCorrect
statistics::Scalar bimodalAltMatchProviderCorrect
Definition: tage_base.hh:500
gem5::branch_prediction::TAGEBase::TAGEBaseStats
Definition: tage_base.hh:494
gem5::branch_prediction::TAGEBase::BranchInfo
Definition: tage_base.hh:128
gem5::branch_prediction::TAGEBase::gtable
TageEntry ** gtable
Definition: tage_base.hh:438
gem5::RefCountingPtr< StaticInst >
gem5::branch_prediction::TAGEBase::logUResetPeriod
uint64_t logUResetPeriod
Definition: tage_base.hh:477
gem5::branch_prediction::TAGEBase::BranchInfo::~BranchInfo
virtual ~BranchInfo()
Definition: tage_base.hh:180
gem5::branch_prediction::TAGEBase::FoldedHistory::origLength
int origLength
Definition: tage_base.hh:90
gem5::branch_prediction::TAGEBase::BranchInfo::tableIndices
int * tableIndices
Definition: tage_base.hh:152
gem5::branch_prediction::TAGEBase::baseUpdate
void baseUpdate(Addr pc, bool taken, BranchInfo *bi)
Updates the bimodal predictor.
Definition: tage_base.cc:302
gem5::branch_prediction::TAGEBase
Definition: tage_base.hh:65
gem5::branch_prediction::TAGEBase::getCtr
int8_t getCtr(int hitBank, int hitBankIndex) const
Definition: tage_base.cc:768
gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderWouldHaveHit
statistics::Scalar longestMatchProviderWouldHaveHit
Definition: tage_base.hh:507
gem5::branch_prediction::TAGEBase::tagTableTagWidths
std::vector< unsigned > tagTableTagWidths
Definition: tage_base.hh:433
gem5::nullStaticInstPtr
const StaticInstPtr nullStaticInstPtr
Statically allocated null StaticInstPtr.
Definition: null_static_inst.cc:36
gem5::branch_prediction::TAGEBase::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: tage_base.cc:87
gem5::branch_prediction::TAGEBase::btablePrediction
std::vector< bool > btablePrediction
Definition: tage_base.hh:436
gem5::branch_prediction::TAGEBase::stats
gem5::branch_prediction::TAGEBase::TAGEBaseStats stats
gem5::branch_prediction::TAGEBase::getUseAltIdx
virtual unsigned getUseAltIdx(BranchInfo *bi, Addr branch_pc)
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is alway...
Definition: tage_base.cc:353
gem5::ArmISA::b
Bitfield< 7 > b
Definition: misc_types.hh:381
gem5::branch_prediction::TAGEBase::initFoldedHistories
virtual void initFoldedHistories(ThreadHistory &history)
Initialization of the folded histories.
Definition: tage_base.cc:151
sim_object.hh
gem5::MaxAddr
const Addr MaxAddr
Definition: types.hh:171
gem5::branch_prediction::TAGEBase::ThreadHistory::gHist
uint8_t * gHist
Definition: tage_base.hh:454
gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProvider
statistics::Vector longestMatchProvider
Definition: tage_base.hh:509
gem5::branch_prediction::TAGEBase::pathHistBits
const unsigned pathHistBits
Definition: tage_base.hh:431
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
statistics.hh
gem5::branch_prediction::TAGEBase::nHistoryTables
const unsigned nHistoryTables
Definition: tage_base.hh:425
gem5::branch_prediction::TAGEBase::BranchInfo::longestMatchPred
bool longestMatchPred
Definition: tage_base.hh:141
gem5::branch_prediction::TAGEBase::BranchInfo::altBankIndex
int altBankIndex
Definition: tage_base.hh:135
gem5::branch_prediction::TAGEBase::BranchInfo::bimodalIndex
int bimodalIndex
Definition: tage_base.hh:136
gem5::branch_prediction::TAGEBase::TAGEBaseStats::longestMatchProviderCorrect
statistics::Scalar longestMatchProviderCorrect
Definition: tage_base.hh:498
gem5::branch_prediction::TAGEBase::extraAltCalc
virtual void extraAltCalc(BranchInfo *bi)
Extra steps for calculating altTaken For this base TAGE class it does nothing.
Definition: tage_base.cc:655
gem5::branch_prediction::TAGEBase::ThreadHistory::computeTags
FoldedHistory * computeTags[2]
Definition: tage_base.hh:461
gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalAltMatchProviderWrong
statistics::Scalar bimodalAltMatchProviderWrong
Definition: tage_base.hh:504
gem5::branch_prediction::TAGEBase::getPathHist
int getPathHist(ThreadID tid) const
Definition: tage_base.cc:780
gem5::branch_prediction::TAGEBase::FoldedHistory::update
void update(uint8_t *h)
Definition: tage_base.hh:106
gem5::branch_prediction::TAGEBase::btableHysteresis
std::vector< bool > btableHysteresis
Definition: tage_base.hh:437
gem5::branch_prediction::TAGEBase::TageEntry::u
uint8_t u
Definition: tage_base.hh:79
gem5::branch_prediction::TAGEBase::updateHistories
virtual void updateHistories(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *b, bool speculative, const StaticInstPtr &inst=nullStaticInstPtr, Addr target=MaxAddr)
(Speculatively) updates global histories (path and direction).
Definition: tage_base.cc:588
static_inst.hh
gem5::branch_prediction::TAGEBase::BranchInfo::ci
int * ci
Definition: tage_base.hh:154
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::branch_prediction::TAGEBase::gindex
virtual int gindex(ThreadID tid, Addr pc, int bank) const
Computes the index used to access a partially tagged table.
Definition: tage_base.cc:230
gem5::branch_prediction::TAGEBase::condBranchUpdate
virtual void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi, int nrand, Addr corrTarget, bool pred, bool preAdjustAlloc=false)
Update TAGE for conditional branches.
Definition: tage_base.cc:514
gem5::branch_prediction::TAGEBase::ThreadHistory
Definition: tage_base.hh:442
gem5::branch_prediction::TAGEBase::BranchInfo::storage
int * storage
Definition: tage_base.hh:148
gem5::branch_prediction::TAGEBase::calculateParameters
virtual void calculateParameters()
Calculates the history lengths and some other paramters in derived classes.
Definition: tage_base.cc:174
null_static_inst.hh
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::branch_prediction::TAGEBase::tCounter
int64_t tCounter
Definition: tage_base.hh:476
gem5::branch_prediction::TAGEBase::FoldedHistory::FoldedHistory
FoldedHistory()
Definition: tage_base.hh:94
gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderWouldHaveHit
statistics::Scalar altMatchProviderWouldHaveHit
Definition: tage_base.hh:506
gem5::branch_prediction::TAGEBase::BranchInfo::BranchInfo
BranchInfo(const TAGEBase &tage)
Definition: tage_base.hh:161
gem5::branch_prediction::TAGEBase::bindex
virtual int bindex(Addr pc_in) const
Computes the index used to access the bimodal table.
Definition: tage_base.cc:207
gem5::branch_prediction::TAGEBase::handleUReset
virtual void handleUReset()
Handles the U bits reset.
Definition: tage_base.cc:493
gem5::branch_prediction::TAGEBase::BranchInfo::ct1
int * ct1
Definition: tage_base.hh:156
gem5::ArmISA::u
Bitfield< 22 > u
Definition: misc_types.hh:352
gem5::branch_prediction::TAGEBase::tableTags
int * tableTags
Definition: tage_base.hh:473
gem5::branch_prediction::TAGEBase::logTagTableSizes
std::vector< int > logTagTableSizes
Definition: tage_base.hh:434
gem5::branch_prediction::TAGEBase::BranchInfo::condBranch
bool condBranch
Definition: tage_base.hh:140
gem5::branch_prediction::TAGEBase::tableIndices
int * tableIndices
Definition: tage_base.hh:472
gem5::branch_prediction::TAGEBase::maxHist
const unsigned maxHist
Definition: tage_base.hh:430
gem5::branch_prediction::TAGEBase::TAGEBaseStats::bimodalProviderCorrect
statistics::Scalar bimodalProviderCorrect
Definition: tage_base.hh:501
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::branch_prediction::TAGEBase::BIMODAL_ALT_MATCH
@ BIMODAL_ALT_MATCH
Definition: tage_base.hh:122
gem5::branch_prediction::TAGEBase::btbUpdate
void btbUpdate(ThreadID tid, Addr branch_addr, BranchInfo *&bi)
Definition: tage_base.cc:188
gem5::branch_prediction::TAGEBase::FoldedHistory::bufferSize
int bufferSize
Definition: tage_base.hh:92
gem5::statistics::Group
Statistics container.
Definition: group.hh:93
gem5::branch_prediction::TAGEBase::BranchInfo::ct0
int * ct0
Definition: tage_base.hh:155
gem5::branch_prediction::TAGEBase::update
void update(ThreadID tid, Addr branch_pc, bool taken, BranchInfo *bi)
Update TAGE.
gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProvider
statistics::Vector altMatchProvider
Definition: tage_base.hh:510
gem5::branch_prediction::TAGEBase::useAltPredForNewlyAllocated
std::vector< int8_t > useAltPredForNewlyAllocated
Definition: tage_base.hh:475
gem5::branch_prediction::TAGEBase::numUseAltOnNa
unsigned numUseAltOnNa
Definition: tage_base.hh:479
gem5::branch_prediction::TAGEBase::LAST_TAGE_PROVIDER_TYPE
@ LAST_TAGE_PROVIDER_TYPE
Definition: tage_base.hh:124
gem5::branch_prediction::TAGEBase::instShiftAmt
const unsigned instShiftAmt
Definition: tage_base.hh:490
gem5::branch_prediction::TAGEBase::minHist
const unsigned minHist
Definition: tage_base.hh:429
gem5::branch_prediction::TAGEBase::BranchInfo::branchPC
Addr branchPC
Definition: tage_base.hh:143
gem5::branch_prediction::TAGEBase::getGHR
unsigned getGHR(ThreadID tid, BranchInfo *bi) const
Definition: tage_base.cc:711
gem5::branch_prediction::TAGEBase::TAGEBase
TAGEBase(const TAGEBaseParams &p)
Definition: tage_base.cc:51
gem5::branch_prediction::TAGEBase::adjustAlloc
virtual void adjustAlloc(bool &alloc, bool taken, bool pred_taken)
Extra calculation to tell whether TAGE allocaitons may happen or not on an update For this base TAGE ...
Definition: tage_base.cc:438
gem5::branch_prediction::TAGEBase::histLengths
int * histLengths
Definition: tage_base.hh:471
gem5::branch_prediction::TAGEBase::updateGHist
void updateGHist(uint8_t *&h, bool dir, uint8_t *tab, int &PT)
(Speculatively) updates the global branch history.
Definition: tage_base.cc:322
gem5::branch_prediction::TAGEBase::FoldedHistory::compLength
int compLength
Definition: tage_base.hh:89
gem5::branch_prediction::TAGEBase::initialized
bool initialized
Definition: tage_base.hh:492
gem5::branch_prediction::TAGEBase::TageEntry::TageEntry
TageEntry()
Definition: tage_base.hh:80
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::branch_prediction::TAGEBase::histBufferSize
const unsigned histBufferSize
Definition: tage_base.hh:428
gem5::branch_prediction::TAGEBase::ThreadHistory::ptGhist
int ptGhist
Definition: tage_base.hh:457
gem5::branch_prediction::TAGEBase::TageEntry::tag
uint16_t tag
Definition: tage_base.hh:78
gem5::branch_prediction::TAGEBase::TageEntry::ctr
int8_t ctr
Definition: tage_base.hh:77
gem5::branch_prediction::TAGEBase::BIMODAL_ONLY
@ BIMODAL_ONLY
Definition: tage_base.hh:120
gem5::branch_prediction::TAGEBase::TAGEBaseStats::altMatchProviderCorrect
statistics::Scalar altMatchProviderCorrect
Definition: tage_base.hh:499
gem5::branch_prediction::TAGEBase::resetUctr
virtual void resetUctr(uint8_t &u)
Algorithm for resetting a single U counter.
Definition: tage_base.cc:508
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:242
gem5::branch_prediction::TAGEBase::BranchInfo::pseudoNewAlloc
bool pseudoNewAlloc
Definition: tage_base.hh:142
gem5::branch_prediction::TAGEBase::tagePredict
bool tagePredict(ThreadID tid, Addr branch_pc, bool cond_branch, BranchInfo *bi)
TAGE prediction called from TAGE::predict.
Definition: tage_base.cc:360
gem5::branch_prediction::TAGEBase::handleTAGEUpdate
virtual void handleTAGEUpdate(Addr branch_pc, bool taken, BranchInfo *bi)
Handles the update of the TAGE entries.
Definition: tage_base.cc:555

Generated on Tue Sep 21 2021 12:25:05 for gem5 by doxygen 1.8.17