44 #ifndef __CPU_PRED_2BIT_LOCAL_PRED_HH__
45 #define __CPU_PRED_2BIT_LOCAL_PRED_HH__
52 #include "params/LocalBP.hh"
98 { assert(bp_history == NULL); }
130 #endif // __CPU_PRED_2BIT_LOCAL_PRED_HH__
Implements a local predictor that uses the PC to index into a table of counters.
unsigned localPredictorSize
Size of the local predictor.
void btbUpdate(ThreadID tid, Addr branch_addr, void *&bp_history)
Updates the branch predictor to Not Taken if a BTB entry is invalid or not found. ...
unsigned indexMask
Mask to get index bits.
virtual void uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
const Params * params() const
bool lookup(ThreadID tid, Addr branch_addr, void *&bp_history)
Looks up the given address in the branch predictor and returns a true/false value as to whether it is...
unsigned getLocalIndex(Addr &PC)
Calculates the local index based on the PC.
unsigned localPredictorSets
Number of sets.
LocalBP(const LocalBPParams *params)
Default branch predictor constructor.
std::vector< SatCounter > localCtrs
Array of counters that make up the local predictor.
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Basically a wrapper class to hold both the branch predictor and the BTB.
int16_t ThreadID
Thread index/ID type.
unsigned localCtrBits
Number of bits of the local predictor's counters.
void update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history, bool squashed)
Updates the branch predictor with the actual result of a branch.
void squash(ThreadID tid, void *bp_history)
bool getPrediction(uint8_t &count)
Returns the taken/not taken prediction given the value of the counter.