Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/52050 )

Change subject: cpu-simple: Use PCStateBase instead of TheISA::PCState.
......................................................................

cpu-simple: Use PCStateBase instead of TheISA::PCState.

There are still occurrances of TheISA::PCState, but these are just for
compatibility with other interfaces.

Change-Id: I5538f1483608625221aab7f87a0d7d3ee5488b64
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52050
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/simple/exec_context.hh
M src/cpu/simple/base.cc
2 files changed, 22 insertions(+), 6 deletions(-)

Approvals:
  Daniel Carvalho: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass




diff --git a/src/cpu/simple/base.cc b/src/cpu/simple/base.cc
index 8854e9a..38caaf5 100644
--- a/src/cpu/simple/base.cc
+++ b/src/cpu/simple/base.cc
@@ -369,9 +369,10 @@
         // Use a fake sequence number since we only have one
         // instruction in flight at the same time.
         const InstSeqNum cur_sn(0);
-        t_info.predPC = thread->pcState();
+        set(t_info.predPC, thread->pcState());
         const bool predict_taken(
-            branchPred->predict(curStaticInst, cur_sn, t_info.predPC,
+            branchPred->predict(curStaticInst, cur_sn,
+                                t_info.predPC->as<TheISA::PCState>(),
                                 curThread));

         if (predict_taken)
@@ -386,8 +387,7 @@

     assert(curStaticInst);

-    TheISA::PCState pc = threadContexts[curThread]->pcState();
-    Addr instAddr = pc.instAddr();
+    Addr instAddr = threadContexts[curThread]->pcState().instAddr();

     if (curStaticInst->isMemRef()) {
         t_info.execContextStats.numMemRefs++;
@@ -484,7 +484,7 @@
         // instruction in flight at the same time.
         const InstSeqNum cur_sn(0);

-        if (t_info.predPC == thread->pcState()) {
+        if (t_info.predPC->as<TheISA::PCState>() == thread->pcState()) {
             // Correctly predicted branch
             branchPred->update(cur_sn, curThread);
         } else {
diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh
index 53b5735..d652873 100644
--- a/src/cpu/simple/exec_context.hh
+++ b/src/cpu/simple/exec_context.hh
@@ -70,7 +70,7 @@
     bool stayAtPC;

     // Branch prediction
-    TheISA::PCState predPC;
+    std::unique_ptr<PCStateBase> predPC;

     /** PER-THREAD STATS */
     Counter numInst;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52050
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I5538f1483608625221aab7f87a0d7d3ee5488b64
Gerrit-Change-Number: 52050
Gerrit-PatchSet: 14
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Earl Ou <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to