dol: initial dol commit
[jump.git] / dol / src / dol / visitor / hdsd / scd / fsm / scd_stm_init.cpp
diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_init.cpp b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_init.cpp
new file mode 100644 (file)
index 0000000..3027ad8
--- /dev/null
@@ -0,0 +1,58 @@
+#include "fsm/scd_stm_init.h"
+
+#include "scd_logging.h"
+#include "scd_exception.h"
+#include "scd_cont_man_master.h"
+
+
+void scd_stm_init::set_idle(const sc_core::sc_time& time)
+{
+    scd_error("init: illegal call to set_idle()");
+    throw scd_exception("illegal call");
+}
+
+
+void scd_stm_init::set_busy()
+{
+    scd_error("init: illegal call to set_busy()");
+    throw scd_exception("illegal call");
+}
+
+
+void scd_stm_init::set_done()
+{
+    scd_error("init: illegal call to set_done()");
+    throw scd_exception("illegal call");
+}
+
+
+void scd_stm_init::process()
+{
+    // check for failed slaves and react
+    if (!_check_slaves())
+        return;
+
+    std::list<scd_cont_slave_wrapper*>::iterator iter;
+
+    for (iter = _slaves.begin(); iter != _slaves.end(); iter++)
+    {
+        // if this is still in init state we terminate
+        if ( !(*iter)->active() )
+            return;
+    }
+
+    // all slaves are active
+    scd_info("all slaves connected");
+    _fsm.set_state(_st_busy);
+
+} // process()
+
+
+bool scd_stm_init::active() const { return false; }
+
+
+bool scd_stm_init::advance_time() const
+{
+    scd_error("illegal call to advance_time()");
+    throw scd_exception("illegal call");
+}