From 084716fd05b8593a2d1dab03c1cdbe30568d5fda Mon Sep 17 00:00:00 2001 From: hsc Date: Tue, 10 Apr 2012 16:44:00 +0000 Subject: [PATCH] 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 --- .../checksum-oostubs/experiment.cc | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/core/experiments/checksum-oostubs/experiment.cc b/core/experiments/checksum-oostubs/experiment.cc index 207576ef..b5df6165 100644 --- a/core/experiments/checksum-oostubs/experiment.cc +++ b/core/experiments/checksum-oostubs/experiment.cc @@ -121,7 +121,7 @@ bool CoolChecksumExperiment::run() 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_bit_offset(0); @@ -136,19 +136,22 @@ bool CoolChecksumExperiment::run() sal::simulator.addEvent(&func_finish); bool finish_reached = false; - // XXX test this with coolchecksum first (or reassure with sanity checks) - // XXX could be improved with intermediate states (reducing runtime until injection) - bp.setWatchInstructionPointer(fi::ANY_ADDR); - bp.setCounter(instr_offset); - sal::simulator.addEvent(&bp); + // no need to wait if offset is 0 + if (instr_offset > 0) { + // XXX test this with coolchecksum first (or reassure with sanity checks) + // XXX could be improved with intermediate states (reducing runtime until injection) + bp.setWatchInstructionPointer(fi::ANY_ADDR); + bp.setCounter(instr_offset); + sal::simulator.addEvent(&bp); - // finish() before FI? - if (sal::simulator.waitAny() == &func_finish) { - finish_reached = true; - log << "experiment reached finish() before FI" << endl; + // finish() before FI? + if (sal::simulator.waitAny() == &func_finish) { + finish_reached = true; + log << "experiment reached finish() before FI" << endl; - // wait for bp - sal::simulator.waitAny(); + // wait for bp + sal::simulator.waitAny(); + } } // --- fault injection ---