mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-24 05:47:35 -04:00
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:
parent
c8460123f7
commit
3ceabe2a61
1 changed files with 21 additions and 5 deletions
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,24 +95,40 @@ 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);
|
||||
} catch (DomainException e) {
|
||||
interrupt(5);
|
||||
}
|
||||
|
||||
// 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. */
|
||||
// Clean up.
|
||||
delete inst;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue