dol: initial dol commit
[jump.git] / dol / src / dol / visitor / hdsd / scd / fsm / scd_stm_init.cpp
1 #include "fsm/scd_stm_init.h"
2
3 #include "scd_logging.h"
4 #include "scd_exception.h"
5 #include "scd_cont_man_master.h"
6
7
8 void scd_stm_init::set_idle(const sc_core::sc_time& time)
9 {
10     scd_error("init: illegal call to set_idle()");
11     throw scd_exception("illegal call");
12 }
13
14
15 void scd_stm_init::set_busy()
16 {
17     scd_error("init: illegal call to set_busy()");
18     throw scd_exception("illegal call");
19 }
20
21
22 void scd_stm_init::set_done()
23 {
24     scd_error("init: illegal call to set_done()");
25     throw scd_exception("illegal call");
26 }
27
28
29 void scd_stm_init::process()
30 {
31     // check for failed slaves and react
32     if (!_check_slaves())
33         return;
34
35     std::list<scd_cont_slave_wrapper*>::iterator iter;
36
37     for (iter = _slaves.begin(); iter != _slaves.end(); iter++)
38     {
39         // if this is still in init state we terminate
40         if ( !(*iter)->active() )
41             return;
42     }
43
44     // all slaves are active
45     scd_info("all slaves connected");
46     _fsm.set_state(_st_busy);
47
48 } // process()
49
50
51 bool scd_stm_init::active() const { return false; }
52
53
54 bool scd_stm_init::advance_time() const
55 {
56     scd_error("illegal call to advance_time()");
57     throw scd_exception("illegal call");
58 }