Go to the documentation of this file.
42 #ifndef __CPU_PRED_BPRED_UNIT_HH__
43 #define __CPU_PRED_BPRED_UNIT_HH__
54 #include "params/BranchPredictor.hh"
65 typedef BranchPredictorParams
Params;
174 void *bp_history,
bool squashed,
194 bool pred_taken,
void *bp_history,
195 void *indirect_history,
ThreadID _tid,
342 #endif // __CPU_PRED_BPRED_UNIT_HH__
bool wasReturn
Whether or not the instruction was a return.
void regProbePoints() override
Register probe points for this object.
Stats::Formula BTBHitPct
Stat for percent times an entry in BTB found.
ProbePoints::PMUUPtr ppMisses
Miss-predicted branches.
std::vector< ReturnAddrStack > RAS
The per-thread return address stack.
int16_t ThreadID
Thread index/ID type.
Stats::Scalar lookups
Stat for number of BP lookups.
Stats::Scalar indirectMisses
Stat for the number of indirect target misses.
TheISA::PCState RASTarget
The RAS target (only valid if a return).
IndirectPredictor * iPred
The indirect target predictor.
Addr target
Target of the branch.
void drainSanityCheck() const
Perform sanity checks after a drain.
virtual void btbUpdate(ThreadID tid, Addr instPC, void *&bp_history)=0
If a branch is not taken, because the BTB address is invalid or missing, this function sets the appro...
InstSeqNum seqNum
The sequence number for the predictor history entry.
Stats::Scalar condPredicted
Stat for number of conditional branches predicted.
ProbePoints::PMUUPtr pmuProbePoint(const char *name)
Helper method to instantiate probe points belonging to this object.
BPredUnitStats(Stats::Group *parent)
void update(const InstSeqNum &done_sn, ThreadID tid)
Tells the branch predictor to commit any updates until the given sequence number.
BPredUnit(const Params *p)
const unsigned instShiftAmt
Number of bits to shift instructions by for predictor addresses.
void * bpHistory
Pointer to the history object passed back from the branch predictor.
const unsigned numThreads
Number of the threads for which the branch history is maintained.
virtual bool lookup(ThreadID tid, Addr instPC, void *&bp_history)=0
Looks up a given PC in the BP to see if it is taken or not taken.
This is a simple scalar statistic, like a counter.
Stats::Scalar indirectHits
Stat for the number of indirect target hits.
bool BTBValid(Addr instPC)
Looks up a given PC in the BTB to see if a matching entry exists.
Stats::Scalar condIncorrect
Stat for number of conditional branches predicted incorrectly.
void update(Addr instPC, const TheISA::PCState &targetPC, ThreadID tid)
Updates the BTB with the target of a branch.
PredictorHistory(const InstSeqNum &seq_num, Addr instPC, bool pred_taken, void *bp_history, void *indirect_history, ThreadID _tid, const StaticInstPtr &inst)
Makes a predictor history struct that contains any information needed to update the predictor,...
Stats::Scalar BTBHits
Stat for number of BTB hits.
void BTBUpdate(Addr instPC, const TheISA::PCState &target)
Updates the BTB with the target of a branch.
Stats::Scalar RASUsed
Stat for number of times the RAS is used to get a target.
Stats::Scalar indirectMispredicted
Stat for the number of indirect target mispredictions.
const StaticInstPtr inst
The branch instrction.
Stats::Scalar indirectLookups
Stat for the number of indirect target lookups.
bool valid(Addr instPC, ThreadID tid)
Checks if a branch is in the BTB.
bool operator==(const PredictorHistory &entry) const
Stats::Scalar RASIncorrect
Stat for number of times the RAS is incorrect.
Basically a wrapper class to hold both the branch predictor and the BTB.
virtual void uncondBranch(ThreadID tid, Addr pc, void *&bp_history)=0
BPredUnit::BPredUnitStats stats
std::vector< History > predHist
The per-thread predictor history.
bool usedRAS
Whether or not the RAS was used.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
bool wasIndirect
Wether this instruction was an indirect branch.
std::unique_ptr< PMU > PMUUPtr
virtual const std::string name() const
unsigned RASIndex
The RAS index of the instruction (only valid if a call).
bool wasCall
Whether or not the instruction was a call.
Addr pc
The PC associated with the sequence number.
BranchPredictorParams Params
GenericISA::DelaySlotPCState< MachInst > PCState
Stats::Scalar BTBLookups
Stat for number of BTB lookups.
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum, TheISA::PCState &pc, ThreadID tid)
Predicts whether or not the instruction is a taken branch, and the target of the branch if it is take...
std::deque< PredictorHistory > History
TheISA::PCState lookup(Addr instPC, ThreadID tid)
Looks up an address in the BTB.
ProbePoints::PMUUPtr ppBranches
Branches seen by the branch predictor.
void squash(const InstSeqNum &squashed_sn, ThreadID tid)
Squashes all outstanding updates until a given sequence number.
bool predTaken
Whether or not it was predicted taken.
TheISA::PCState BTBLookup(Addr instPC)
Looks up a given PC in the BTB to get the predicted target.
ThreadID tid
The thread id.
Abstract superclass for simulation objects.
Generated on Wed Sep 30 2020 14:02:09 for gem5 by doxygen 1.8.17