56#ifndef __CPU_PRED_TAGE_SC_L_HH__
57#define __CPU_PRED_TAGE_SC_L_HH__
62#include "params/TAGE_SC_L.hh"
63#include "params/TAGE_SC_L_LoopPredictor.hh"
64#include "params/TAGE_SC_L_TAGE.hh"
128 int F(
int phist,
int size,
int bank)
const override;
137 void adjustAlloc(
bool & alloc,
bool taken,
bool pred_taken)
override;
174 ThreadID tid,
Addr branch_pc,
bool cond_branch,
void* &
b)
override;
178 Addr target)
override;
181 void * &bp_history)
override;
183 bool uncond,
void * &bp_history)
override
184 {
panic(
"Not implemented for this BP!\n"); }
static RandomPtr genRandom(Random *r=nullptr)
std::shared_ptr< Random > RandomPtr
LTAGE(const LTAGEParams ¶ms)
@ LAST_LTAGE_PROVIDER_TYPE
LoopPredictor(const LoopPredictorParams &p)
TAGEBase(const TAGEBaseParams &p)
TAGE_SC_L_LoopPredictor(const TAGE_SC_L_LoopPredictorParams &p)
virtual bool optionalAgeInc() const override
virtual bool calcConf(int index) const override
const unsigned shortTagsTageFactor
virtual void handleAllocAndUReset(bool alloc, bool taken, TAGEBase::BranchInfo *bi, int nrand) override=0
Handles Allocation and U bits reset on an update.
void extraAltCalc(TAGEBase::BranchInfo *bi) override
Extra steps for calculating altTaken For this base TAGE class it does nothing.
void calculateIndicesAndTags(ThreadID tid, Addr branch_pc, TAGEBase::BranchInfo *bi) override
On a prediction, calculates the TAGE indices and tags for all the different history lengths.
int bindex(Addr pc_in) const override
Computes the index used to access the bimodal table.
int calcDep(TAGEBase::BranchInfo *bi)
bool getBimodePred(Addr branch_pc, TAGEBase::BranchInfo *tage_bi) const override
Get a branch prediction from the bimodal predictor.
const unsigned longTagsTageFactor
TAGE_SC_L_TAGE(const TAGE_SC_L_TAGEParams &p)
const bool truncatePathHist
void updatePathAndGlobalHistory(ThreadID tid, int brtype, bool taken, Addr branch_pc, Addr target, TAGEBase::BranchInfo *bi) override
Does the actual update of path and global history.
const unsigned longTagsSize
virtual void handleTAGEUpdate(Addr branch_pc, bool taken, TAGEBase::BranchInfo *bi) override=0
Handles the update of the TAGE entries.
int gindex(ThreadID tid, Addr pc, int bank) const override
Computes the index used to access a partially tagged table.
virtual int gindex_ext(int index, int bank) const =0
const unsigned shortTagsSize
const unsigned firstLongTagTable
int F(int phist, int size, int bank) const override
Utility function to shuffle the path history depending on which tagged table we are accessing.
void calculateParameters() override
Calculates the history lengths and some other paramters in derived classes.
int branchTypeExtra(const StaticInstPtr &inst) override
This function acts as a hook for other TAGE implementations to adjust the branch type.
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 ...
void buildTageTables() override
Instantiates the TAGE table entries.
unsigned getUseAltIdx(TAGEBase::BranchInfo *bi, Addr branch_pc) override
Calculation of the index for useAltPredForNewlyAllocated On this base TAGE implementation it is alway...
virtual uint16_t gtag(ThreadID tid, Addr pc, int bank) const override=0
Computes the partial tag of a tagged table.
virtual TAGEBase::BranchInfo * makeBranchInfo(Addr pc, bool cond) override
const unsigned logTagTableSize
void handleUReset() override
Handles the U bits reset.
bool predict(ThreadID tid, Addr branch_pc, bool cond_branch, void *&b) override
Get a branch prediction from LTAGE.
void update(ThreadID tid, Addr pc, bool taken, void *&bp_history, bool squashed, const StaticInstPtr &inst, Addr target) override
Updates the BP with taken/not taken information.
TAGE_SC_L(const TAGE_SC_LParams ¶ms)
void branchPlaceholder(ThreadID tid, Addr pc, bool uncond, void *&bp_history) override
Special function for the decoupled front-end.
StatisticalCorrector * statisticalCorrector
void squash(ThreadID tid, void *&bp_history) override
void updateHistories(ThreadID tid, Addr pc, bool uncond, bool taken, Addr target, const StaticInstPtr &inst, void *&bp_history) override
Ones done with the prediction this function updates the path and global history.
#define panic(...)
This implements a cprintf based panic() function.
const Params & params() const
Copyright (c) 2024 Arm Limited All rights reserved.
int16_t ThreadID
Thread index/ID type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
RefCountingPtr< StaticInst > StaticInstPtr
LTageBranchInfo(TAGEBase &tage, LoopPredictor &lp, Addr pc, bool conditional)
virtual ~TageSCLBranchInfo()
TageSCLBranchInfo(TAGEBase &tage, StatisticalCorrector &sc, LoopPredictor &lp, Addr pc, bool cond_branch)
StatisticalCorrector::BranchInfo * scBranchInfo
BranchInfo(TAGEBase &tage, Addr pc, bool cond)