cpu: Get rid of the serviceInstCountEvents method.
authorGabe Black <gabeblack@google.com>
Mon, 14 Oct 2019 22:59:42 +0000 (15:59 -0700)
committerGabe Black <gabeblack@google.com>
Fri, 25 Oct 2019 22:42:31 +0000 (22:42 +0000)
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 <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/fastmodel/iris/thread_context.hh
src/cpu/checker/thread_context.hh
src/cpu/kvm/base.cc
src/cpu/minor/execute.cc
src/cpu/o3/cpu.cc
src/cpu/o3/thread_context.hh
src/cpu/simple/base.cc
src/cpu/simple_thread.hh
src/cpu/thread_context.hh

index 73470c5b2eb932deba7e0ae4a77e2d1a86bc27ee..ef52143337de4842c0eb6b9c9847bc9ead7f3339 100644 (file)
@@ -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;
index e45de6e6eaad7fcbef9c2dbe698d71e48f4e5bd2..d32e0fa703c8c1dba385dafdb7cbb53057b31704 100644 (file)
@@ -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);
index da3e87ee422d8f3497a920f8e4d44e49c1d7e271..2522eeeb2795dfb98481e707c6e5ab0231c0411b 100644 (file)
@@ -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;
index 0e83db3cb2f4ce05b47d34744afe57bb821f64bf..c9970b39a4ad509c8be54e4e0eaf9d1ca4729f93 100644 (file)
@@ -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++;
index bb3f0c30153f92a697c978cb434eb885586f6cfc..c843db3a015aae392557fe2646f30c4501feb365 100644 (file)
@@ -1521,7 +1521,7 @@ FullO3CPU<Impl>::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++;
index e195935c680bb8d449f8028fcd978cc2cd5a54fe..65496429b7657283ff8a6678bee42583b28384d2 100644 (file)
@@ -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);
index f45165b9ebb282bec189cdf33a1cd5b411fcb0b2..3000fae530b78b3adbff55d3e7b55c4e44802559 100644 (file)
@@ -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);
index 5ed0f2982ab6370feb0a26d5cc91180770642aab..367eceab3e06655d113c987ee240e7a14ce2e40b 100644 (file)
@@ -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);
index 16310649cee72731bb02835afc8e7937105df02d..2e1b572e6acc98838340b87b2aef31dd2c3bd619 100644 (file)
@@ -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;