gem5  v22.0.0.1
tage_sc_l_64KB.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  * 64KB TAGE-SC-L branch predictor (devised by Andre Seznec)
40  *
41  * Most of the code in this file has been adapted from cbp64KB/predictor.h in
42  * http://www.jilp.org/cbp2016/code/AndreSeznecLimited.tar.gz
43  */
44 
45 #ifndef __CPU_PRED_TAGE_SC_L_64KB_HH__
46 #define __CPU_PRED_TAGE_SC_L_64KB_HH__
47 
48 #include "cpu/pred/tage_sc_l.hh"
49 #include "params/TAGE_SC_L_64KB.hh"
50 #include "params/TAGE_SC_L_64KB_StatisticalCorrector.hh"
51 #include "params/TAGE_SC_L_TAGE_64KB.hh"
52 
53 namespace gem5
54 {
55 
56 namespace branch_prediction
57 {
58 
60 {
61  public:
62  TAGE_SC_L_TAGE_64KB(const TAGE_SC_L_TAGE_64KBParams &p) : TAGE_SC_L_TAGE(p)
63  {}
64 
65  int gindex_ext(int index, int bank) const override;
66 
67  uint16_t gtag(ThreadID tid, Addr pc, int bank) const override;
68 
70  bool alloc, bool taken, TAGEBase::BranchInfo* bi, int nrand) override;
71 
72  void handleTAGEUpdate(
73  Addr branch_pc, bool taken, TAGEBase::BranchInfo* bi) override;
74 };
75 
77 {
80 
81  // global branch history variation GEHL
82  const unsigned pnb;
83  const unsigned logPnb;
87 
88  // Second local history GEHL
89  const unsigned snb;
90  const unsigned logSnb;
94 
95  // Third local history GEHL
96  const unsigned tnb;
97  const unsigned logTnb;
101 
102  // Second IMLI GEHL
103  const unsigned imnb;
104  const unsigned logImnb;
108 
110  {
112  };
113 
115 
116  public:
118  const TAGE_SC_L_64KB_StatisticalCorrectorParams &p);
119 
120  unsigned getIndBiasBank(Addr branch_pc, BranchInfo* bi, int hitBank,
121  int altBank) const override;
122 
123  int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo* bi,
124  int & lsum, int64_t phist) override;
125 
126  int gIndexLogsSubstr(int nbr, int i) override;
127 
128  void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken,
129  BranchInfo * tage_bi, Addr corrTarget) override;
130 
131  void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo* bi,
132  int64_t phist) override;
133 };
134 
135 class TAGE_SC_L_64KB : public TAGE_SC_L
136 {
137  public:
138  TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams &params);
139 };
140 
141 } // namespace branch_prediction
142 } // namespace gem5
143 
144 #endif // __CPU_PRED_TAGE_SC_L_64KB_HH__
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::tm
std::vector< int > tm
Definition: tage_sc_l_64KB.hh:98
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::logTnb
const unsigned logTnb
Definition: tage_sc_l_64KB.hh:97
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::scHistoryUpdate
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget) override
Definition: tage_sc_l_64KB.cc:147
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB
Definition: tage_sc_l_64KB.hh:59
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::handleTAGEUpdate
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
Definition: tage_sc_l_64KB.cc:264
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector
Definition: tage_sc_l_64KB.hh:76
gem5::MipsISA::index
Bitfield< 30, 0 > index
Definition: pra_constants.hh:47
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::SC_64KB_ThreadHistory
Definition: tage_sc_l_64KB.hh:109
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::SC_64KB_ThreadHistory::imHist
std::vector< int64_t > imHist
Definition: tage_sc_l_64KB.hh:111
gem5::branch_prediction::TAGE_SC_L_64KB::TAGE_SC_L_64KB
TAGE_SC_L_64KB(const TAGE_SC_L_64KBParams &params)
Definition: tage_sc_l_64KB.cc:312
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::ArmISA::i
Bitfield< 7 > i
Definition: misc_types.hh:67
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::tgehl
std::vector< int8_t > * tgehl
Definition: tage_sc_l_64KB.hh:99
gem5::PowerISA::bi
Bitfield< 20, 16 > bi
Definition: types.hh:80
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::sgehl
std::vector< int8_t > * sgehl
Definition: tage_sc_l_64KB.hh:92
gem5::branch_prediction::TAGEBase::BranchInfo
Definition: tage_base.hh:128
gem5::RefCountingPtr< StaticInst >
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::wp
std::vector< int8_t > wp
Definition: tage_sc_l_64KB.hh:86
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::wt
std::vector< int8_t > wt
Definition: tage_sc_l_64KB.hh:100
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::imgehl
std::vector< int8_t > * imgehl
Definition: tage_sc_l_64KB.hh:106
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::logSnb
const unsigned logSnb
Definition: tage_sc_l_64KB.hh:90
gem5::VegaISA::p
Bitfield< 54 > p
Definition: pagetable.hh:70
gem5::SimObject::params
const Params & params() const
Definition: sim_object.hh:176
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::imm
std::vector< int > imm
Definition: tage_sc_l_64KB.hh:105
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::tnb
const unsigned tnb
Definition: tage_sc_l_64KB.hh:96
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::gtag
uint16_t gtag(ThreadID tid, Addr pc, int bank) const override
Computes the partial tag of a tagged table.
Definition: tage_sc_l_64KB.cc:206
gem5::branch_prediction::TAGE_SC_L_64KB
Definition: tage_sc_l_64KB.hh:135
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::getIndBiasBank
unsigned getIndBiasBank(Addr branch_pc, BranchInfo *bi, int hitBank, int altBank) const override
Definition: tage_sc_l_64KB.cc:90
tage_sc_l.hh
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::logPnb
const unsigned logPnb
Definition: tage_sc_l_64KB.hh:83
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::wim
std::vector< int8_t > wim
Definition: tage_sc_l_64KB.hh:107
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::pgehl
std::vector< int8_t > * pgehl
Definition: tage_sc_l_64KB.hh:85
gem5::branch_prediction::TAGE_SC_L_TAGE
Definition: tage_sc_l.hh:58
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::gindex_ext
int gindex_ext(int index, int bank) const override
Definition: tage_sc_l_64KB.cc:200
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::numEntriesThirdLocalHistories
const unsigned numEntriesThirdLocalHistories
Definition: tage_sc_l_64KB.hh:79
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::pnb
const unsigned pnb
Definition: tage_sc_l_64KB.hh:82
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_64KB_StatisticalCorrector::logImnb
const unsigned logImnb
Definition: tage_sc_l_64KB.hh:104
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::TAGE_SC_L_64KB_StatisticalCorrector
TAGE_SC_L_64KB_StatisticalCorrector(const TAGE_SC_L_64KB_StatisticalCorrectorParams &p)
Definition: tage_sc_l_64KB.cc:50
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::TAGE_SC_L_TAGE_64KB
TAGE_SC_L_TAGE_64KB(const TAGE_SC_L_TAGE_64KBParams &p)
Definition: tage_sc_l_64KB.hh:62
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::makeThreadHistory
SCThreadHistory * makeThreadHistory() override
Definition: tage_sc_l_64KB.cc:76
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::gIndexLogsSubstr
int gIndexLogsSubstr(int nbr, int i) override
Definition: tage_sc_l_64KB.cc:141
gem5::branch_prediction::TAGE_SC_L_TAGE_64KB::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_64KB.cc:216
gem5::MipsISA::pc
Bitfield< 4 > pc
Definition: pra_constants.hh:243
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::numEntriesSecondLocalHistories
const unsigned numEntriesSecondLocalHistories
Definition: tage_sc_l_64KB.hh:78
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::gUpdates
void gUpdates(ThreadID tid, Addr pc, bool taken, BranchInfo *bi, int64_t phist) override
Definition: tage_sc_l_64KB.cc:171
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::pm
std::vector< int > pm
Definition: tage_sc_l_64KB.hh:84
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::ws
std::vector< int8_t > ws
Definition: tage_sc_l_64KB.hh:93
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::imnb
const unsigned imnb
Definition: tage_sc_l_64KB.hh:103
gem5::branch_prediction::StatisticalCorrector::SCThreadHistory
Definition: statistical_corrector.hh:75
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::snb
const unsigned snb
Definition: tage_sc_l_64KB.hh:89
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::gPredictions
int gPredictions(ThreadID tid, Addr branch_pc, BranchInfo *bi, int &lsum, int64_t phist) override
Definition: tage_sc_l_64KB.cc:99
gem5::ThreadID
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:235
gem5::branch_prediction::TAGE_SC_L_64KB_StatisticalCorrector::sm
std::vector< int > sm
Definition: tage_sc_l_64KB.hh:91

Generated on Sat Jun 18 2022 08:12:21 for gem5 by doxygen 1.8.17