{
if (reset)
return false;
- for (size_t i = 0; i < sim->num_cores(); i++)
- if (sim->procs[i]->running())
- return false;
- return true;
+ return !sim->running();
}
for (size_t i = 0, steps = 0; i < n; i += steps)
{
htif->tick();
+ if (!running())
+ break;
steps = std::min(n - i, INTERLEAVE - current_step);
procs[current_proc]->step(steps, noisy);
}
}
+bool sim_t::running()
+{
+ for (size_t i = 0; i < procs.size(); i++)
+ if (procs[i]->running())
+ return true;
+ return false;
+}
+
void sim_t::stop()
{
procs[0]->tohost = 1;