Also delete the CPU interface.
Change-Id: I62a6b0a9a303d672f4083bdedf393f9f6d07331f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22109
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
void
BaseRemoteGDB::scheduleInstCommitEvent(Event *ev, int delta)
{
- auto *cpu = tc->getCpuPtr();
// Here "ticks" aren't simulator ticks which measure time, they're
// instructions committed by the CPU.
- cpu->scheduleInstCountEvent(tc->threadId(), ev,
- cpu->getCurrentInstCount(tc->threadId()) + delta);
+ tc->scheduleInstCountEvent(ev, tc->getCurrentInstCount() + delta);
}
void
BaseRemoteGDB::descheduleInstCommitEvent(Event *ev)
{
if (ev->scheduled())
- tc->getCpuPtr()->descheduleInstCountEvent(tc->threadId(), ev);
+ tc->descheduleInstCountEvent(ev);
}
std::map<char, BaseRemoteGDB::GdbCommand> BaseRemoteGDB::command_map = {
*counter = numThreads;
for (ThreadID tid = 0; tid < numThreads; ++tid) {
Event *event = new CountedExitEvent(cause, *counter);
- scheduleInstCountEvent(
- tid, event, params()->max_insts_all_threads);
+ threadContexts[tid]->scheduleInstCountEvent(
+ event, params()->max_insts_all_threads);
}
}
const Tick now(getCurrentInstCount(tid));
Event *event(new LocalSimLoopExitEvent(cause, 0));
- scheduleInstCountEvent(tid, event, now + insts);
+ threadContexts[tid]->scheduleInstCountEvent(event, now + insts);
}
Tick
*/
uint64_t getCurrentInstCount(ThreadID tid);
- Tick
- nextInstEventCount(ThreadID tid)
- {
- return threadContexts[tid]->nextInstEventCount();
- }
-
- void
- serviceInstCountEvents(ThreadID tid, Tick count)
- {
- threadContexts[tid]->serviceInstCountEvents(count);
- }
-
- void
- scheduleInstCountEvent(ThreadID tid, Event *event, Tick count)
- {
- threadContexts[tid]->scheduleInstCountEvent(event, count);
- }
-
- void
- descheduleInstCountEvent(ThreadID tid, Event *event)
- {
- threadContexts[tid]->descheduleInstCountEvent(event);
- }
-
public:
/**
* @{
case RunningServiceCompletion:
case Running: {
- const uint64_t nextInstEvent(nextInstEventCount(0));
+ const uint64_t nextInstEvent(tc->nextInstEventCount());
// Enter into KVM and complete pending IO instructions if we
// have an instruction event pending.
const Tick ticksToExecute(
// Service any pending instruction events. The vCPU should
// have exited in time for the event using the instruction
// counter configured by setupInstStop().
- serviceInstCountEvents(0, ctrInsts);
+ tc->serviceInstCountEvents(ctrInsts);
if (tryDrain())
_status = Idle;
void
BaseKvmCPU::setupInstStop()
{
- Tick next = nextInstEventCount(0);
+ Tick next = tc->nextInstEventCount();
if (next == MaxTick) {
setupInstCounter(0);
} else {
cpu.system->totalNumInsts++;
/* Act on events related to instruction counts */
- cpu.serviceInstCountEvents(inst->id.threadId, thread->numInst);
+ cpu.getContext(inst->id.threadId)->
+ serviceInstCountEvents(thread->numInst);
}
thread->numOp++;
thread->numOps++;
system->totalNumInsts++;
// Check for instruction-count-based events.
- serviceInstCountEvents(tid, thread[tid]->numInst);
+ thread[tid]->tc->serviceInstCountEvents(thread[tid]->numInst);
}
thread[tid]->numOp++;
thread[tid]->numOps++;
} else {
// Schedule an event to register all elastic trace probes when
// specified no. of instructions are committed.
- cpu->scheduleInstCountEvent(
- 0, ®EtraceListenersEvent, startTraceInst);
+ cpu->getContext(0)->scheduleInstCountEvent(
+ ®EtraceListenersEvent, startTraceInst);
}
}
t_info.setMemAccPredicate(true);
// check for instruction-count-based events
- serviceInstCountEvents(curThread, t_info.numInst);
+ thread->getTC()->serviceInstCountEvents(t_info.numInst);
// decode the instruction
inst = gtoh(inst);