cpu: Use PCStateBase in the checker CPU.
Change-Id: I3f07e2083f803224035198b91064806991aea16e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52056
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
diff --git a/src/cpu/checker/cpu.hh b/src/cpu/checker/cpu.hh
index 7043216..1ed7e0d 100644
--- a/src/cpu/checker/cpu.hh
+++ b/src/cpu/checker/cpu.hh
@@ -415,10 +415,10 @@
/////////////////////////////////////////
void
- recordPCChange(const TheISA::PCState &val)
+ recordPCChange(const PCStateBase &val)
{
changedPC = true;
- newPCState = val;
+ set(newPCState, val);
}
void
@@ -511,7 +511,7 @@
bool changedPC;
bool willChangePC;
- TheISA::PCState newPCState;
+ std::unique_ptr<PCStateBase> newPCState;
bool exitOnError;
bool updateOnError;
bool warnOnlyOnLoadError;
diff --git a/src/cpu/checker/cpu_impl.hh b/src/cpu/checker/cpu_impl.hh
index 436ef96..385ee2a 100644
--- a/src/cpu/checker/cpu_impl.hh
+++ b/src/cpu/checker/cpu_impl.hh
@@ -213,12 +213,12 @@
DPRINTF(Checker, "Changed PC recently to %s\n",
thread->pcState());
if (willChangePC) {
- if (newPCState == thread->pcState()) {
+ if (*newPCState == thread->pcState()) {
DPRINTF(Checker, "Changed PC matches expected PC\n");
} else {
warn("%lli: Changed PC does not match expected PC, "
"changed: %s, expected: %s",
- curTick(), thread->pcState(), newPCState);
+ curTick(), thread->pcState(), *newPCState);
CheckerCPU::handleError();
}
willChangePC = false;
@@ -386,8 +386,8 @@
if (FullSystem) {
fault->invoke(tc, curStaticInst);
willChangePC = true;
- newPCState = thread->pcState();
- DPRINTF(Checker, "Fault, PC is now %s\n", newPCState);
+ set(newPCState, thread->pcState());
+ DPRINTF(Checker, "Fault, PC is now %s\n", *newPCState);
curMacroStaticInst = nullStaticInstPtr;
}
} else {
@@ -407,8 +407,8 @@
} while (oldpc != thread->instAddr());
if (count > 1) {
willChangePC = true;
- newPCState = thread->pcState();
- DPRINTF(Checker, "PC Event, PC is now %s\n", newPCState);
+ set(newPCState, thread->pcState());
+ DPRINTF(Checker, "PC Event, PC is now %s\n", *newPCState);
}
}