Gabe Black has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/52052 )
Change subject: cpu: Stop using the ThreadContext::nextInstAddr method.
......................................................................
cpu: Stop using the ThreadContext::nextInstAddr method.
The PCState already contains this information internally, and it can be
compared, printed, etc, implicitly alongside all the other info in the
PCState, everywhere this method was being used.
Change-Id: I30705f30a135d4ffbc3279c366dafb1184445c70
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52052
Reviewed-by: Daniel Carvalho <[email protected]>
Maintainer: Gabe Black <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/cpu/checker/cpu_impl.hh
M src/arch/arm/nativetrace.cc
M src/cpu/o3/iew.cc
3 files changed, 27 insertions(+), 17 deletions(-)
Approvals:
Daniel Carvalho: Looks good to me, approved
Gabe Black: Looks good to me, approved
kokoro: Regressions pass
diff --git a/src/arch/arm/nativetrace.cc b/src/arch/arm/nativetrace.cc
index 304f4f6..3cafcf7 100644
--- a/src/arch/arm/nativetrace.cc
+++ b/src/arch/arm/nativetrace.cc
@@ -142,7 +142,7 @@
ThreadContext *tc = record->getThread();
// This area is read only on the target. It can't stop there to tell us
// what's going on, so we should skip over anything there also.
- if (tc->nextInstAddr() > 0xffff0000)
+ if (tc->pcState().npc() > 0xffff0000)
return;
nState.update(this);
mState.update(tc);
diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index 9d5c260..436ef96 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -518,10 +518,9 @@
}
}
- if (inst->nextInstAddr() != thread->nextInstAddr()) {
- warn("%lli: Instruction next PCs do not match! Inst: %#x, "
- "checker: %#x",
- curTick(), inst->nextInstAddr(), thread->nextInstAddr());
+ if (inst->pcState() != thread->pcState()) {
+ warn("%lli: Instruction PCs do not match! Inst: %s, checker: %s",
+ curTick(), inst->pcState(), thread->pcState());
handleError(inst);
}
@@ -644,10 +643,9 @@
Checker<DynInstPtr>::dumpAndExit(const DynInstPtr &inst)
{
cprintf("Error detected, instruction information:\n");
- cprintf("PC:%s, nextPC:%#x\n[sn:%lli]\n[tid:%i]\n"
+ cprintf("PC:%s\n[sn:%lli]\n[tid:%i]\n"
"Completed:%i\n",
inst->pcState(),
- inst->nextInstAddr(),
inst->seqNum,
inst->threadNumber,
inst->isCompleted());
diff --git a/src/cpu/o3/iew.cc b/src/cpu/o3/iew.cc
index 79e0783..2795919 100644
--- a/src/cpu/o3/iew.cc
+++ b/src/cpu/o3/iew.cc
@@ -1602,17 +1602,12 @@
DPRINTF(IEW, "[tid:%i] [sn:%llu] Execute: "
"Branch mispredict detected.\n",
- tid,inst->seqNum);
- DPRINTF(IEW, "[tid:%i] [sn:%llu] Predicted target "
- "was PC:%#x, NPC:%#x\n",
- tid,inst->seqNum,
- inst->predInstAddr(), inst->predNextInstAddr());
+ tid, inst->seqNum);
+ DPRINTF(IEW, "[tid:%i] [sn:%llu] Predicted target was
PC: %s\n",
+ tid, inst->seqNum, inst->readPredTarg());
DPRINTF(IEW, "[tid:%i] [sn:%llu] Execute: "
- "Redirecting fetch to PC: %#x, "
- "NPC: %#x.\n",
- tid,inst->seqNum,
- inst->nextInstAddr(),
- inst->nextInstAddr());
+ "Redirecting fetch to PC: %s\n",
+ tid, inst->seqNum, inst->pcState());
// If incorrect, then signal the ROB that it must be squashed.
squashDueToBranch(inst, tid);
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/52052
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: I30705f30a135d4ffbc3279c366dafb1184445c70
Gerrit-Change-Number: 52052
Gerrit-PatchSet: 14
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[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