1 #include "fsm/scd_sts_init.h"
3 #include "scd_logging.h"
4 #include "scd_exception.h"
5 #include "scd_cont_man_slave.h"
8 void scd_sts_init::set_failed()
10 _fsm.set_state(_st_failed);
14 void scd_sts_init::set_idle(const sc_core::sc_time& time)
16 scd_error("init: illegal call to set_idle()");
17 throw scd_exception("illegal call");
21 void scd_sts_init::set_busy()
23 scd_error("init: illegal call to set_busy()");
24 throw scd_exception("illegal call");
28 void scd_sts_init::set_done()
30 scd_error("init: illegal call to set_done()");
31 throw scd_exception("illegal call");
35 void scd_sts_init::set_fail()
37 _fsm.set_state(_st_failed);
41 void scd_sts_init::process()
45 if (!_connector.is_connecting() && !_connector.has_connection())
47 // unable to connect to master
48 scd_error("connecting to master failed");
49 _fsm.set_state(_st_failed);
51 else if (!_connector.is_connecting() && _connector.has_connection())
53 // successfully connected to master
54 scd_info("connected to master");
56 _sim.get_poller().register_handler(_fsm, SOCK_EV_READ | SOCK_EV_CLOSE);
57 _fsm.set_state(_st_busy);
63 bool scd_sts_init::active() const { return false; }
66 bool scd_sts_init::advance_time() const
68 scd_error("illegal call to advance_time()");
69 throw scd_exception("illegal call");