X-Git-Url: http://sraa.de/git/?a=blobdiff_plain;f=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_sts_base.h;fp=dol%2Fsrc%2Fdol%2Fvisitor%2Fhdsd%2Fscd%2Ffsm%2Fscd_sts_base.h;h=05c1e8d4899d2119789fdc01b736ee600ce73da7;hb=8c411cf24ed0eb889191aaeafd8fa1e69081df42;hp=0000000000000000000000000000000000000000;hpb=dea7a4fb1ed110d3ce6e6d9255103d724bd66c0e;p=jump.git diff --git a/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_base.h b/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_base.h new file mode 100644 index 0000000..05c1e8d --- /dev/null +++ b/dol/src/dol/visitor/hdsd/scd/fsm/scd_sts_base.h @@ -0,0 +1,101 @@ +#ifndef SCD_STS_BASE_H +#define SCD_STS_BASE_H + +#include "scd_simulator.h" +#include "scd_out_connector.h" +#include "scd_command_writer.h" +#include "scd_command_reader.h" +#include "fsm/scd_cont_state.h" + + +/* forward declaration */ +class scd_cont_man_slave; + + +/** + * Base class for all control slave states. + */ +class scd_sts_base : public scd_cont_state +{ +public: + /** + * Constructor. + * \param sim the simulation environment + * \param fsm the FSM of this state + */ + scd_sts_base(scd_simulator& sim, scd_cont_man_slave& fsm); + + virtual ~scd_sts_base() {} + + /** + * Signalizes the state, that a failed message has been received + * from the master. + */ + virtual void set_failed(); + + /** + * Signalizes the state, that a time_req message has been received + * from the master. + */ + virtual void recv_time_req(); + + /** + * Signalizes the state, that a time_nack message has been received + * from the master. + */ + virtual void recv_time_nack() {} + + /** + * Signalizes the state, that a time message has been received + * from the master. + */ + virtual void recv_time(const sc_core::sc_time& time); + + /** + * Signalizes the state, that a term_req message has been received + * from the master. + */ + virtual void recv_term_req(); + + /** + * Signalizes the state, that a term_nack message has been received + * from the master. + */ + virtual void recv_term_nack() {} + + /** + * Signalizes the state, that a term message has been received + * from the master. + */ + virtual void recv_term(); + + /* 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_slave& _fsm; + scd_command_writer& _writer; + scd_command_reader& _reader; + scd_out_connector& _connector; + 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_ack; + scd_cont_state& _st_time; + scd_cont_state& _st_term_ack; + scd_cont_state& _st_terminated; + scd_cont_state& _st_fail; + scd_cont_state& _st_failed; +}; + +#endif