*/
bool predict(const StaticInstPtr &inst, const InstSeqNum &seqNum,
TheISA::PCState &pc, ThreadID tid);
- bool predictInOrder(const StaticInstPtr &inst, const InstSeqNum &seqNum,
- int asid, TheISA::PCState &instPC,
- TheISA::PCState &predPC, ThreadID tid);
// @todo: Rename this function.
- virtual void uncondBranch(Addr pc, void * &bp_history) = 0;
+ virtual void uncondBranch(ThreadID tid, Addr pc, void * &bp_history) = 0;
/**
* Tells the branch predictor to commit any updates until the given
* @param bp_history Pointer to the history object. The predictor
* will need to update any state and delete the object.
*/
- virtual void squash(void *bp_history) = 0;
+ virtual void squash(ThreadID tid, void *bp_history) = 0;
/**
* Looks up a given PC in the BP to see if it is taken or not taken.
* has the branch predictor state associated with the lookup.
* @return Whether the branch is taken or not taken.
*/
- virtual bool lookup(Addr instPC, void * &bp_history) = 0;
+ virtual bool lookup(ThreadID tid, Addr instPC, void * &bp_history) = 0;
/**
* If a branch is not taken, because the BTB address is invalid or missing,
* @param bp_history Pointer that will be set to an object that
* has the branch predictor state associated with the lookup.
*/
- virtual void btbUpdate(Addr instPC, void * &bp_history) = 0;
+ virtual void btbUpdate(ThreadID tid, Addr instPC, void * &bp_history) = 0;
/**
* Looks up a given PC in the BTB to see if a matching entry exists.
* squash operation.
* @todo Make this update flexible enough to handle a global predictor.
*/
- virtual void update(Addr instPC, bool taken, void *bp_history,
- bool squashed) = 0;
- /**
- * Deletes the associated history with a branch, performs no predictor
- * updates. Used for branches that mispredict and update tables but
- * are still speculative and later retire.
- * @param bp_history History to delete associated with this predictor
- */
- virtual void retireSquashed(void *bp_history) = 0;
-
+ virtual void update(ThreadID tid, Addr instPC, bool taken,
+ void *bp_history, bool squashed) = 0;
/**
* Updates the BTB with the target of a branch.
* @param inst_PC The branch's PC that will be updated.
{ BTB.update(instPC, target, 0); }
- virtual unsigned getGHR(void* bp_history) const { return 0; }
+ virtual unsigned getGHR(ThreadID tid, void* bp_history) const { return 0; }
void dump();
ThreadID _tid)
: seqNum(seq_num), pc(instPC), bpHistory(bp_history), RASTarget(0),
RASIndex(0), tid(_tid), predTaken(pred_taken), usedRAS(0), pushedRAS(0),
- wasCall(0), wasReturn(0), wasSquashed(0), wasIndirect(0)
+ wasCall(0), wasReturn(0), wasIndirect(0)
{}
bool operator==(const PredictorHistory &entry) const {
/** Whether or not the instruction was a return. */
bool wasReturn;
- /** Whether this instruction has already mispredicted/updated bp */
- bool wasSquashed;
-
/** Wether this instruction was an indirect branch */
bool wasIndirect;
};