Bug fix and some extra debugging info.
git-svn-id: http://www.cdkersey.com/harp/harptool@114 0246edb2-e076-4747-b392-db732a341fa2
This commit is contained in:
26
src/core.cpp
26
src/core.cpp
@@ -80,8 +80,8 @@ void Core::step() {
|
||||
} catch (MemoryUnit::PageFault pf) {
|
||||
fetchPos = 0;
|
||||
fetchMore = true;
|
||||
reg[0][1] = pf.faultAddr;
|
||||
interrupt(pf.notFound?1:2);
|
||||
reg[0][1] = pf.faultAddr;
|
||||
}
|
||||
} while (fetchMore);
|
||||
D(3, "Fetched at 0x" << hex << pc);
|
||||
@@ -95,16 +95,16 @@ void Core::step() {
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Update pc */
|
||||
// Update pc
|
||||
pc += decPos;
|
||||
|
||||
/* Execute */
|
||||
// Execute
|
||||
try {
|
||||
inst->executeOn(*this);
|
||||
} catch (MemoryUnit::PageFault pf) {
|
||||
pc -= decPos; /* Reset to beginning of faulting address. */
|
||||
reg[0][1] = pf.faultAddr;
|
||||
interrupt(pf.notFound?1:2);
|
||||
reg[0][1] = pf.faultAddr;
|
||||
} catch (DivergentBranchException e) {
|
||||
pc -= decPos;
|
||||
interrupt(4);
|
||||
@@ -112,7 +112,23 @@ void Core::step() {
|
||||
interrupt(5);
|
||||
}
|
||||
|
||||
/* Clean up. */
|
||||
// At Debug Level 3, print debug info after each instruction.
|
||||
#ifdef USE_DEBUG
|
||||
if (USE_DEBUG >= 3) {
|
||||
D(3, "Register state:");
|
||||
for (unsigned i = 0; i < reg[0].size(); ++i)
|
||||
D_RAW(" %r" << i << ": " << hex << reg[0][i]
|
||||
<< '(' << shadowReg[i] << ')' << endl);
|
||||
D(3, "Predicate state:");
|
||||
D_RAW(" ");
|
||||
for (unsigned i = 0; i < pred[0].size(); ++i) D_RAW(pred[0][i]);
|
||||
D_RAW(endl << " (");
|
||||
for (unsigned i = 0; i < shadowPReg.size(); ++i) D_RAW(shadowPReg[i]);
|
||||
D_RAW(endl);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Clean up.
|
||||
delete inst;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user