checksum-oostubs: allow instr_offset = 0

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1038 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
hsc
2012-04-10 16:44:00 +00:00
parent 499bf7a4cb
commit 084716fd05

View File

@ -121,7 +121,7 @@ bool CoolChecksumExperiment::run()
sal::simulator.terminate(1); sal::simulator.terminate(1);
} }
*/ */
param.msg.set_instr_offset(1); param.msg.set_instr_offset(0);
param.msg.set_mem_addr(1024*1024*8); param.msg.set_mem_addr(1024*1024*8);
param.msg.set_bit_offset(0); param.msg.set_bit_offset(0);
@ -136,19 +136,22 @@ bool CoolChecksumExperiment::run()
sal::simulator.addEvent(&func_finish); sal::simulator.addEvent(&func_finish);
bool finish_reached = false; bool finish_reached = false;
// XXX test this with coolchecksum first (or reassure with sanity checks) // no need to wait if offset is 0
// XXX could be improved with intermediate states (reducing runtime until injection) if (instr_offset > 0) {
bp.setWatchInstructionPointer(fi::ANY_ADDR); // XXX test this with coolchecksum first (or reassure with sanity checks)
bp.setCounter(instr_offset); // XXX could be improved with intermediate states (reducing runtime until injection)
sal::simulator.addEvent(&bp); bp.setWatchInstructionPointer(fi::ANY_ADDR);
bp.setCounter(instr_offset);
sal::simulator.addEvent(&bp);
// finish() before FI? // finish() before FI?
if (sal::simulator.waitAny() == &func_finish) { if (sal::simulator.waitAny() == &func_finish) {
finish_reached = true; finish_reached = true;
log << "experiment reached finish() before FI" << endl; log << "experiment reached finish() before FI" << endl;
// wait for bp // wait for bp
sal::simulator.waitAny(); sal::simulator.waitAny();
}
} }
// --- fault injection --- // --- fault injection ---