X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_sts_init.cpp;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_sts_init.cpp;h=d4d05e900bc31d33ee0fc5504c3a18091760d9da;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_init.cpp b/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_init.cpp new file mode 100644 index 0000000..d4d05e9 --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_init.cpp @@ -0,0 +1,70 @@ +#include "fsm/scd_sts_init.h" + +#include "scd_logging.h" +#include "scd_exception.h" +#include "scd_cont_man_slave.h" + + +void scd_sts_init::set_failed() +{ + _fsm.set_state(_st_failed); +} + + +void scd_sts_init::set_idle(const sc_core::sc_time& time) +{ + scd_error("init: illegal call to set_idle()"); + throw scd_exception("illegal call"); +} + + +void scd_sts_init::set_busy() +{ + scd_error("init: illegal call to set_busy()"); + throw scd_exception("illegal call"); +} + + +void scd_sts_init::set_done() +{ + scd_error("init: illegal call to set_done()"); + throw scd_exception("illegal call"); +} + + +void scd_sts_init::set_fail() +{ + _fsm.set_state(_st_failed); +} + + +void scd_sts_init::process() +{ + _connector.process(); + + if (!_connector.is_connecting() && !_connector.has_connection()) + { + // unable to connect to master + scd_error("connecting to master failed"); + _fsm.set_state(_st_failed); + } + else if (!_connector.is_connecting() && _connector.has_connection()) + { + // successfully connected to master + scd_info("connected to master"); + _fsm.set_socket(); + _sim.get_poller().register_handler(_fsm, SOCK_EV_READ | SOCK_EV_CLOSE); + _fsm.set_state(_st_busy); + } + +} // process() + + +bool scd_sts_init::active() const { return false; } + + +bool scd_sts_init::advance_time() const +{ + scd_error("illegal call to advance_time()"); + throw scd_exception("illegal call"); +}