42#ifndef __CPU_PRED_TOURNAMENT_PRED_HH__
43#define __CPU_PRED_TOURNAMENT_PRED_HH__
50#include "params/TournamentBP.hh"
78 void * &bp_history)
override;
81 Addr target)
override;
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
BPredUnit(const Params &p)
Branch Predictor Unit (BPU) interface functions.
unsigned globalHistoryMask
Mask to apply to globalHistory to access global history table.
std::vector< SatCounter8 > choiceCtrs
Array of counters that make up the choice predictor.
unsigned globalHistoryBits
Number of bits for the global history.
void updateGlobalHist(ThreadID tid, bool taken)
Updates global history with the given direction.
TournamentBP(const TournamentBPParams ¶ms)
Default branch predictor constructor.
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 globalPredictorSize
Number of entries in the global predictor.
std::vector< SatCounter8 > localCtrs
Local counters.
unsigned localPredictorMask
Mask to truncate values stored in the local history table.
void squash(ThreadID tid, void *&bp_history) override
unsigned historyRegisterMask
Mask to control how much history is stored.
bool getPrediction(uint8_t &count)
Returns if the branch should be taken or not, given a counter value.
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.
static const int invalidPredictorIndex
Flag for invalid predictor index.
unsigned localHistoryBits
Number of bits for each entry of the local history table.
std::vector< unsigned > localHistoryTable
Array of local history table entries.
unsigned localCtrBits
Number of bits of the local predictor's counters.
unsigned localThreshold
Thresholds for the counter value; above the threshold is taken, equal to or below the threshold is no...
unsigned choiceHistoryMask
Mask to apply to globalHistory to access choice history table.
void updateLocalHist(unsigned local_history_idx, bool taken)
Updates local histories.
std::vector< SatCounter8 > globalCtrs
Array of counters that make up the global predictor.
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 localPredictorSize
Number of counters in the local predictor.
unsigned calcLocHistIdx(Addr &branch_addr)
Returns the local history index, given a branch address.
std::vector< unsigned > globalHistory
Global history register.
unsigned globalCtrBits
Number of bits of the global predictor's counters.
unsigned choiceCtrBits
Number of bits in the choice predictor's counters.
unsigned localHistoryTableSize
Number of entries in the local history table.
unsigned choicePredictorSize
Number of entries in the choice predictor.
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
The branch history information that is created upon predicting a branch.