39 #ifndef __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_HH__
40 #define __CPU_PRED_MULTIPERSPECTIVE_PERCEPTRON_TAGE_HH__
46 #include "params/MPP_LoopPredictor.hh"
47 #include "params/MPP_StatisticalCorrector.hh"
48 #include "params/MPP_TAGE.hh"
49 #include "params/MultiperspectivePerceptronTAGE.hh"
54 namespace branch_prediction
84 void adjustAlloc(
bool & alloc,
bool taken,
bool pred_taken)
override;
90 bool taken,
Addr branch_pc,
Addr target);
137 unsigned int truncated_target = target;
140 (truncated_target >> 5) ^ taken);
164 bool bias)
const override;
169 int altBank)
const override;
175 bool bias_bit,
bool use_conf_ctr, int8_t conf_ctr,
176 unsigned conf_bits,
int hitBank,
int altBank, int64_t phist,
177 int init_lsum)
override;
181 Addr corrTarget,
bool b,
int hitBank,
int altBank,
182 int64_t phist)
override;
226 const HistorySpec &spec,
int index)
const;
233 const MultiperspectivePerceptronTAGEParams &
p);
235 void init()
override;
240 void *bp_history,
bool squashed,
242 Addr corrTarget)
override;
bool optionalAgeInc() const override
MPP_LoopPredictor(const MPP_LoopPredictorParams &p)
bool calcConf(int index) const override
unsigned getIndUpd(Addr branch_pc) const override
void gUpdate(Addr branch_pc, bool taken, int64_t hist, std::vector< int > &length, std::vector< int8_t > *tab, int nbr, int logs, std::vector< int8_t > &w, StatisticalCorrector::BranchInfo *bi) override
unsigned getIndBiasSK(Addr branch_pc, StatisticalCorrector::BranchInfo *bi) const override
unsigned getIndBias(Addr branch_pc, StatisticalCorrector::BranchInfo *bi, bool bias) const override
bool scPredict(ThreadID tid, Addr branch_pc, bool cond_branch, StatisticalCorrector::BranchInfo *bi, bool prev_pred_taken, bool bias_bit, bool use_conf_ctr, int8_t conf_ctr, unsigned conf_bits, int hitBank, int altBank, int64_t phist, int init_lsum) override
void condBranchUpdate(ThreadID tid, Addr branch_pc, bool taken, StatisticalCorrector::BranchInfo *bi, Addr corrTarget, bool b, int hitBank, int altBank, int64_t phist) override
std::vector< int8_t > * pgehl
unsigned getIndBiasBank(Addr branch_pc, StatisticalCorrector::BranchInfo *bi, int hitBank, int altBank) const override
int gIndexLogsSubstr(int nbr, int i) override
virtual void getBiasLSUM(Addr branch_pc, StatisticalCorrector::BranchInfo *bi, int &lsum) const =0
MPP_StatisticalCorrector(const MPP_StatisticalCorrectorParams &p)
std::vector< int8_t > * ggehl
void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override
Handles Allocation and U bits reset on an update.
void resetUctr(uint8_t &u) override
Algorithm for resetting a single U counter.
int bindex(Addr pc_in) const override
Computes the index used to access the bimodal table.
MPP_TAGE(const MPP_TAGEParams &p)
std::vector< unsigned int > tunedHistoryLengths
void calculateParameters() override
Calculates the history lengths and some other paramters in derived classes.
void updatePathAndGlobalHistory(ThreadHistory &tHist, int brtype, bool taken, Addr branch_pc, Addr target)
void updateHistories(ThreadID tid, Addr branch_pc, bool taken, TAGEBase::BranchInfo *b, bool speculative, const StaticInstPtr &inst, Addr target) override
(Speculatively) updates global histories (path and direction).
void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override
Handles the update of the TAGE entries.
bool isHighConfidence(TAGEBase::BranchInfo *bi) const override
void adjustAlloc(bool &alloc, bool taken, bool pred_taken) override
Extra calculation to tell whether TAGE allocaitons may happen or not on an update For this base TAGE ...
unsigned getUseAltIdx(TAGEBase::BranchInfo *bi, Addr branch_pc) override
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is alway...
void handleUReset() override
Handles the U bits reset.
bool lookup(ThreadID tid, Addr instPC, void *&bp_history) override
Looks up a given PC in the BP to see if it is taken or not taken.
void update(ThreadID tid, Addr instPC, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget) override
Updates the BP with taken/not taken information.
int computePartialSum(ThreadID tid, MPPTAGEBranchInfo &bi) const
LoopPredictor * loopPredictor
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
MultiperspectivePerceptronTAGE(const MultiperspectivePerceptronTAGEParams &p)
StatisticalCorrector * statisticalCorrector
void uncondBranch(ThreadID tid, Addr pc, void *&bp_history) override
unsigned int getIndex(ThreadID tid, MPPTAGEBranchInfo &bi, const HistorySpec &spec, int index) const
void squash(ThreadID tid, void *bp_history) override
void updatePartial(ThreadID tid, MPPTAGEBranchInfo &bi, bool taken)
void updateHistories(ThreadID tid, MPPTAGEBranchInfo &bi, bool taken)
const unsigned int pc
pc of the branch
std::vector< int8_t > bias
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
int16_t ThreadID
Thread index/ID type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
unsigned int historyStackPointer
void updateHistoryStack(Addr target, bool taken, bool is_call, bool is_return)
unsigned int getPointer() const
int64_t getHistoryStackEntry() const
std::vector< int64_t > historyStack
BranchInfo(TAGEBase &tage)
Branch information data type.
virtual ~MPPTAGEBranchInfo()
MPPTAGEBranchInfo(Addr pc, int pcshift, bool cond, TAGEBase &tage, LoopPredictor &loopPredictor, StatisticalCorrector &statisticalCorrector)
StatisticalCorrector::BranchInfo * scBranchInfo
TAGEBase::BranchInfo * tageBranchInfo
LoopPredictor::BranchInfo * lpBranchInfo