cpu: Make accesses to comInstEventQueue indirect through methods.

This lets us move the event queue itself around, or change how those
services are provided.

Change-Id: Ie36665b353cf9788968f253cf281a854a6eff4f4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22107
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2019-10-13 22:02:35 -07:00
parent fea2af5b9c
commit c73c19effd
8 changed files with 43 additions and 26 deletions

View File

@@ -191,7 +191,7 @@ BaseCPU::BaseCPU(Params *p, bool is_checker)
*counter = numThreads;
for (ThreadID tid = 0; tid < numThreads; ++tid) {
Event *event = new CountedExitEvent(cause, *counter);
comInstEventQueue[tid]->schedule(event, p->max_insts_all_threads);
scheduleInstCountEvent(tid, event, p->max_insts_all_threads);
}
}
@@ -726,16 +726,16 @@ BaseCPU::unserialize(CheckpointIn &cp)
void
BaseCPU::scheduleInstStop(ThreadID tid, Counter insts, const char *cause)
{
const Tick now(comInstEventQueue[tid]->getCurTick());
const Tick now(getCurrentInstCount(tid));
Event *event(new LocalSimLoopExitEvent(cause, 0));
comInstEventQueue[tid]->schedule(event, now + insts);
scheduleInstCountEvent(tid, event, now + insts);
}
uint64_t
Tick
BaseCPU::getCurrentInstCount(ThreadID tid)
{
return Tick(comInstEventQueue[tid]->getCurTick());
return comInstEventQueue[tid]->getCurTick();
}
AddressMonitor::AddressMonitor() {