BURTON Mark
Builds for 1 pipeline passed in 6 minutes 5 seconds

Fix for timer in non-icount mode. NB time is considered not to move while the mo…

…del is held in 'end-of-quantum'
... ... @@ -109,6 +109,8 @@ struct QBOXBase
uint64_t quantum; /*< Quantum time in ns. */
volatile bool inited;
QEMUTimer *quantum_timer;
uint64_t delta;
bool exit; /*< QEMU request exit. */
int argc; /*< Command line argument for this QBOX. */
... ... @@ -723,12 +725,14 @@ static void quantum_expired(void *opaque)
trace_qbox_end_of_quantum(clk_ns);
tlm2c_env_signal_end_of_quantum(clk_ns);
tlm2c_env_signal_end_of_quantum(clk_ns-handle.delta);
handle_cpu_reset();
/* Program the next trigger in one quantum */
timer_mod_ns(handle.quantum_timer, clk_ns + handle.quantum);
uint64_t clk_ns2 = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
handle.delta+=(clk_ns2 - clk_ns); // will be zero for icount
timer_mod_ns(handle.quantum_timer, clk_ns2 + handle.quantum);
}
/*
... ... @@ -749,6 +753,7 @@ void qbox_init(void)
handle.quantum_timer =
timer_new_ns(QEMU_CLOCK_VIRTUAL, quantum_expired, NULL);
handle.delta=0;
/* Call the callback the first time at 0. */
quantum_expired(NULL);
... ...