ecos: fix golden-run runtime conversion
BochsController::getTimerTicksPerSecond() only works reliably when the simulation is already running (e.g., after a restore()). This broke timeout conditions for the very first experiment in a FailBochs instance. Change-Id: Ice5f0aa0c6759f2d9341ad4f21d5c346307b4c12
This commit is contained in:
@ -116,6 +116,10 @@ public:
|
|||||||
*/
|
*/
|
||||||
void fireInterruptDone();
|
void fireInterruptDone();
|
||||||
virtual simtime_t getTimerTicks() { return bx_pc_system.time_ticks(); }
|
virtual simtime_t getTimerTicks() { return bx_pc_system.time_ticks(); }
|
||||||
|
/**
|
||||||
|
* Only works reliably when the simulation has already begun, e.g., after
|
||||||
|
* calling simulator.restore().
|
||||||
|
*/
|
||||||
virtual simtime_t getTimerTicksPerSecond() { return bx_pc_system.time_ticks() / bx_pc_system.time_usec() * 1000000; /* imprecise hack */ }
|
virtual simtime_t getTimerTicksPerSecond() { return bx_pc_system.time_ticks() / bx_pc_system.time_usec() * 1000000; /* imprecise hack */ }
|
||||||
/* ********************************************************************
|
/* ********************************************************************
|
||||||
* BochsController-specific (not implemented in SimulatorController!):
|
* BochsController-specific (not implemented in SimulatorController!):
|
||||||
|
|||||||
@ -507,10 +507,7 @@ bool EcosKernelTestExperiment::faultInjection() {
|
|||||||
|
|
||||||
readTraceInfo(goldenrun_instr_counter, goldenrun_runtime_ticks,
|
readTraceInfo(goldenrun_instr_counter, goldenrun_runtime_ticks,
|
||||||
mem1_low, mem1_high, mem2_low, mem2_high, m_variant, m_benchmark);
|
mem1_low, mem1_high, mem2_low, mem2_high, m_variant, m_benchmark);
|
||||||
// convert to microseconds
|
|
||||||
goldenrun_runtime = (unsigned)
|
|
||||||
(goldenrun_runtime_ticks * 1000000.0 / simulator.getTimerTicksPerSecond());
|
|
||||||
timeout_runtime = goldenrun_runtime + 1000000/18.2; // + 1 timer tick
|
|
||||||
if (!readELFSymbols(addr_entry, addr_finish,
|
if (!readELFSymbols(addr_entry, addr_finish,
|
||||||
addr_testdata, addr_testdata_size, addr_test_output,
|
addr_testdata, addr_testdata_size, addr_test_output,
|
||||||
addr_errors_corrected, addr_panic, addr_text_start, addr_text_end,
|
addr_errors_corrected, addr_panic, addr_text_start, addr_text_end,
|
||||||
@ -555,6 +552,12 @@ bool EcosKernelTestExperiment::faultInjection() {
|
|||||||
log << "restoring state" << endl;
|
log << "restoring state" << endl;
|
||||||
simulator.restore(statename);
|
simulator.restore(statename);
|
||||||
|
|
||||||
|
// convert to microseconds (simulator.getTimerTicksPerSecond() only
|
||||||
|
// works reliably when simulation has begun)
|
||||||
|
goldenrun_runtime = (unsigned)
|
||||||
|
(goldenrun_runtime_ticks * 1000000.0 / simulator.getTimerTicksPerSecond());
|
||||||
|
timeout_runtime = goldenrun_runtime + 1000000/18.2; // + 1 timer tick
|
||||||
|
|
||||||
// the outcome of ecos' test case
|
// the outcome of ecos' test case
|
||||||
bool ecos_test_passed = false;
|
bool ecos_test_passed = false;
|
||||||
bool ecos_test_failed = false;
|
bool ecos_test_failed = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user