gem5  v21.2.0.0
tage_sc_l_8KB.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Metempsy Technology Consulting
3  * All rights reserved.
4  *
5  * Copyright (c) 2006 INRIA (Institut National de Recherche en
6  * Informatique et en Automatique / French National Research Institute
7  * for Computer Science and Applied Mathematics)
8  *
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are
13  * met: redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer;
15  * redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in the
17  * documentation and/or other materials provided with the distribution;
18  * neither the name of the copyright holders nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  * Author: AndrĂ© Seznec, Pau Cabre, Javier Bueno
35  *
36  */
37 
38 /*
39  * 8KB TAGE-SC-L branch predictor (devised by Andre Seznec)
40  */
41 
42 #ifndef __CPU_PRED_TAGE_SC_L_8KB_HH__
43 #define __CPU_PRED_TAGE_SC_L_8KB_HH__
44 
45 #include "cpu/pred/tage_sc_l.hh"
46 #include "params/TAGE_SC_L_8KB.hh"
47 #include "params/TAGE_SC_L_8KB_StatisticalCorrector.hh"
48 #include "params/TAGE_SC_L_TAGE_8KB.hh"
49 
50 namespace gem5
51 {
52 
53 namespace branch_prediction
54 {
55 
57 {
58  public:
59  TAGE_SC_L_TAGE_8KB(const TAGE_SC_L_TAGE_8KBParams &p) : TAGE_SC_L_TAGE(p)
60  {}
61 
62  void initFoldedHistories(ThreadHistory & history) override;
63  int gindex_ext(int index, int bank) const override;
64 
65  uint16_t gtag(ThreadID tid, Addr pc, int bank) const override;
66 
68  bool alloc, bool taken, TAGEBase::BranchInfo* bi, int nrand) override;
69 
70  void handleTAGEUpdate(
71  Addr branch_pc, bool taken, TAGEBase::BranchInfo* bi) override;
72 
73  void resetUctr(uint8_t & u) override;
74 };
75 
77 {
78  // global branch history GEHL
79  const unsigned gnb;
80  const unsigned logGnb;
84 
86  {
88  globalHist = 0;
89  }
90  int64_t globalHist; // global history
91  };
92 
94 
95  public:
97  const TAGE_SC_L_8KB_StatisticalCorrectorParams &p);
98 
99  unsigned getIndBiasBank( Addr branch_pc, BranchInfo* bi, int hitBank,
100  int altBank) const override;
101 
102  int gPredictions( ThreadID tid, Addr branch_pc,
103  BranchInfo* bi, int & lsum, int64_t phist) override;
104 
105  int gIndexLogsSubstr(int nbr, int i) override;
106 
107  void scHistoryUpdate(
108  Addr branch_pc, const StaticInstPtr &inst, bool taken,
109  BranchInfo * tage_bi, Addr corrTarget) override;
110 
111  void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo* bi,
112  int64_t phist) override;
113 };
114 
115 class TAGE_SC_L_8KB : public TAGE_SC_L
116 {
117  public:
118  TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams &params);
119 };
120 
121 } // namespace branch_prediction
122 } // namespace gem5
123 
124 #endif // __CPU_PRED_TAGE_SC_L_8KB_HH__
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB
Definition: tage_sc_l_8KB.hh:56
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::scHistoryUpdate
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
Definition: tage_sc_l_8KB.cc:110
gem5::branch_prediction::TAGE_SC_L_8KB
Definition: tage_sc_l_8KB.hh:115
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::gIndexLogsSubstr
int gIndexLogsSubstr(int nbr, int i) override
Definition: tage_sc_l_8KB.cc:104
gem5::MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:47
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::getIndBiasBank
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
Definition: tage_sc_l_8KB.cc:73
gem5::branch_prediction::StatisticalCorrector
Definition: statistical_corrector.hh:58
std::vector< int >
gem5::branch_prediction::TAGE_SC_L
Definition: tage_sc_l.hh:156
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::initFoldedHistories
void initFoldedHistories(ThreadHistory &history) override
Initialization of the folded histories.
Definition: tage_sc_l_8KB.cc:147
gem5::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::PowerISA::bi
Bitfield< 20, 16 > bi
Definition: types.hh:80
gem5::branch_prediction::TAGEBase::BranchInfo
Definition: tage_base.hh:128
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::SC_8KB_ThreadHistory::globalHist
int64_t globalHist
Definition: tage_sc_l_8KB.hh:90
gem5::RefCountingPtr< StaticInst >
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::SC_8KB_ThreadHistory::SC_8KB_ThreadHistory
SC_8KB_ThreadHistory()
Definition: tage_sc_l_8KB.hh:87
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::resetUctr
void resetUctr(uint8_t &u) override
Algorithm for resetting a single U counter.
Definition: tage_sc_l_8KB.cc:249
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::logGnb
const unsigned logGnb
Definition: tage_sc_l_8KB.hh:80
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::wg
std::vector< int8_t > wg
Definition: tage_sc_l_8KB.hh:83
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::TAGE_SC_L_8KB_StatisticalCorrector
TAGE_SC_L_8KB_StatisticalCorrector(const TAGE_SC_L_8KB_StatisticalCorrectorParams &p)
Definition: tage_sc_l_8KB.cc:53
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleAllocAndUReset
void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override
Handles Allocation and U bits reset on an update.
Definition: tage_sc_l_8KB.cc:189
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::ggehl
std::vector< int8_t > * ggehl
Definition: tage_sc_l_8KB.hh:82
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
gem5::branch_prediction::TAGE_SC_L_8KB::TAGE_SC_L_8KB
TAGE_SC_L_8KB(const TAGE_SC_L_8KBParams &params)
Definition: tage_sc_l_8KB.cc:141
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::SC_8KB_ThreadHistory
Definition: tage_sc_l_8KB.hh:85
tage_sc_l.hh
gem5::branch_prediction::TAGE_SC_L_TAGE
Definition: tage_sc_l.hh:58
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::StatisticalCorrector::BranchInfo
Definition: statistical_corrector.hh:200
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector
Definition: tage_sc_l_8KB.hh:76
gem5::ArmISA::u
Bitfield< 22 > u
Definition: misc_types.hh:353
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gindex_ext
int gindex_ext(int index, int bank) const override
Definition: tage_sc_l_8KB.cc:164
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::gPredictions
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist) override
Definition: tage_sc_l_8KB.cc:81
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::gm
std::vector< int > gm
Definition: tage_sc_l_8KB.hh:81
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::TAGE_SC_L_TAGE_8KB
TAGE_SC_L_TAGE_8KB(const TAGE_SC_L_TAGE_8KBParams &p)
Definition: tage_sc_l_8KB.hh:59
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::branch_prediction::StatisticalCorrector::SCThreadHistory
Definition: statistical_corrector.hh:75
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::handleTAGEUpdate
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
Definition: tage_sc_l_8KB.cc:258
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::gnb
const unsigned gnb
Definition: tage_sc_l_8KB.hh:79
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: tlb.cc:60
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::gUpdates
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
Definition: tage_sc_l_8KB.cc:130
gem5::branch_prediction::TAGE_SC_L_TAGE_8KB::gtag
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
Definition: tage_sc_l_8KB.cc:171
gem5::branch_prediction::TAGE_SC_L_8KB_StatisticalCorrector::makeThreadHistory
SCThreadHistory * makeThreadHistory() override
Definition: tage_sc_l_8KB.cc:64
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:242

Generated on Tue Dec 21 2021 11:34:27 for gem5 by doxygen 1.8.17