diff options
author | Gabe Black <gabeblack@google.com> | 2019-10-13 23:40:04 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2019-10-25 22:42:31 +0000 |
commit | 272a43175fc0de46ba1e264b3b1add5ea01d7e5d (patch) | |
tree | 8e46034aa4c25d387bd6e2d3d480d4d00bebb768 /src/cpu/simple_thread.hh | |
parent | a2a8dac5c2a26e91432415f409b55f04cff9c2e4 (diff) | |
download | gem5-272a43175fc0de46ba1e264b3b1add5ea01d7e5d.tar.xz |
cpu: Switch off of the CPU's comInstEventQueue.
This switches to letting the ThreadContexts use a thread based/local
comInstEventQueue instead of falling back to the CPU's array. Because
the implementation is no longer shared and it's not given where the
comInstEventQueue (or other implementation) should be accessed, the
default implementation has been removed.
Also, because nobody is using the CPU's array of event queues, those
have been removed.
Change-Id: I515e6e00a2174067a928c33ef832bc5c840bdf7f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22110
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/cpu/simple_thread.hh')
-rw-r--r-- | src/cpu/simple_thread.hh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index 86d31b235..5ed0f2982 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -127,6 +127,11 @@ class SimpleThread : public ThreadState, public ThreadContext } PCEventQueue pcEventQueue; + /** + * An instruction-based event queue. Used for scheduling events based on + * number of instructions committed. + */ + EventQueue comInstEventQueue; System *system; @@ -193,6 +198,33 @@ class SimpleThread : public ThreadState, public ThreadContext bool schedule(PCEvent *e) override { return pcEventQueue.schedule(e); } bool remove(PCEvent *e) override { return pcEventQueue.remove(e); } + Tick + nextInstEventCount() override + { + return comInstEventQueue.empty() ? + MaxTick : comInstEventQueue.nextTick(); + } + void + serviceInstCountEvents(Tick count) override + { + comInstEventQueue.serviceEvents(count); + } + void + scheduleInstCountEvent(Event *event, Tick count) override + { + comInstEventQueue.schedule(event, count); + } + void + descheduleInstCountEvent(Event *event) override + { + comInstEventQueue.deschedule(event); + } + Tick + getCurrentInstCount() override + { + return comInstEventQueue.getCurTick(); + } + BaseCPU *getCpuPtr() override { return baseCpu; } int cpuId() const override { return ThreadState::cpuId(); } |