summaryrefslogtreecommitdiff
path: root/src/cpu/o3
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-10-13 23:40:04 -0700
committerGabe Black <gabeblack@google.com>2019-10-25 22:42:31 +0000
commit272a43175fc0de46ba1e264b3b1add5ea01d7e5d (patch)
tree8e46034aa4c25d387bd6e2d3d480d4d00bebb768 /src/cpu/o3
parenta2a8dac5c2a26e91432415f409b55f04cff9c2e4 (diff)
downloadgem5-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/o3')
-rw-r--r--src/cpu/o3/thread_context.hh27
-rw-r--r--src/cpu/o3/thread_state.hh11
2 files changed, 35 insertions, 3 deletions
diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh
index 2ec559f2d..e195935c6 100644
--- a/src/cpu/o3/thread_context.hh
+++ b/src/cpu/o3/thread_context.hh
@@ -86,6 +86,33 @@ class O3ThreadContext : public ThreadContext
return thread->pcEventQueue.remove(e);
}
+ Tick
+ nextInstEventCount() override
+ {
+ return thread->comInstEventQueue.empty() ?
+ 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);
+ }
+ void
+ descheduleInstCountEvent(Event *event) override
+ {
+ thread->comInstEventQueue.deschedule(event);
+ }
+ Tick
+ getCurrentInstCount() override
+ {
+ return thread->comInstEventQueue.getCurTick();
+ }
+
/** Pointer to the thread state that this TC corrseponds to. */
O3ThreadState<Impl> *thread;
diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh
index b2c9296f4..a4a12330f 100644
--- a/src/cpu/o3/thread_state.hh
+++ b/src/cpu/o3/thread_state.hh
@@ -75,6 +75,11 @@ struct O3ThreadState : public ThreadState {
public:
PCEventQueue pcEventQueue;
+ /**
+ * An instruction-based event queue. Used for scheduling events based on
+ * number of instructions committed.
+ */
+ EventQueue comInstEventQueue;
/* This variable controls if writes to a thread context should cause a all
* dynamic/speculative state to be thrown away. Nominally this is the
@@ -92,9 +97,9 @@ struct O3ThreadState : public ThreadState {
bool trapPending;
O3ThreadState(O3CPU *_cpu, int _thread_num, Process *_process)
- : ThreadState(_cpu, _thread_num, _process),
- cpu(_cpu), noSquashFromTC(false), trapPending(false),
- tc(nullptr)
+ : ThreadState(_cpu, _thread_num, _process), cpu(_cpu),
+ comInstEventQueue("instruction-based event queue"),
+ noSquashFromTC(false), trapPending(false), tc(nullptr)
{
if (!FullSystem)
return;