From 74a66d8e6706ccaed79facc6df3999f7dee2075a Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 9 Oct 2019 21:32:11 -0700 Subject: cpu: Make the ThreadContext a PCEventScope. Both the thread and system's PCEventQueue are checked when appropriate. Change-Id: I16c371339c91a37b5641860d974e546a30e23e13 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22105 Reviewed-by: Andreas Sandberg Maintainer: Gabe Black Tested-by: kokoro --- src/cpu/o3/commit_impl.hh | 2 ++ src/cpu/o3/thread_context.hh | 11 +++++++++++ src/cpu/o3/thread_state.hh | 3 +++ 3 files changed, 16 insertions(+) (limited to 'src/cpu/o3') diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index df439454b..23f10fe2a 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -1114,6 +1114,8 @@ DefaultCommit::commitInsts() oldpc = pc[tid].instAddr(); cpu->system->pcEventQueue.service( oldpc, thread[tid]->getTC()); + thread[tid]->pcEventQueue.service( + oldpc, thread[tid]->getTC()); count++; } while (oldpc != pc[tid].instAddr()); if (count > 1) { diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index 9029aba3e..2ec559f2d 100644 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -75,6 +75,17 @@ class O3ThreadContext : public ThreadContext /** Pointer to the CPU. */ O3CPU *cpu; + bool + schedule(PCEvent *e) override + { + return thread->pcEventQueue.schedule(e); + } + bool + remove(PCEvent *e) override + { + return thread->pcEventQueue.remove(e); + } + /** Pointer to the thread state that this TC corrseponds to. */ O3ThreadState *thread; diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh index 4b4f51e8f..b2c9296f4 100644 --- a/src/cpu/o3/thread_state.hh +++ b/src/cpu/o3/thread_state.hh @@ -72,7 +72,10 @@ struct O3ThreadState : public ThreadState { private: /** Pointer to the CPU. */ O3CPU *cpu; + public: + PCEventQueue pcEventQueue; + /* This variable controls if writes to a thread context should cause a all * dynamic/speculative state to be thrown away. Nominally this is the * desired behavior because the external thread context write has updated -- cgit v1.2.3