X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_stm_terminate.cpp;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_stm_terminate.cpp;h=303532164aedb6b58a23423818d41ce9f791bd10;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_terminate.cpp b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_terminate.cpp new file mode 100644 index 0000000..3035321 --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_terminate.cpp @@ -0,0 +1,40 @@ +#include "fsm/scd_stm_terminate.h" + +#include "scd_logging.h" +#include "scd_exception.h" +#include "scd_cont_man_master.h" + + +void scd_stm_terminate::set_busy() +{ + scd_error("received further events while terminating"); + set_fail(); +} + + +void scd_stm_terminate::set_idle(const sc_core::sc_time& time) +{ + scd_error("received future events while terminating"); + set_fail(); +} + + +void scd_stm_terminate::process() +{ + // check for failed slaves and react + if (!_check_slaves()) + return; + + if (_some_slaves_active()) + { + // not all slaves have terminated yet + return; + } + else + { + // all slaves terminated + _sim.get_chan_man().close(); + _close_slaves(); + _fsm.set_state(_st_terminated); + } +}