sim,cpu: Get rid of the unused instEventQueue.
authorGabe Black <gabeblack@google.com>
Mon, 14 Oct 2019 04:43:36 +0000 (21:43 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 15 Oct 2019 01:40:19 +0000 (01:40 +0000)
This queue was set up to allow triggering events based on the total
number of instructions executed at the system level, and was added in
a change which added a number of things to support McPAT. No code
checked into gem5 actually schedules an event on that queue, and no
code in McPAT (which seems to have gone dormant) either downloadable
from github or found in ext modify gem5 in a way that makes it use
the instEventQueue.

Also, the KVM CPU does not interact with the instEventQueue correctly.
While it does check the per-thread instruction event queue when
deciding how long to run, it does not check the instEventQueue. It will
poke it to run events when it stops for other reasons, but it may (and
likely will) have run beyond the point where it was supposed to stop.

Since this queue doesn't seem to actually be used for anything, isn't
being used properly in all cases anyway, and adds overhead to all the
CPU models, this change eliminates it.

Change-Id: I0e126df14788c37a6d58ca9e1bb2686b70e60d88
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21783
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Tiago Mück <tiago.muck@arm.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/sim/system.cc
src/sim/system.hh

index 77cf277a68d6e9bafbd81fd6e217f3ea9ca6c491..0b388897623aa5535fcf93084b223251692d934a 100644 (file)
@@ -689,7 +689,6 @@ BaseKvmCPU::tick()
           // have exited in time for the event using the instruction
           // counter configured by setupInstStop().
           comInstEventQueue[0]->serviceEvents(ctrInsts);
-          system->instEventQueue.serviceEvents(system->totalNumInsts);
 
           if (tryDrain())
               _status = Idle;
index c7fda489e47187b6db8899471e079e58d0830ae5..dc798661655d12b1ad8a3bfbc658025e65452aa5 100644 (file)
@@ -871,7 +871,6 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst)
 
         /* Act on events related to instruction counts */
         cpu.comInstEventQueue[inst->id.threadId]->serviceEvents(thread->numInst);
-        cpu.system->instEventQueue.serviceEvents(cpu.system->totalNumInsts);
     }
     thread->numOp++;
     thread->numOps++;
index 1353c1ed4b7cb2e7400dd5bdfbf48b5adeb0e9d9..5871e65840be1f4b07966a97090f24766ae28cf2 100644 (file)
@@ -1522,7 +1522,6 @@ FullO3CPU<Impl>::instDone(ThreadID tid, const DynInstPtr &inst)
 
         // Check for instruction-count-based events.
         comInstEventQueue[tid]->serviceEvents(thread[tid]->numInst);
-        system->instEventQueue.serviceEvents(system->totalNumInsts);
     }
     thread[tid]->numOp++;
     thread[tid]->numOps++;
index 816add707bef31eb977e66f4cb7c2ed86d3f4f8d..b93ae091281d6763b34cd50f4b2c3805640f059f 100644 (file)
@@ -500,7 +500,6 @@ BaseSimpleCPU::preExecute()
 
     // check for instruction-count-based events
     comInstEventQueue[curThread]->serviceEvents(t_info.numInst);
-    system->instEventQueue.serviceEvents(system->totalNumInsts);
 
     // decode the instruction
     inst = gtoh(inst);
index 87a220311a9c6cb0d44a039a900f0cb1fe9e9cc3..3868f57b83cc15a61c5506dcf761835ba13d225c 100644 (file)
@@ -112,7 +112,6 @@ System::System(Params *p)
       thermalModel(p->thermal_model),
       _params(p),
       totalNumInsts(0),
-      instEventQueue("system instruction-based event queue"),
       redirectPaths(p->redirect_paths)
 {
 
index 345d83c2a6bab88f3b6799d38b31545ed95b858e..852bc21a2083d52901224ae64eeb89ad87e5351a 100644 (file)
@@ -605,7 +605,6 @@ class System : public SimObject
 
   public:
     Counter totalNumInsts;
-    EventQueue instEventQueue;
     std::map<std::pair<uint32_t,uint32_t>, Tick>  lastWorkItemStarted;
     std::map<uint32_t, Stats::Histogram*> workItemStats;