changeset 5ae66d5f5ca2 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=5ae66d5f5ca2
description:
inorder: import name for addtl. bpred stats
diffstat:
3 files changed, 22 insertions(+), 19 deletions(-)
src/cpu/inorder/resources/bpred_unit.cc | 32 +++++++++++--------------
src/cpu/inorder/resources/bpred_unit.hh | 7 ++++-
src/cpu/inorder/resources/branch_predictor.cc | 2 -
diffs (121 lines):
diff -r c207d418514e -r 5ae66d5f5ca2 src/cpu/inorder/resources/bpred_unit.cc
--- a/src/cpu/inorder/resources/bpred_unit.cc Mon Mar 22 16:59:12 2010 -0400
+++ b/src/cpu/inorder/resources/bpred_unit.cc Mon Mar 22 17:19:48 2010 -0400
@@ -39,10 +39,9 @@
using namespace std;
using namespace ThePipeline;
-BPredUnit::BPredUnit(ThePipeline::Params *params)
- : BTB(params->BTBEntries,
- params->BTBTagSize,
- params->instShiftAmt)
+BPredUnit::BPredUnit(Resource *_res, ThePipeline::Params *params)
+ : res(_res),
+ BTB(params->BTBEntries, params->BTBTagSize, params->instShiftAmt)
{
// Setup the selected predictor.
if (params->predType == "local") {
@@ -70,48 +69,47 @@
RAS[i].init(params->RASSize);
}
+std::string
+BPredUnit::name()
+{
+ return res->name();
+}
void
BPredUnit::regStats()
{
lookups
- .name(name() + ".BPredUnit.lookups")
+ .name(name() + ".lookups")
.desc("Number of BP lookups")
;
condPredicted
- .name(name() + ".BPredUnit.condPredicted")
+ .name(name() + ".condPredicted")
.desc("Number of conditional branches predicted")
;
condIncorrect
- .name(name() + ".BPredUnit.condIncorrect")
+ .name(name() + ".condIncorrect")
.desc("Number of conditional branches incorrect")
;
BTBLookups
- .name(name() + ".BPredUnit.BTBLookups")
+ .name(name() + ".BTBLookups")
.desc("Number of BTB lookups")
;
BTBHits
- .name(name() + ".BPredUnit.BTBHits")
+ .name(name() + ".BTBHits")
.desc("Number of BTB hits")
;
- BTBCorrect
- .name(name() + ".BPredUnit.BTBCorrect")
- .desc("Number of correct BTB predictions (this stat may not "
- "work properly.")
- ;
-
usedRAS
- .name(name() + ".BPredUnit.usedRAS")
+ .name(name() + ".usedRAS")
.desc("Number of times the RAS was used to get a target.")
;
RASIncorrect
- .name(name() + ".BPredUnit.RASInCorrect")
+ .name(name() + ".RASInCorrect")
.desc("Number of incorrect RAS predictions.")
;
}
diff -r c207d418514e -r 5ae66d5f5ca2 src/cpu/inorder/resources/bpred_unit.hh
--- a/src/cpu/inorder/resources/bpred_unit.hh Mon Mar 22 16:59:12 2010 -0400
+++ b/src/cpu/inorder/resources/bpred_unit.hh Mon Mar 22 17:19:48 2010 -0400
@@ -39,6 +39,7 @@
#include "cpu/inst_seq.hh"
#include "cpu/inorder/inorder_dyn_inst.hh"
#include "cpu/inorder/pipeline_traits.hh"
+#include "cpu/inorder/resource.hh"
#include "cpu/pred/2bit_local.hh"
#include "cpu/pred/btb.hh"
#include "cpu/pred/ras.hh"
@@ -65,7 +66,9 @@
/**
* @param params The params object, that has the size of the BP and BTB.
*/
- BPredUnit(ThePipeline::Params *params);
+ BPredUnit(Resource *_res, ThePipeline::Params *params);
+
+ std::string name();
/**
* Registers statistics.
@@ -169,6 +172,8 @@
void dump();
private:
+ Resource *res;
+
struct PredictorHistory {
/**
* Makes a predictor history struct that contains any
diff -r c207d418514e -r 5ae66d5f5ca2
src/cpu/inorder/resources/branch_predictor.cc
--- a/src/cpu/inorder/resources/branch_predictor.cc Mon Mar 22 16:59:12
2010 -0400
+++ b/src/cpu/inorder/resources/branch_predictor.cc Mon Mar 22 17:19:48
2010 -0400
@@ -39,7 +39,7 @@
BranchPredictor::BranchPredictor(std::string res_name, int res_id, int
res_width,
int res_latency, InOrderCPU *_cpu, ThePipeline::Params
*params)
: Resource(res_name, res_id, res_width, res_latency, _cpu),
- branchPred(params)
+ branchPred(this, params)
{
instSize = sizeof(MachInst);
}
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev