69 fatal(
"Invalid choice predictor size.\n");
71 fatal(
"Invalid global history predictor size.\n");
96 bp_history =
static_cast<void*
>(history);
104 assert(uncond || bp_history);
119 bp_history =
nullptr;
134 unsigned choiceHistoryIdx = ((branchAddr >>
instShiftAmt)
136 unsigned globalHistoryIdx = (((branchAddr >>
instShiftAmt)
149 bool finalPrediction;
157 if (choicePrediction) {
158 finalPrediction = takenGHBPrediction;
160 finalPrediction = notTakenGHBPrediction;
164 bp_history =
static_cast<void*
>(history);
166 return finalPrediction;
191 unsigned choiceHistoryIdx = ((branchAddr >>
instShiftAmt)
193 unsigned globalHistoryIdx = (((branchAddr >>
instShiftAmt)
244 bp_history =
nullptr;
BPredUnit(const Params &p)
Branch Predictor Unit (BPU) interface functions.
const unsigned numThreads
Number of the threads for which the branch history is maintained.
const unsigned instShiftAmt
Number of bits to shift instructions by for predictor addresses.
unsigned globalHistoryBits
std::vector< unsigned > globalHistoryReg
std::vector< SatCounter8 > notTakenCounters
void updateGlobalHistReg(ThreadID tid, bool taken)
void uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
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.
unsigned globalHistoryMask
void squash(ThreadID tid, void *&bp_history) override
std::vector< SatCounter8 > takenCounters
unsigned historyRegisterMask
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.
std::vector< SatCounter8 > choiceCounters
unsigned choiceHistoryMask
unsigned globalPredictorSize
unsigned notTakenThreshold
bool lookup(ThreadID tid, Addr pc, void *&bp_history) override
Looks up a given conditional branch PC of in the BP to see if it is taken or not taken.
unsigned choicePredictorSize
BiModeBP(const BiModeBPParams ¶ms)
static constexpr int ceilLog2(const T &n)
static constexpr bool isPowerOf2(const T &n)
#define fatal(...)
This implements a cprintf based fatal() function.
GenericSatCounter< uint8_t > SatCounter8
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
unsigned globalHistoryReg