From: Gabe Black Date: Mon, 14 Oct 2019 22:59:42 +0000 (-0700) Subject: cpu: Get rid of the serviceInstCountEvents method. X-Git-Tag: v19.0.0.0~397 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=44831fabfb74993a2222a67f55c9f21d7843cbdb;p=gem5.git cpu: Get rid of the serviceInstCountEvents method. This was useful when transitioning away from the CPU based comInstEventQueue, but now that objects backing the ThreadContexts have access to the underlying comInstEventQueue and can manipulate it directly, they don't need to do so through a generic interface. Getting rid of this function narrows and simplifies the interface. Change-Id: I202d466d266551675ef6792d38c658d8a8f1cb8b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22113 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro --- diff --git a/src/arch/arm/fastmodel/iris/thread_context.hh b/src/arch/arm/fastmodel/iris/thread_context.hh index 73470c5b2..ef5214333 100644 --- a/src/arch/arm/fastmodel/iris/thread_context.hh +++ b/src/arch/arm/fastmodel/iris/thread_context.hh @@ -97,7 +97,6 @@ class ThreadContext : public ::ThreadContext bool remove(PCEvent *e) override { return false; } Tick nextInstEventCount() override { return MaxTick; } - void serviceInstCountEvents(Tick count) override {} void scheduleInstCountEvent(Event *event, Tick count) override {} void descheduleInstCountEvent(Event *event) override {} Tick getCurrentInstCount() override; diff --git a/src/cpu/checker/thread_context.hh b/src/cpu/checker/thread_context.hh index e45de6e6e..d32e0fa70 100644 --- a/src/cpu/checker/thread_context.hh +++ b/src/cpu/checker/thread_context.hh @@ -98,11 +98,6 @@ class CheckerThreadContext : public ThreadContext return actualTC->nextInstEventCount(); } void - serviceInstCountEvents(Tick count) override - { - actualTC->serviceInstCountEvents(count); - } - void scheduleInstCountEvent(Event *event, Tick count) override { actualTC->scheduleInstCountEvent(event, count); diff --git a/src/cpu/kvm/base.cc b/src/cpu/kvm/base.cc index da3e87ee4..2522eeeb2 100644 --- a/src/cpu/kvm/base.cc +++ b/src/cpu/kvm/base.cc @@ -686,7 +686,7 @@ BaseKvmCPU::tick() // Service any pending instruction events. The vCPU should // have exited in time for the event using the instruction // counter configured by setupInstStop(). - tc->serviceInstCountEvents(ctrInsts); + thread->comInstEventQueue.serviceEvents(ctrInsts); if (tryDrain()) _status = Idle; diff --git a/src/cpu/minor/execute.cc b/src/cpu/minor/execute.cc index 0e83db3cb..c9970b39a 100644 --- a/src/cpu/minor/execute.cc +++ b/src/cpu/minor/execute.cc @@ -870,8 +870,7 @@ Execute::doInstCommitAccounting(MinorDynInstPtr inst) cpu.system->totalNumInsts++; /* Act on events related to instruction counts */ - cpu.getContext(inst->id.threadId)-> - serviceInstCountEvents(thread->numInst); + thread->comInstEventQueue.serviceEvents(thread->numInst); } thread->numOp++; thread->numOps++; diff --git a/src/cpu/o3/cpu.cc b/src/cpu/o3/cpu.cc index bb3f0c301..c843db3a0 100644 --- a/src/cpu/o3/cpu.cc +++ b/src/cpu/o3/cpu.cc @@ -1521,7 +1521,7 @@ FullO3CPU::instDone(ThreadID tid, const DynInstPtr &inst) system->totalNumInsts++; // Check for instruction-count-based events. - thread[tid]->tc->serviceInstCountEvents(thread[tid]->numInst); + thread[tid]->comInstEventQueue.serviceEvents(thread[tid]->numInst); } thread[tid]->numOp++; thread[tid]->numOps++; diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index e195935c6..65496429b 100644 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -93,11 +93,6 @@ class O3ThreadContext : public ThreadContext MaxTick : thread->comInstEventQueue.nextTick(); } void - serviceInstCountEvents(Tick count) override - { - thread->comInstEventQueue.serviceEvents(count); - } - void scheduleInstCountEvent(Event *event, Tick count) override { thread->comInstEventQueue.schedule(event, count); diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc index f45165b9e..3000fae53 100644 --- a/src/cpu/simple/base.cc +++ b/src/cpu/simple/base.cc @@ -500,7 +500,7 @@ BaseSimpleCPU::preExecute() t_info.setMemAccPredicate(true); // check for instruction-count-based events - thread->getTC()->serviceInstCountEvents(t_info.numInst); + thread->comInstEventQueue.serviceEvents(t_info.numInst); // decode the instruction inst = gtoh(inst); diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index 5ed0f2982..367eceab3 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -205,11 +205,6 @@ class SimpleThread : public ThreadState, public ThreadContext MaxTick : comInstEventQueue.nextTick(); } void - serviceInstCountEvents(Tick count) override - { - comInstEventQueue.serviceEvents(count); - } - void scheduleInstCountEvent(Event *event, Tick count) override { comInstEventQueue.schedule(event, count); diff --git a/src/cpu/thread_context.hh b/src/cpu/thread_context.hh index 16310649c..2e1b572e6 100644 --- a/src/cpu/thread_context.hh +++ b/src/cpu/thread_context.hh @@ -193,7 +193,6 @@ class ThreadContext : public PCEventScope virtual EndQuiesceEvent *getQuiesceEvent() = 0; virtual Tick nextInstEventCount() = 0; - virtual void serviceInstCountEvents(Tick count) = 0; virtual void scheduleInstCountEvent(Event *event, Tick count) = 0; virtual void descheduleInstCountEvent(Event *event) = 0; virtual Tick getCurrentInstCount() = 0;