cpu, sim: Remove unused System::totalNumInst
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Fri, 7 Feb 2020 16:50:22 +0000 (16:50 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 3 Dec 2020 09:41:37 +0000 (09:41 +0000)
This counter gets augmented for every executed instruction but it
is not used. It is also overlapping with the

BaseCPU::numSimulatedInsts

A client willing to know the number of simulated instruction should rely
on the interface above.

Change-Id: Ic5c805ac3b2e87bbacb365108d4060f53e044b4e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25305
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/cpu/kvm/base.cc
src/cpu/minor/execute.cc
src/cpu/o3/cpu.cc
src/cpu/simple/base.cc
src/cpu/simple/timing.cc
src/sim/system.cc
src/sim/system.hh

index cb0b4bb0d506cb433113dcec1c667a3b5433d9aa..b364d4f29d471bd27c6d0266c0994d0c543d402a 100644 (file)
@@ -766,7 +766,6 @@ BaseKvmCPU::kvmRun(Tick ticks)
         baseStats.numCycles += simCyclesExecuted;;
         stats.committedInsts += instsExecuted;
         ctrInsts += instsExecuted;
-        system->totalNumInsts += instsExecuted;
 
         DPRINTF(KvmRun,
                 "KVM: Executed %i instructions in %i cycles "
index 52708abbe6d9ba50a7e59ed02dc3a4798e62348c..3eb7811417f5dde5fe677a2d7953864c3a1cf0d6 100644 (file)
@@ -866,7 +866,6 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst)
         thread->numInst++;
         thread->threadStats.numInsts++;
         cpu.stats.numInsts++;
-        cpu.system->totalNumInsts++;
 
         /* Act on events related to instruction counts */
         thread->comInstEventQueue.serviceEvents(thread->numInst);
index c67ee64b448f262655a43c5ac222297100d756c7..c910cc4870bf665339c4eee48c6ef8f0425ba9d2 100644 (file)
@@ -1474,7 +1474,6 @@ FullO3CPU<Impl>::instDone(ThreadID tid, const DynInstPtr &inst)
         thread[tid]->numInst++;
         thread[tid]->threadStats.numInsts++;
         cpuStats.committedInsts[tid]++;
-        system->totalNumInsts++;
 
         // Check for instruction-count-based events.
         thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst);
index dc58e0acabcf21131708b609c293bc37341ef3e2..7f4797b624fe345ea2c56e0a035c084c2ca65102 100644 (file)
@@ -166,7 +166,6 @@ BaseSimpleCPU::countInst()
         t_info.numInst++;
         t_info.execContextStats.numInsts++;
 
-        system->totalNumInsts++;
         t_info.thread->funcExeInst++;
     }
     t_info.numOp++;
index 5e9eb92d7a314b6c99a3b92807c849de4fed339f..0fd83cae5d27e7673e88360bf7c776ae7b511e60 100644 (file)
@@ -148,8 +148,6 @@ TimingSimpleCPU::drainResume()
 
     // Reschedule any power gating event (if any)
     schedulePowerGatingEvent();
-
-    system->totalNumInsts = 0;
 }
 
 bool
index d31238c348c86f2c7be71fe23f069f5b3e3a5720..de4744a5f962b0f52adb6d3c071c87aea9a0c507 100644 (file)
@@ -229,7 +229,6 @@ System::System(const Params &p)
       _m5opRange(p.m5ops_base ?
                  RangeSize(p.m5ops_base, 0x10000) :
                  AddrRange(1, 0)), // Create an empty range if disabled
-      totalNumInsts(0),
       redirectPaths(p.redirect_paths)
 {
     if (workload)
@@ -439,12 +438,6 @@ System::getDeviceMemory(RequestorID id) const
     return deviceMemMap.at(id);
 }
 
-void
-System::drainResume()
-{
-    totalNumInsts = 0;
-}
-
 void
 System::serialize(CheckpointOut &cp) const
 {
index 4954af68f44e0664d6894a0d8bfb6e96a719db8e..ce77f0ad27dd0761348928d62472b3c9dbb2ff27 100644 (file)
@@ -592,10 +592,7 @@ class System : public SimObject, public PCEventScope
     void serialize(CheckpointOut &cp) const override;
     void unserialize(CheckpointIn &cp) override;
 
-    void drainResume() override;
-
   public:
-    Counter totalNumInsts;
     std::map<std::pair<uint32_t,uint32_t>, Tick>  lastWorkItemStarted;
     std::map<uint32_t, Stats::Histogram*> workItemStats;