X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_stm_base.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_stm_base.h;h=6b8463f86f3e517f353c17bcc2219f0e41cdbf87;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_base.h b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_base.h new file mode 100644 index 0000000..6b8463f --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/fsm/scd_stm_base.h @@ -0,0 +1,64 @@ +#ifndef SCD_STM_BASE_H +#define SCD_STM_BASE_H + +#include + +#include "scd_simulator.h" +#include "scd_cont_slave_wrapper.h" +#include "fsm/scd_cont_state.h" + + +/* forward declaration */ +class scd_cont_man_master; + + +/** + * Base class for all control master states. + */ +class scd_stm_base : public scd_cont_state +{ +public: + /** + * Constructor. + * \param sim the simulation environment + * \param fsm the FSM of this state + */ + scd_stm_base(scd_simulator& sim, scd_cont_man_master& fsm); + + virtual ~scd_stm_base() {} + + /* scd_cont_fsm_if */ + void set_busy() {} + void set_idle(const sc_core::sc_time& time) {} + void set_done() {} + void set_fail(); + void process(); + bool active() const; + bool busy() const; + bool failed() const; + bool advance_time() const; + const sc_core::sc_time& get_time_step(); + +protected: + scd_cont_man_master& _fsm; + std::list& _slaves; + sc_core::sc_time& _time_step; + scd_cont_state& _st_init; + scd_cont_state& _st_busy; + scd_cont_state& _st_idle; + scd_cont_state& _st_done; + scd_cont_state& _st_time_req; + scd_cont_state& _st_time; + scd_cont_state& _st_term_req; + scd_cont_state& _st_terminate; + scd_cont_state& _st_terminated; + scd_cont_state& _st_fail; + scd_cont_state& _st_failed; + + /* member functions */ + bool _check_slaves(); + bool _some_slaves_active(); + void _close_slaves(); +}; + +#endif