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;