--- /dev/null
+#include "fsm/scd_stm_terminate.h"
+
+#include "scd_logging.h"
+#include "scd_exception.h"
+#include "scd_cont_man_master.h"
+
+
+void scd_stm_terminate::set_busy()
+{
+ scd_error("received further events while terminating");
+ set_fail();
+}
+
+
+void scd_stm_terminate::set_idle(const sc_core::sc_time& time)
+{
+ scd_error("received future events while terminating");
+ set_fail();
+}
+
+
+void scd_stm_terminate::process()
+{
+ // check for failed slaves and react
+ if (!_check_slaves())
+ return;
+
+ if (_some_slaves_active())
+ {
+ // not all slaves have terminated yet
+ return;
+ }
+ else
+ {
+ // all slaves terminated
+ _sim.get_chan_man().close();
+ _close_slaves();
+ _fsm.set_state(_st_terminated);
+ }
+}