diff options
Diffstat (limited to 'src/cpu/o3')
-rw-r--r-- | src/cpu/o3/thread_context.hh | 27 | ||||
-rw-r--r-- | src/cpu/o3/thread_state.hh | 11 |
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; |