#include "base/fiber.hh"
#include "base/logging.hh"
#include "sim/eventq.hh"
+#include "sim/sim_exit.hh"
#include "systemc/core/kernel.hh"
#include "systemc/core/sc_main_fiber.hh"
#include "systemc/ext/core/messages.hh"
status(StatusPaused);
kernel->status(::sc_core::SC_PAUSED);
runOnce = false;
- if (scMainFiber.called() && !scMainFiber.finished())
- scMainFiber.run();
+ if (scMainFiber.called()) {
+ if (!scMainFiber.finished())
+ scMainFiber.run();
+ } else {
+ if (scMainFiber.finished())
+ fatal("Pausing systemc after sc_main completed.");
+ else
+ exitSimLoopNow("systemc pause");
+ }
}
void
clear();
runOnce = false;
- if (scMainFiber.called() && !scMainFiber.finished())
- scMainFiber.run();
+ if (scMainFiber.called()) {
+ if (!scMainFiber.finished())
+ scMainFiber.run();
+ } else {
+ if (scMainFiber.finished())
+ fatal("Stopping systemc after sc_main completed.");
+ else
+ exitSimLoopNow("systemc stop");
+ }
}
void