From: Gabe Black Date: Mon, 14 Oct 2019 04:43:36 +0000 (-0700) Subject: sim,cpu: Get rid of the unused instEventQueue. X-Git-Tag: v19.0.0.0~447 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f1efb84a33d737175ed66e977239fbebc06ca82;p=gem5.git sim,cpu: Get rid of the unused instEventQueue. 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 Reviewed-by: Jason Lowe-Power Reviewed-by: Tiago Mück Tested-by: kokoro --- diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index 77cf277a6..0b3888976 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -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; diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc index c7fda489e..dc7986616 100644 --- a/src/cpu/minor/execute.cc +++ b/src/cpu/minor/execute.cc @@ -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++; diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index 1353c1ed4..5871e6584 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1522,7 +1522,6 @@ FullO3CPU::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++; diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index 816add707..b93ae0912 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -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); diff --git a/src/sim/system.cc b/src/sim/system.cc index 87a220311..3868f57b8 100644 --- a/src/sim/system.cc +++ b/src/sim/system.cc @@ -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) { diff --git a/src/sim/system.hh b/src/sim/system.hh index 345d83c2a..852bc21a2 100644 --- a/src/sim/system.hh +++ b/src/sim/system.hh @@ -605,7 +605,6 @@ class System : public SimObject public: Counter totalNumInsts; - EventQueue instEventQueue; std::map, Tick> lastWorkItemStarted; std::map workItemStats;