gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: cpu: Remove duplicated fetch stats

BB
Bobby Bruce (Gerrit)
Mon, May 8, 2023 7:09 PM

Bobby Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/69105?usp=email )

Change subject: cpu: Remove duplicated fetch stats
......................................................................

cpu: Remove duplicated fetch stats

This removes numFetchSuspends and duplicates numBranches calls
so we only have the updated fetch stats outputting.

Change-Id: Ia7a6830ee947f5c67386dd1e6e3db1744a7ee43c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69105
Reviewed-by: Bobby Bruce bbruce@ucdavis.edu
Maintainer: Bobby Bruce bbruce@ucdavis.edu
Tested-by: kokoro noreply+kokoro@google.com

M src/cpu/minor/execute.cc
M src/cpu/minor/stats.cc
M src/cpu/minor/stats.hh
M src/cpu/simple/base.cc
M src/cpu/simple/exec_context.hh
5 files changed, 0 insertions(+), 16 deletions(-)

Approvals:
Bobby Bruce: Looks good to me, approved; Looks good to me, approved
kokoro: Regressions pass

diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc
index a65a77e..0d704c7 100644
--- a/src/cpu/minor/execute.cc
+++ b/src/cpu/minor/execute.cc
@@ -1062,8 +1062,6 @@
DPRINTF(MinorInterrupt, "Suspending thread: %d from Execute"
" inst: %s\n", thread_id, *inst);

  •        // output both old and new stats
    
  •        cpu.stats.numFetchSuspends++;
            cpu.fetchStats[thread_id]->numFetchSuspends++;
    
            updateBranchData(thread_id, BranchData::SuspendThread, inst,
    

diff --git a/src/cpu/minor/stats.cc b/src/cpu/minor/stats.cc
index 64d4c47..e9ca562 100644
--- a/src/cpu/minor/stats.cc
+++ b/src/cpu/minor/stats.cc
@@ -52,8 +52,6 @@
ADD_STAT(numDiscardedOps, statistics::units::Count::get(),
"Number of ops (including micro ops) which were discarded
before "
"commit"),

  • ADD_STAT(numFetchSuspends, statistics::units::Count::get(),
  •         "Number of times Execute suspended instruction fetching"),
    ADD_STAT(quiesceCycles, statistics::units::Cycle::get(),
             "Total number of cycles that CPU has spent quiesced or  
    

waiting "
"for an interrupt"),
diff --git a/src/cpu/minor/stats.hh b/src/cpu/minor/stats.hh
index 1ab81f4..524d20f 100644
--- a/src/cpu/minor/stats.hh
+++ b/src/cpu/minor/stats.hh
@@ -68,9 +68,6 @@
/** Number of ops discarded before committing */
statistics::Scalar numDiscardedOps;

  • /** Number of times fetch was asked to suspend by Execute */
  • statistics::Scalar numFetchSuspends;
  • /** Number of cycles in quiescent state */
    statistics::Scalar quiesceCycles;
    

diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 9e831a2..4f26654 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -431,8 +431,6 @@
}

  if (curStaticInst->isControl()) {
  •    // output both old and new stats
    
  •    ++t_info.execContextStats.numBranches;
        ++fetchStats[t_info.thread->threadId()]->numBranches;
    }
    

diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh
index 31aa5d4..3b6593d 100644
--- a/src/cpu/simple/exec_context.hh
+++ b/src/cpu/simple/exec_context.hh
@@ -152,8 +152,6 @@
"ICache total stall cycles"),
ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(),
"DCache total stall cycles"),

  •          ADD_STAT(numBranches, statistics::units::Count::get(),
    
  •                   "Number of branches fetched"),
              ADD_STAT(numPredictedBranches,  
    

statistics::units::Count::get(),
"Number of branches predicted as taken"),
ADD_STAT(numBranchMispred, statistics::units::Count::get(),
@@ -204,9 +202,6 @@
numIdleCycles = idleFraction * cpu->baseStats.numCycles;
numBusyCycles = notIdleFraction * cpu->baseStats.numCycles;

  •        numBranches
    
  •            .prereq(numBranches);
    
  •         numPredictedBranches
                .prereq(numPredictedBranches);
    

@@ -298,8 +293,6 @@
statistics::Scalar dcacheStallCycles;

      /// @{
  •    /// Total number of branches fetched
    
  •    statistics::Scalar numBranches;
        /// Number of branches predicted as taken
        statistics::Scalar numPredictedBranches;
        /// Number of misprediced branches
    

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69105?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia7a6830ee947f5c67386dd1e6e3db1744a7ee43c
Gerrit-Change-Number: 69105
Gerrit-PatchSet: 11
Gerrit-Owner: Melissa Jost melissakjost@gmail.com
Gerrit-Reviewer: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Gabe Black gabe.black@gmail.com
Gerrit-Reviewer: Jason Lowe-Power jason@lowepower.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com

Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/69105?usp=email ) Change subject: cpu: Remove duplicated fetch stats ...................................................................... cpu: Remove duplicated fetch stats This removes numFetchSuspends and duplicates numBranches calls so we only have the updated fetch stats outputting. Change-Id: Ia7a6830ee947f5c67386dd1e6e3db1744a7ee43c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69105 Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> --- M src/cpu/minor/execute.cc M src/cpu/minor/stats.cc M src/cpu/minor/stats.hh M src/cpu/simple/base.cc M src/cpu/simple/exec_context.hh 5 files changed, 0 insertions(+), 16 deletions(-) Approvals: Bobby Bruce: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc index a65a77e..0d704c7 100644 --- a/src/cpu/minor/execute.cc +++ b/src/cpu/minor/execute.cc @@ -1062,8 +1062,6 @@ DPRINTF(MinorInterrupt, "Suspending thread: %d from Execute" " inst: %s\n", thread_id, *inst); - // output both old and new stats - cpu.stats.numFetchSuspends++; cpu.fetchStats[thread_id]->numFetchSuspends++; updateBranchData(thread_id, BranchData::SuspendThread, inst, diff --git a/src/cpu/minor/stats.cc b/src/cpu/minor/stats.cc index 64d4c47..e9ca562 100644 --- a/src/cpu/minor/stats.cc +++ b/src/cpu/minor/stats.cc @@ -52,8 +52,6 @@ ADD_STAT(numDiscardedOps, statistics::units::Count::get(), "Number of ops (including micro ops) which were discarded before " "commit"), - ADD_STAT(numFetchSuspends, statistics::units::Count::get(), - "Number of times Execute suspended instruction fetching"), ADD_STAT(quiesceCycles, statistics::units::Cycle::get(), "Total number of cycles that CPU has spent quiesced or waiting " "for an interrupt"), diff --git a/src/cpu/minor/stats.hh b/src/cpu/minor/stats.hh index 1ab81f4..524d20f 100644 --- a/src/cpu/minor/stats.hh +++ b/src/cpu/minor/stats.hh @@ -68,9 +68,6 @@ /** Number of ops discarded before committing */ statistics::Scalar numDiscardedOps; - /** Number of times fetch was asked to suspend by Execute */ - statistics::Scalar numFetchSuspends; - /** Number of cycles in quiescent state */ statistics::Scalar quiesceCycles; diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 9e831a2..4f26654 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -431,8 +431,6 @@ } if (curStaticInst->isControl()) { - // output both old and new stats - ++t_info.execContextStats.numBranches; ++fetchStats[t_info.thread->threadId()]->numBranches; } diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index 31aa5d4..3b6593d 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -152,8 +152,6 @@ "ICache total stall cycles"), ADD_STAT(dcacheStallCycles, statistics::units::Cycle::get(), "DCache total stall cycles"), - ADD_STAT(numBranches, statistics::units::Count::get(), - "Number of branches fetched"), ADD_STAT(numPredictedBranches, statistics::units::Count::get(), "Number of branches predicted as taken"), ADD_STAT(numBranchMispred, statistics::units::Count::get(), @@ -204,9 +202,6 @@ numIdleCycles = idleFraction * cpu->baseStats.numCycles; numBusyCycles = notIdleFraction * cpu->baseStats.numCycles; - numBranches - .prereq(numBranches); - numPredictedBranches .prereq(numPredictedBranches); @@ -298,8 +293,6 @@ statistics::Scalar dcacheStallCycles; /// @{ - /// Total number of branches fetched - statistics::Scalar numBranches; /// Number of branches predicted as taken statistics::Scalar numPredictedBranches; /// Number of misprediced branches -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69105?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ia7a6830ee947f5c67386dd1e6e3db1744a7ee43c Gerrit-Change-Number: 69105 Gerrit-PatchSet: 11 Gerrit-Owner: Melissa Jost <melissakjost@gmail.com> Gerrit-Reviewer: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-Reviewer: Gabe Black <gabe.black@gmail.com> Gerrit-Reviewer: Jason Lowe-Power <jason@lowepower.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com>