Go to the documentation of this file.
47 #include "debug/ExecRegDelta.hh"
48 #include "params/ArmNativeTrace.hh"
54 using namespace ArmISA;
58 [[maybe_unused]]
static const char *
regNames[] = {
59 "r0",
"r1",
"r2",
"r3",
"r4",
"r5",
"r6",
"r7",
60 "r8",
"r9",
"r10",
"fp",
"r12",
"sp",
"lr",
"pc",
61 "cpsr",
"f0",
"f1",
"f2",
"f3",
"f4",
"f5",
"f6",
62 "f7",
"f8",
"f9",
"f10",
"f11",
"f12",
"f13",
"f14",
63 "f15",
"f16",
"f17",
"f18",
"f19",
"f20",
"f21",
"f22",
64 "f23",
"f24",
"f25",
"f26",
"f27",
"f28",
"f29",
"f30",
71 oldState =
state[current];
72 current = (current + 1) % 2;
73 newState =
state[current];
75 memcpy(newState, oldState,
sizeof(
state[0]));
78 parent->
read(&diffVector,
sizeof(diffVector));
79 diffVector =
letoh(diffVector);
82 for (
int i = 0;
i < STATE_NUMVALS;
i++) {
83 if (diffVector & 0x1) {
92 uint64_t values[changes];
93 parent->
read(values,
sizeof(values));
95 for (
int i = 0;
i < STATE_NUMVALS;
i++) {
97 newState[
i] =
letoh(values[pos++]);
98 changed[
i] = (newState[
i] != oldState[
i]);
106 oldState =
state[current];
107 current = (current + 1) % 2;
108 newState =
state[current];
111 for (
int i = 0;
i < 15;
i++) {
113 changed[
i] = (oldState[
i] != newState[
i]);
118 changed[STATE_PC] = (newState[STATE_PC] != oldState[STATE_PC]);
127 newState[STATE_CPSR] = cpsr;
128 changed[STATE_CPSR] = (newState[STATE_CPSR] != oldState[STATE_CPSR]);
133 auto *
vec = vec_container.
as<uint64_t>();
134 newState[STATE_F0 + 2*
i] =
vec[0];
135 newState[STATE_F0 + 2*
i + 1] =
vec[1];
153 if ((mState.oldState[STATE_PC] == nState.oldState[STATE_PC]) &&
154 (mState.newState[STATE_PC] - 4 == nState.newState[STATE_PC])) {
155 DPRINTF(ExecRegDelta,
"Advancing to match PCs after syscall\n");
160 bool errorFound =
false;
162 for (
int i = 0;
i < STATE_NUMVALS;
i++) {
163 if (nState.changed[
i] || mState.changed[
i]) {
164 bool oldMatch = (mState.oldState[
i] == nState.oldState[
i]);
165 bool newMatch = (mState.newState[
i] == nState.newState[
i]);
166 if (oldMatch && newMatch) {
174 const char *vergence =
" ";
175 if (oldMatch && !newMatch) {
177 }
else if (!oldMatch && newMatch) {
181 if (!nState.changed[
i]) {
182 DPRINTF(ExecRegDelta,
"%s [%5s] "\
184 "M5: %#010x => %#010x\n",
187 mState.oldState[
i], mState.newState[
i]);
188 }
else if (!mState.changed[
i]) {
189 DPRINTF(ExecRegDelta,
"%s [%5s] "\
190 "Native: %#010x => %#010x "\
193 nState.oldState[
i], nState.newState[
i],
196 DPRINTF(ExecRegDelta,
"%s [%5s] "\
197 "Native: %#010x => %#010x "\
198 "M5: %#010x => %#010x\n",
200 nState.oldState[
i], nState.newState[
i],
201 mState.oldState[
i], mState.newState[
i]);
217 bool pcError = (mState.newState[STATE_PC] !=
218 nState.newState[STATE_PC]);
219 if (stopOnPCError && pcError)
220 panic(
"Native trace detected an error in control flow!");
static const char * regNames[]
virtual RegVal readMiscReg(RegIndex misc_reg)=0
virtual RegVal getReg(const RegId ®) const
void read(void *ptr, size_t size)
virtual const PCStateBase & pcState() const =0
constexpr RegId Fp(CCRegClass, _FpIdx)
StaticInstPtr getStaticInst() const
constexpr RegId Nz(CCRegClass, _NzIdx)
const int NumVecV7ArchRegs
Vector Register Abstraction This generic class is the model in a particularization of MVC,...
ThreadContext is the external interface to all thread state for anything outside of the CPU.
VecElem * as()
View interposers.
constexpr RegId V(CCRegClass, _VIdx)
GenericISA::DelaySlotPCState< 4 > PCState
StaticInstPtr getMacroStaticInst() const
ThreadContext * getThread() const
virtual RegVal readMiscRegNoEffect(RegIndex misc_reg) const =0
constexpr RegId C(CCRegClass, _CIdx)
constexpr RegId Ge(CCRegClass, _GeIdx)
void check(NativeTraceRecord *record)
@ IntRegClass
Integer register.
void update(NativeTrace *parent)
@ VecRegClass
Vector Register.
void traceInst(const StaticInstPtr &inst, bool ran)
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Register ID: describe an architectural register with its class and index.
#define panic(...)
This implements a cprintf based panic() function.
Generated on Thu Jul 28 2022 13:32:24 for gem5 by doxygen 1.8.17