diff options
author | Nilay Vaish ext:(%2C%20Timothy%20Jones%20%3Ctimothy.jones%40cl.cam.ac.uk%3E) <nilay@cs.wisc.edu> | 2013-01-24 12:28:51 -0600 |
---|---|---|
committer | Nilay Vaish ext:(%2C%20Timothy%20Jones%20%3Ctimothy.jones%40cl.cam.ac.uk%3E) <nilay@cs.wisc.edu> | 2013-01-24 12:28:51 -0600 |
commit | dbeabedaf0f8d9ec0ea3331db2e44b1add53f79f (patch) | |
tree | 568d3b6007adf1a8d3ba6568fc5635e56afd3d53 /src/cpu/pred/tournament.cc | |
parent | 11d5ffa108983d5d9742f0aad23f80c691f285ee (diff) | |
download | gem5-dbeabedaf0f8d9ec0ea3331db2e44b1add53f79f.tar.xz |
branch predictor: move out of o3 and inorder cpus
This patch moves the branch predictor files in the o3 and inorder directories
to src/cpu/pred. This allows sharing the branch predictor across different
cpu models.
This patch was originally posted by Timothy Jones in July 2010
but never made it to the repository.
--HG--
rename : src/cpu/o3/bpred_unit.cc => src/cpu/pred/bpred_unit.cc
rename : src/cpu/o3/bpred_unit.hh => src/cpu/pred/bpred_unit.hh
rename : src/cpu/o3/bpred_unit_impl.hh => src/cpu/pred/bpred_unit_impl.hh
rename : src/cpu/o3/sat_counter.hh => src/cpu/pred/sat_counter.hh
Diffstat (limited to 'src/cpu/pred/tournament.cc')
-rw-r--r-- | src/cpu/pred/tournament.cc | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/src/cpu/pred/tournament.cc b/src/cpu/pred/tournament.cc index f36d30ae5..52a05960f 100644 --- a/src/cpu/pred/tournament.cc +++ b/src/cpu/pred/tournament.cc @@ -44,24 +44,17 @@ #include "base/intmath.hh" #include "cpu/pred/tournament.hh" -TournamentBP::TournamentBP(unsigned _localCtrBits, - unsigned _localHistoryTableSize, - unsigned _localHistoryBits, - unsigned _globalPredictorSize, - unsigned _globalHistoryBits, - unsigned _globalCtrBits, - unsigned _choicePredictorSize, - unsigned _choiceCtrBits, - unsigned _instShiftAmt) - : localCtrBits(_localCtrBits), - localHistoryTableSize(_localHistoryTableSize), - localHistoryBits(_localHistoryBits), - globalPredictorSize(_globalPredictorSize), - globalCtrBits(_globalCtrBits), - globalHistoryBits(_globalHistoryBits), - choicePredictorSize(_choicePredictorSize), - choiceCtrBits(_choiceCtrBits), - instShiftAmt(_instShiftAmt) +TournamentBP::TournamentBP(const Params *params) + : BPredUnit(params), + localCtrBits(params->localCtrBits), + localHistoryTableSize(params->localHistoryTableSize), + localHistoryBits(params->localHistoryBits), + globalPredictorSize(params->globalPredictorSize), + globalCtrBits(params->globalCtrBits), + globalHistoryBits(params->globalHistoryBits), + choicePredictorSize(params->choicePredictorSize), + choiceCtrBits(params->choiceCtrBits), + instShiftAmt(params->instShiftAmt) { localPredictorSize = ULL(1) << localHistoryBits; @@ -178,7 +171,7 @@ TournamentBP::updateLocalHistNotTaken(unsigned local_history_idx) void -TournamentBP::BTBUpdate(Addr &branch_addr, void * &bp_history) +TournamentBP::btbUpdate(Addr branch_addr, void * &bp_history) { unsigned local_history_idx = calcLocHistIdx(branch_addr); //Update Global History to Not Taken (clear LSB) @@ -189,7 +182,7 @@ TournamentBP::BTBUpdate(Addr &branch_addr, void * &bp_history) } bool -TournamentBP::lookup(Addr &branch_addr, void * &bp_history) +TournamentBP::lookup(Addr branch_addr, void * &bp_history) { bool local_prediction; unsigned local_history_idx; @@ -249,7 +242,7 @@ TournamentBP::lookup(Addr &branch_addr, void * &bp_history) } void -TournamentBP::uncondBr(void * &bp_history) +TournamentBP::uncondBranch(void * &bp_history) { // Create BPHistory and pass it back to be recorded. BPHistory *history = new BPHistory; @@ -264,7 +257,7 @@ TournamentBP::uncondBr(void * &bp_history) } void -TournamentBP::update(Addr &branch_addr, bool taken, void *bp_history, +TournamentBP::update(Addr branch_addr, bool taken, void *bp_history, bool squashed) { unsigned local_history_idx; |