}
}
+void
+CheckerCPU::dumpAndExit()
+{
+ warn("%lli: Checker PC:%#x, next PC:%#x",
+ curTick, cpuXC->readPC(), cpuXC->readNextPC());
+ panic("Checker found an error!");
+}
+
template <class DynInstPtr>
void
Checker<DynInstPtr>::tick(DynInstPtr &completed_inst)
warn("%lli: Changed PC does not match expected PC, "
"changed: %#x, expected: %#x",
curTick, cpuXC->readPC(), newPC);
- handleError();
+ CheckerCPU::handleError();
}
willChangePC = false;
}
// possible that its ITB entry was kicked out.
warn("%lli: Instruction PC %#x was not found in the ITB!",
curTick, cpuXC->readPC());
- handleError();
+ handleError(inst);
// go to the next instruction
cpuXC->setPC(cpuXC->readNextPC());
warn("%lli: Changed PCs recently, may not be an error",
curTick);
} else {
- handleError();
+ handleError(inst);
}
}
warn("%lli: Binary instructions do not match! Inst: %#x, "
"checker: %#x",
curTick, mi, machInst);
- handleError();
+ handleError(inst);
}
}
warn("%lli: Instruction results do not match! (Results may not "
"actually be integers) Inst: %#x, checker: %#x",
curTick, inst->readIntResult(), result.integer);
- handleError();
+ handleError(inst);
}
}
warn("%lli: Instruction next PCs do not match! Inst: %#x, "
"checker: %#x",
curTick, inst->readNextPC(), cpuXC->readNextPC());
- handleError();
+ handleError(inst);
}
// Checking side effect registers can be difficult if they are not
curTick, misc_reg_idx,
inst->xcBase()->readMiscReg(misc_reg_idx),
cpuXC->readMiscReg(misc_reg_idx));
- handleError();
+ handleError(inst);
}
}
}
}
}
+template <class DynInstPtr>
+void
+Checker<DynInstPtr>::dumpAndExit(DynInstPtr &inst)
+{
+ cprintf("Error detected, instruction information:\n");
+ cprintf("PC:%#x, nextPC:%#x\n[sn:%lli]\n[tid:%i]\n"
+ "Completed:%i\n",
+ inst->readPC(),
+ inst->readNextPC(),
+ inst->seqNum,
+ inst->threadNumber,
+ inst->isCompleted());
+ inst->dump();
+ CheckerCPU::dumpAndExit();
+}
+
template <class DynInstPtr>
void
Checker<DynInstPtr>::dumpInsts()
union Result {
uint64_t integer;
- float fp;
+// float fp;
double dbl;
};
{
int reg_idx = si->destRegIdx(idx) - TheISA::FP_Base_DepTag;
cpuXC->setFloatRegSingle(reg_idx, val);
- result.fp = val;
+ result.dbl = (double)val;
}
void setFloatRegDouble(const StaticInst *si, int idx, double val)
return cpuXC->setMiscRegWithEffect(misc_reg, val);
}
- void recordPCChange(uint64_t val) { changedPC = true; }
+ void recordPCChange(uint64_t val) { changedPC = true; newPC = val; }
void recordNextPCChange(uint64_t val) { changedNextPC = true; }
bool translateInstReq(MemReqPtr &req);
void syscall() { }
#endif
- virtual void handleError() = 0;
+ void handleError()
+ {
+ if (exitOnError)
+ dumpAndExit();
+ }
bool checkFlags(MemReqPtr &req);
+ void dumpAndExit();
+
ExecContext *xcBase() { return xcProxy; }
CPUExecContext *cpuXCBase() { return cpuXC; }
void validateExecution(DynInstPtr &inst);
void validateState();
- virtual void handleError()
+ void handleError(DynInstPtr &inst)
{
- if (exitOnError)
- panic("Checker found error!");
- else if (updateOnError)
+ if (exitOnError) {
+ dumpAndExit(inst);
+ } else if (updateOnError) {
updateThisCycle = true;
+ }
}
+ void dumpAndExit(DynInstPtr &inst);
+
bool updateThisCycle;
DynInstPtr unverifiedInst;