summaryrefslogtreecommitdiff
path: root/cpu/o3/bpred_unit_impl.hh
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/o3/bpred_unit_impl.hh')
-rw-r--r--cpu/o3/bpred_unit_impl.hh21
1 files changed, 21 insertions, 0 deletions
diff --git a/cpu/o3/bpred_unit_impl.hh b/cpu/o3/bpred_unit_impl.hh
index f79b67b6c..872c0c62e 100644
--- a/cpu/o3/bpred_unit_impl.hh
+++ b/cpu/o3/bpred_unit_impl.hh
@@ -95,6 +95,26 @@ TwobitBPredUnit<Impl>::regStats()
}
template <class Impl>
+void
+TwobitBPredUnit<Impl>::switchOut()
+{
+ for (int i = 0; i < Impl::MaxThreads; ++i) {
+ predHist[i].clear();
+ }
+}
+
+template <class Impl>
+void
+TwobitBPredUnit<Impl>::takeOverFrom()
+{
+ for (int i = 0; i < Impl::MaxThreads; ++i)
+ RAS[i].reset();
+
+ BP.reset();
+ BTB.reset();
+}
+
+template <class Impl>
bool
TwobitBPredUnit<Impl>::predict(DynInstPtr &inst, Addr &PC, unsigned tid)
{
@@ -297,5 +317,6 @@ TwobitBPredUnit<Impl>::squash(const InstSeqNum &squashed_sn,
BP.update(pred_hist.front().PC, actually_taken);
BTB.update(pred_hist.front().PC, corr_target, tid);
+ pred_hist.pop_front();
}
}