diff --git a/core/experiments/FaultCoverageExperiment/experiment.cc b/core/experiments/FaultCoverageExperiment/experiment.cc index 4373b232..c0a401b9 100644 --- a/core/experiments/FaultCoverageExperiment/experiment.cc +++ b/core/experiments/FaultCoverageExperiment/experiment.cc @@ -136,5 +136,7 @@ bool FaultCoverageExperiment::run() } } } - return (true); + + simulator.clearEvents(this); + return true; } diff --git a/core/experiments/MHTestCampaign/experiment.cc b/core/experiments/MHTestCampaign/experiment.cc index 570e4cfe..4ee84f5d 100644 --- a/core/experiments/MHTestCampaign/experiment.cc +++ b/core/experiments/MHTestCampaign/experiment.cc @@ -36,6 +36,7 @@ bool MHTestExperiment::run() cout << "No data for me? :(" << endl; } #endif + sal::simulator.clearEvents(this); sal::simulator.terminate(); return true; } diff --git a/core/experiments/TracingTest/experiment.cc b/core/experiments/TracingTest/experiment.cc index b5b29068..6ce9df60 100644 --- a/core/experiments/TracingTest/experiment.cc +++ b/core/experiments/TracingTest/experiment.cc @@ -73,6 +73,7 @@ bool TracingTest::run() */ #endif cout << "[TracingTest] Finished." << endl; + simulator.clearEvents(this); simulator.terminate(); return true; diff --git a/core/experiments/attic/DataRetrievalExperiment.cc b/core/experiments/attic/DataRetrievalExperiment.cc index 2de4ee80..5dfb397d 100644 --- a/core/experiments/attic/DataRetrievalExperiment.cc +++ b/core/experiments/attic/DataRetrievalExperiment.cc @@ -31,6 +31,7 @@ bool DataRetrievalExperiment::run() cout << "m_instrptr1: " << hex << test->m_instrptr1() << endl; // m_instrptr2 augeben cout << "m_instrptr2: " << hex << test->m_instrptr2() << endl; - - return (true); // experiment successful + + sal::simulator.clearEvents(this); + return true; // experiment successful } diff --git a/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp b/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp index 15f95297..06e517dc 100644 --- a/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp +++ b/core/experiments/attic/JumpAndRunExperiment/JumpAndRunExperiment.hpp @@ -37,7 +37,8 @@ class JumpAndRunExperiment : public fi::ExperimentFlow { cerr << "[JumpAndRunExperiment] Now, we are completely lost! " << "It's time to cry! :-(" << endl; - return (false); + simulator.clearEvents(this); + return false; } else cout << "[JumpAndRunExperiment] Entry of main function reached! " @@ -58,7 +59,8 @@ class JumpAndRunExperiment : public fi::ExperimentFlow { cerr << "[JumpAndRunExperiment] Damn! Something went " << "terribly wrong! Who added that event?! :-(" << endl; - return (false); + simulator.clearEvents(this); + return false; } else cout << "[JumpAndRunExperiment] Jump detected. Instruction: " @@ -73,7 +75,9 @@ class JumpAndRunExperiment : public fi::ExperimentFlow cout << "[JumpAndRunExperiment] " << dec << counter << " jump(s) detected -- enough for today...exiting! :-)" << endl; - return (true); + + simulator.clearEvents(this); + return true; } }; diff --git a/core/experiments/attic/MemWriteExperiment.hpp b/core/experiments/attic/MemWriteExperiment.hpp index 6d1d145d..8abf5335 100644 --- a/core/experiments/attic/MemWriteExperiment.hpp +++ b/core/experiments/attic/MemWriteExperiment.hpp @@ -68,7 +68,8 @@ class MemWriteExperiment : public ExperimentFlow // 4. Continue simulation (waitAny) and inject bitflip: // ... - return (true); + simulator.clearEvents(this); + return true; } }; diff --git a/core/experiments/attic/MyExperiment.hpp b/core/experiments/attic/MyExperiment.hpp index db7ee92b..46a857ee 100644 --- a/core/experiments/attic/MyExperiment.hpp +++ b/core/experiments/attic/MyExperiment.hpp @@ -57,7 +57,9 @@ class MyExperiment : public fi::ExperimentFlow << " next 400 instructions..."; cout.flush(); simulator.addEventAndWait(&foobar); cout << "cought! Exiting now." << endl; - return (true); + + simulator.clearEvents(this); + return true; } }; diff --git a/core/experiments/attic/SingleSteppingExperiment.hpp b/core/experiments/attic/SingleSteppingExperiment.hpp index 885ac388..63f7f277 100644 --- a/core/experiments/attic/SingleSteppingExperiment.hpp +++ b/core/experiments/attic/SingleSteppingExperiment.hpp @@ -39,7 +39,8 @@ class SingleSteppingExperiment : public fi::ExperimentFlow { cerr << "[SingleSteppingExperiment] Now, we are completely lost!" << " It's time to cry! :-(" << endl; - return (false); + simulator.clearEvents(this); + return false; } cout << "[SingleSteppingExperiment] Entry of main function reached!" << " Beginning single-stepping..." << endl; @@ -57,7 +58,9 @@ class SingleSteppingExperiment : public fi::ExperimentFlow if(action != 'y') break; } - return (true); + + simulator.clearEvents(this); + return true; } }; diff --git a/core/experiments/checksum-oostubs/experiment.cc b/core/experiments/checksum-oostubs/experiment.cc index 867fedff..bf206120 100644 --- a/core/experiments/checksum-oostubs/experiment.cc +++ b/core/experiments/checksum-oostubs/experiment.cc @@ -98,6 +98,7 @@ bool ChecksumOOStuBSExperiment::run() std::ofstream of(tracefile); if (of.fail()) { log << "failed to write " << tracefile << endl; + sal::simulator.clearEvents(this); return false; } trace.SerializeToOstream(&of); diff --git a/core/experiments/coolchecksum/experiment.cc b/core/experiments/coolchecksum/experiment.cc index 83679ff0..f16253db 100644 --- a/core/experiments/coolchecksum/experiment.cc +++ b/core/experiments/coolchecksum/experiment.cc @@ -93,6 +93,7 @@ bool CoolChecksumExperiment::run() std::ofstream of("trace.pb"); if (of.fail()) { log << "failed to write trace.pb" << endl; + sal::simulator.clearEvents(this); return false; } trace.SerializeToOstream(&of); @@ -114,7 +115,7 @@ bool CoolChecksumExperiment::run() if (!m_jc.getParam(param)) { log << "Dying." << endl; // communicate that we were told to die - sal::simulator.terminate(1); // "return (false);" ? + sal::simulator.terminate(1); } int id = param.getWorkloadID(); int instr_offset = param.msg.instr_offset(); @@ -201,5 +202,6 @@ bool CoolChecksumExperiment::run() sal::simulator.terminate(); #endif // simulator continues to run + sal::simulator.clearEvents(this); return true; } diff --git a/core/experiments/fireinterrupt/experiment.cc b/core/experiments/fireinterrupt/experiment.cc index a6f2ddc9..89b65eb5 100644 --- a/core/experiments/fireinterrupt/experiment.cc +++ b/core/experiments/fireinterrupt/experiment.cc @@ -42,5 +42,6 @@ bool fireinterruptExperiment::run() #endif + sal::simulator.clearEvents(this); return true; } diff --git a/core/experiments/hscsimple/experiment.cc b/core/experiments/hscsimple/experiment.cc index c02d744a..838ed9be 100644 --- a/core/experiments/hscsimple/experiment.cc +++ b/core/experiments/hscsimple/experiment.cc @@ -52,6 +52,7 @@ bool hscsimpleExperiment::run() sal::simulator.addEventAndWait(&breakpoint); #endif - + + sal::simulator.clearEvents(this); return true; } diff --git a/core/experiments/weathermonitor/experiment.cc b/core/experiments/weathermonitor/experiment.cc index 40f3115f..a245b23c 100644 --- a/core/experiments/weathermonitor/experiment.cc +++ b/core/experiments/weathermonitor/experiment.cc @@ -98,6 +98,7 @@ bool WeathermonitorExperiment::run() std::ofstream of(tracefile); if (of.fail()) { log << "failed to write " << tracefile << endl; + sal::simulator.clearEvents(this); // cleanup return false; } trace.SerializeToOstream(&of);