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 <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-10-14 15:59:42 -07:00
parent bdfeefa4a8
commit 44831fabfb
9 changed files with 4 additions and 22 deletions

View 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;

View 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);

View 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;

View 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++;

View 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++;

View 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);

View 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);

View 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);

View 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;