dol: initial dol commit
[jump.git] / dol / src / dol / visitor / hdsd / scd / fsm / scd_stm_busy.cpp
diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_busy.cpp b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_busy.cpp
new file mode 100644 (file)
index 0000000..fcb322c
--- /dev/null
@@ -0,0 +1,34 @@
+#include "fsm/scd_stm_busy.h"
+
+#include "scd_logging.h"
+#include "scd_exception.h"
+#include "scd_cont_man_master.h"
+
+
+void scd_stm_busy::set_idle(const sc_core::sc_time& time)
+{
+    /* prevents the situation where no events exist, but a huge
+     * ammount of data is being transferred that will generate events later
+     */
+    if (_sim.get_poller().wait(SCD_CONT_DELAY))
+        return;
+
+    _time_step = time;
+    _fsm.set_state(_st_idle);
+}
+
+
+void scd_stm_busy::set_done()
+{
+    /* prevents the situation where no events exist, but a huge
+     * ammount of data is being transferred that will generate events later
+     */
+    if (_sim.get_poller().wait(SCD_CONT_DELAY))
+        return;
+
+    _time_step = sc_core::SC_ZERO_TIME;
+    _fsm.set_state(_st_done);
+}
+
+
+bool scd_stm_busy::busy() const { return true; }