inorder: fix squash bug in branch predictor

This commit is contained in:
Maximilien Breughe 2010-03-22 16:59:12 -04:00
parent 4ac245737d
commit 0170e851de
2 changed files with 8 additions and 1 deletions

View file

@ -343,6 +343,8 @@ BPredUnit::squash(const InstSeqNum &squashed_sn,
// corresponding to the squash. In that case, don't bother trying to // corresponding to the squash. In that case, don't bother trying to
// fix up the entry. // fix up the entry.
if (!pred_hist.empty()) { if (!pred_hist.empty()) {
if(pred_hist.front().seqNum==squashed_sn){
assert(pred_hist.front().seqNum == squashed_sn); assert(pred_hist.front().seqNum == squashed_sn);
if (pred_hist.front().usedRAS) { if (pred_hist.front().usedRAS) {
++RASIncorrect; ++RASIncorrect;
@ -353,6 +355,7 @@ BPredUnit::squash(const InstSeqNum &squashed_sn,
BTB.update(pred_hist.front().PC, corr_target, tid); BTB.update(pred_hist.front().PC, corr_target, tid);
pred_hist.pop_front(); pred_hist.pop_front();
}
} }
} }

View file

@ -56,6 +56,8 @@ BranchPredictor::regStats()
.desc("Number of Branches Predicted As Not Taken (False)."); .desc("Number of Branches Predicted As Not Taken (False).");
Resource::regStats(); Resource::regStats();
branchPred.regStats();
} }
void void
@ -140,7 +142,9 @@ BranchPredictor::squash(DynInstPtr inst, int squash_stage,
InstSeqNum squash_seq_num, ThreadID tid) InstSeqNum squash_seq_num, ThreadID tid)
{ {
DPRINTF(InOrderBPred, "Squashing...\n"); DPRINTF(InOrderBPred, "Squashing...\n");
branchPred.squash(squash_seq_num, tid); Addr corr_targ=inst->readPredPC();
bool taken=inst->predTaken();
branchPred.squash(squash_seq_num,corr_targ,taken,tid);
} }
void void