Go to the documentation of this file.
40 globalHistoryReg(params->numThreads, 0),
41 globalHistoryBits(
ceilLog2(params->globalPredictorSize)),
42 choicePredictorSize(params->choicePredictorSize),
43 choiceCtrBits(params->choiceCtrBits),
44 globalPredictorSize(params->globalPredictorSize),
45 globalCtrBits(params->globalCtrBits),
46 choiceCounters(choicePredictorSize,
SatCounter(choiceCtrBits)),
47 takenCounters(globalPredictorSize,
SatCounter(globalCtrBits)),
48 notTakenCounters(globalPredictorSize,
SatCounter(globalCtrBits))
51 fatal(
"Invalid choice predictor size.\n");
53 fatal(
"Invalid global history predictor size.\n");
78 bpHistory =
static_cast<void*
>(history);
103 unsigned choiceHistoryIdx = ((branchAddr >>
instShiftAmt)
105 unsigned globalHistoryIdx = (((branchAddr >>
instShiftAmt)
118 bool finalPrediction;
126 if (choicePrediction) {
127 finalPrediction = takenGHBPrediction;
129 finalPrediction = notTakenGHBPrediction;
133 bpHistory =
static_cast<void*
>(history);
136 return finalPrediction;
166 unsigned choiceHistoryIdx = ((branchAddr >>
instShiftAmt)
168 unsigned globalHistoryIdx = (((branchAddr >>
instShiftAmt)
230 BiModeBPParams::create()
#define fatal(...)
This implements a cprintf based fatal() function.
int16_t ThreadID
Thread index/ID type.
unsigned globalHistoryBits
std::vector< SatCounter > choiceCounters
bool lookup(ThreadID tid, Addr branch_addr, void *&bp_history)
Looks up a given PC in the BP to see if it is taken or not taken.
unsigned globalPredictorSize
std::vector< unsigned > globalHistoryReg
unsigned globalHistoryReg
void updateGlobalHistReg(ThreadID tid, bool taken)
Implements a bi-mode branch predictor.
const unsigned instShiftAmt
Number of bits to shift instructions by for predictor addresses.
unsigned choiceHistoryMask
Basically a wrapper class to hold both the branch predictor and the BTB.
unsigned historyRegisterMask
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
std::vector< SatCounter > takenCounters
Implements an n bit saturating counter and provides methods to increment, decrement,...
unsigned choicePredictorSize
void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed, const StaticInstPtr &inst, Addr corrTarget)
Updates the BP with taken/not taken information.
unsigned globalHistoryMask
std::vector< SatCounter > notTakenCounters
void squash(ThreadID tid, void *bp_history)
unsigned notTakenThreshold
void uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
void btbUpdate(ThreadID tid, Addr branch_addr, void *&bp_history)
If a branch is not taken, because the BTB address is invalid or missing, this function sets the appro...
bool isPowerOf2(const T &n)
BiModeBP(const BiModeBPParams *params)
#define ULL(N)
uint64_t constant
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17