summaryrefslogtreecommitdiff
path: root/src/cpu/pred/bi_mode.cc
diff options
context:
space:
mode:
authorDibakar Gope <gope@wisc.edu>2015-04-13 17:33:57 -0500
committerDibakar Gope <gope@wisc.edu>2015-04-13 17:33:57 -0500
commit34ad1123ee5927e3b1503f07649620a533d3eab9 (patch)
treee655941704abbbafad01966bfa188449a336aaef /src/cpu/pred/bi_mode.cc
parente596e524985cfb1f4d46aceebe69bb7fcd94cf04 (diff)
downloadgem5-34ad1123ee5927e3b1503f07649620a533d3eab9.tar.xz
cpu: re-organizes the branch predictor structure.
Committed by: Nilay Vaish <nilay@cs.wisc.edu>
Diffstat (limited to 'src/cpu/pred/bi_mode.cc')
-rw-r--r--src/cpu/pred/bi_mode.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/cpu/pred/bi_mode.cc b/src/cpu/pred/bi_mode.cc
index 604afee55..c2a41cd4d 100644
--- a/src/cpu/pred/bi_mode.cc
+++ b/src/cpu/pred/bi_mode.cc
@@ -36,8 +36,8 @@
#include "base/intmath.hh"
#include "cpu/pred/bi_mode.hh"
-BiModeBP::BiModeBP(const Params *params)
- : BPredUnit(params), instShiftAmt(params->instShiftAmt),
+BiModeBP::BiModeBP(const BiModeBPParams *params)
+ : BPredUnit(params),
globalHistoryReg(0),
globalHistoryBits(ceilLog2(params->globalPredictorSize)),
choicePredictorSize(params->choicePredictorSize),
@@ -77,7 +77,7 @@ BiModeBP::BiModeBP(const Params *params)
* chooses the taken array and the taken array predicts taken.
*/
void
-BiModeBP::uncondBranch(void * &bpHistory)
+BiModeBP::uncondBranch(Addr pc, void * &bpHistory)
{
BPHistory *history = new BPHistory;
history->globalHistoryReg = globalHistoryReg;
@@ -243,3 +243,9 @@ BiModeBP::updateGlobalHistReg(bool taken)
(globalHistoryReg << 1);
globalHistoryReg &= historyRegisterMask;
}
+
+BiModeBP*
+BiModeBPParams::create()
+{
+ return new BiModeBP(this);
+}