From 9633282fc8f152ba897347d38fa85a7b374e3d1e Mon Sep 17 00:00:00 2001 From: Geoffrey Blake Date: Fri, 24 Jan 2014 15:29:30 -0600 Subject: checker: CheckerCPU handling of MiscRegs was incorrect The CheckerCPU model in pre-v8 code was not checking the updates to miscellaneous registers due to some methods for setting misc regs were not instrumented. The v8 patches exposed this by calling the instrumented misc reg update methods and then invoking the checker before the main CPU had updated its misc regs, leading to false positives about register mismatches. This patch fixes the non-instrumented misc reg update methods and places calls to the checker in the proper places in the O3 model. --- src/cpu/o3/commit_impl.hh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/cpu/o3') diff --git a/src/cpu/o3/commit_impl.hh b/src/cpu/o3/commit_impl.hh index a6f2a63db..91e8e7681 100644 --- a/src/cpu/o3/commit_impl.hh +++ b/src/cpu/o3/commit_impl.hh @@ -1043,6 +1043,12 @@ DefaultCommit::commitInsts() // Updates misc. registers. head_inst->updateMiscRegs(); + // Check instruction execution if it successfully commits and + // is not carrying a fault. + if (cpu->checker) { + cpu->checker->verify(head_inst); + } + cpu->traceFunctions(pc[tid].instAddr()); TheISA::advancePC(pc[tid], head_inst->staticInst); @@ -1168,12 +1174,6 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) head_inst->setCompleted(); } - // Use checker prior to updating anything due to traps or PC - // based events. - if (cpu->checker) { - cpu->checker->verify(head_inst); - } - if (inst_fault != NoFault) { DPRINTF(Commit, "Inst [sn:%lli] PC %s has a fault\n", head_inst->seqNum, head_inst->pcState()); @@ -1185,6 +1185,8 @@ DefaultCommit::commitHead(DynInstPtr &head_inst, unsigned inst_num) head_inst->setCompleted(); + // If instruction has faulted, let the checker execute it and + // check if it sees the same fault and control flow. if (cpu->checker) { // Need to check the instruction before its fault is processed cpu->checker->verify(head_inst); -- cgit v1.2.3