[gem5-dev] Change in gem5/gem5[develop]: cpu-o3: convert commit to new style stats
Jason Lowe-Power has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/33315 ) Change subject: cpu-o3: convert commit to new style stats .. cpu-o3: convert commit to new style stats Change-Id: I859fe753d1a2ec2da8a4209d1db122f1014af5d6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33315 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/cpu/o3/commit.hh M src/cpu/o3/commit_impl.hh M src/cpu/o3/cpu.cc 3 files changed, 117 insertions(+), 155 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 85d00a9..01a0b7f 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -143,9 +143,6 @@ /** Returns the name of the DefaultCommit. */ std::string name() const; -/** Registers statistics. */ -void regStats(); - /** Registers probes. */ void regProbePoints(); @@ -479,52 +476,55 @@ /** Updates commit stats based on this instruction. */ void updateComInstStats(const DynInstPtr &inst); - // HTM int htmStarts[Impl::MaxThreads]; int htmStops[Impl::MaxThreads]; -/** Stat for the total number of squashed instructions discarded by commit. - */ -Stats::Scalar commitSquashedInsts; -/** Stat for the total number of times commit has had to stall due to a non- - * speculative instruction reaching the head of the ROB. - */ -Stats::Scalar commitNonSpecStalls; -/** Stat for the total number of branch mispredicts that caused a squash. */ -Stats::Scalar branchMispredicts; -/** Distribution of the number of committed instructions each cycle. */ -Stats::Distribution numCommittedDist; +struct CommitStats : public Stats::Group { +CommitStats(O3CPU *cpu, DefaultCommit *commit); +/** Stat for the total number of squashed instructions discarded by + * commit. + */ +Stats::Scalar commitSquashedInsts; +/** Stat for the total number of times commit has had to stall due + * to a non-speculative instruction reaching the head of the ROB. + */ +Stats::Scalar commitNonSpecStalls; +/** Stat for the total number of branch mispredicts that caused a + * squash. + */ +Stats::Scalar branchMispredicts; +/** Distribution of the number of committed instructions each cycle. */ +Stats::Distribution numCommittedDist; -/** Total number of instructions committed. */ -Stats::Vector instsCommitted; -/** Total number of ops (including micro ops) committed. */ -Stats::Vector opsCommitted; -/** Total number of software prefetches committed. */ -Stats::Vector statComSwp; -/** Stat for the total number of committed memory references. */ -Stats::Vector statComRefs; -/** Stat for the total number of committed loads. */ -Stats::Vector statComLoads; -/** Stat for the total number of committed atomics. */ -Stats::Vector statComAmos; -/** Total number of committed memory barriers. */ -Stats::Vector statComMembars; -/** Total number of committed branches. */ -Stats::Vector statComBranches; -/** Total number of vector instructions */ -Stats::Vector statComVector; -/** Total number of floating point instructions */ -Stats::Vector statComFloating; -/** Total number of integer instructions */ -Stats::Vector statComInteger; -/** Total number of function calls */ -Stats::Vector statComFunctionCalls; -/** Committed instructions by instruction type (OpClass) */ -Stats::Vector2d statCommittedInstType; +/** Total number of instructions committed. */ +Stats::Vector instsCommitted; +/** Total number of ops (including micro ops) committed. */ +Stats::Vector opsCommitted; +/** Stat for the total number of committed memory references. */ +Stats::Vector memRefs; +/** Stat for the total number of committed loads. */ +Stats::Vector loads; +/** Stat for the total number of committed atomics. */ +Stats::Vector amos; +/** Total number of committed memory barriers. */ +Stats::Vector membars; +/** Total number of committed branches. */ +Stats::Vector branches; +/** Total number of vector instructions */ +Stats::Vector vector; +/** Total number of floating point instructions */ +Stats::Vector floating; +/** Total number of integer instructions */ +Stats::Vector integer; +/** Total number of function calls */ +Stats::Vector functionCalls; +/** Committed instructions by instruction type (OpClass) */ +Stats::Vector2d committedInstType; -/** Number of cycles where the commit
[gem5-dev] Change in gem5/gem5[develop]: cpu-o3: convert commit to new style stats
Emily Brickey has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/33315 ) Change subject: cpu-o3: convert commit to new style stats .. cpu-o3: convert commit to new style stats Change-Id: I859fe753d1a2ec2da8a4209d1db122f1014af5d6 --- M src/cpu/o3/commit.hh M src/cpu/o3/commit_impl.hh M src/cpu/o3/cpu.cc 3 files changed, 116 insertions(+), 155 deletions(-) diff --git a/src/cpu/o3/commit.hh b/src/cpu/o3/commit.hh index 69d1c86..8a0105b 100644 --- a/src/cpu/o3/commit.hh +++ b/src/cpu/o3/commit.hh @@ -143,9 +143,6 @@ /** Returns the name of the DefaultCommit. */ std::string name() const; -/** Registers statistics. */ -void regStats(); - /** Registers probes. */ void regProbePoints(); @@ -473,47 +470,51 @@ /** Updates commit stats based on this instruction. */ void updateComInstStats(const DynInstPtr &inst); -/** Stat for the total number of squashed instructions discarded by commit. - */ -Stats::Scalar commitSquashedInsts; -/** Stat for the total number of times commit has had to stall due to a non- - * speculative instruction reaching the head of the ROB. - */ -Stats::Scalar commitNonSpecStalls; -/** Stat for the total number of branch mispredicts that caused a squash. */ -Stats::Scalar branchMispredicts; -/** Distribution of the number of committed instructions each cycle. */ -Stats::Distribution numCommittedDist; +struct CommitStats : public Stats::Group { +CommitStats(O3CPU *cpu, DefaultCommit *commit); +/** Stat for the total number of squashed instructions discarded by +* commit. +*/ +Stats::Scalar commitSquashedInsts; +/** Stat for the total number of times commit has had to stall due +* to a non-speculative instruction reaching the head of the ROB. +*/ +Stats::Scalar commitNonSpecStalls; +/** Stat for the total number of branch mispredicts that caused a +* squash. +*/ +Stats::Scalar branchMispredicts; +/** Distribution of the number of committed instructions each cycle. */ +Stats::Distribution numCommittedDist; -/** Total number of instructions committed. */ -Stats::Vector instsCommitted; -/** Total number of ops (including micro ops) committed. */ -Stats::Vector opsCommitted; -/** Total number of software prefetches committed. */ -Stats::Vector statComSwp; -/** Stat for the total number of committed memory references. */ -Stats::Vector statComRefs; -/** Stat for the total number of committed loads. */ -Stats::Vector statComLoads; -/** Stat for the total number of committed atomics. */ -Stats::Vector statComAmos; -/** Total number of committed memory barriers. */ -Stats::Vector statComMembars; -/** Total number of committed branches. */ -Stats::Vector statComBranches; -/** Total number of vector instructions */ -Stats::Vector statComVector; -/** Total number of floating point instructions */ -Stats::Vector statComFloating; -/** Total number of integer instructions */ -Stats::Vector statComInteger; -/** Total number of function calls */ -Stats::Vector statComFunctionCalls; -/** Committed instructions by instruction type (OpClass) */ -Stats::Vector2d statCommittedInstType; +/** Total number of instructions committed. */ +Stats::Vector instsCommitted; +/** Total number of ops (including micro ops) committed. */ +Stats::Vector opsCommitted; +/** Stat for the total number of committed memory references. */ +Stats::Vector comRefs; +/** Stat for the total number of committed loads. */ +Stats::Vector comLoads; +/** Stat for the total number of committed atomics. */ +Stats::Vector comAmos; +/** Total number of committed memory barriers. */ +Stats::Vector comMembars; +/** Total number of committed branches. */ +Stats::Vector comBranches; +/** Total number of vector instructions */ +Stats::Vector comVector; +/** Total number of floating point instructions */ +Stats::Vector comFloating; +/** Total number of integer instructions */ +Stats::Vector comInteger; +/** Total number of function calls */ +Stats::Vector comFunctionCalls; +/** Committed instructions by instruction type (OpClass) */ +Stats::Vector2d committedInstType; -/** Number of cycles where the commit bandwidth limit is reached. */ -Stats::Scalar commitEligibleSamples; +/** Number of cycles where the commit bandwidth limit is reached. */ +Stats::Scalar commitEligibleSamples; +} stats; }; #endif // __CPU_O3_COMMIT_HH__ diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index c17048