1 #ifndef SCD_STSW_BASE_H
2 #define SCD_STSW_BASE_H
4 #include "scd_simulator.h"
5 #include "fsm/scd_cont_state.h"
6 #include "fsm/scd_cont_wrapper_if.h"
9 /* forward declaration */
10 class scd_cont_slave_wrapper;
14 * Base class for all control slave wrapper states.
16 class scd_stsw_base : public scd_cont_state, public scd_cont_wrapper_if
21 * \param sim the simulation environment
22 * \param fsm the FSM of this state
24 scd_stsw_base(scd_simulator& sim, scd_cont_slave_wrapper& fsm);
26 virtual ~scd_stsw_base() {}
29 * Signalizes the state that the slave has been connected to the wrapper.
31 virtual void set_connected();
34 * Signalizes the state that a failed command has been received
37 virtual void set_failed();
40 * Signalizes the state that a time_nack command has been received
43 virtual void recv_time_nack() {}
46 * Signalizes the state that a time_ack command has been received
49 virtual void recv_time_ack() {}
52 * Signalizes the state that a term_nack command has been received
55 virtual void recv_term_nack() {}
58 * Signalizes the state that a term_ack command has been received
61 virtual void recv_term_ack() {}
63 /* scd_cont_wrapper_if */
65 void send_time_nack() {}
66 void send_time(const sc_core::sc_time& time);
68 void send_term_nack() {};
70 bool time_req() const;
71 bool time_ack() const;
72 bool term_req() const;
73 bool term_ack() const;
79 void set_idle(const sc_core::sc_time& time);
86 bool advance_time() const;
87 const sc_core::sc_time& get_time_step();
90 scd_cont_slave_wrapper& _fsm;
91 sc_core::sc_time& _time_step;
92 scd_cont_state& _st_init;
93 scd_cont_state& _st_busy;
94 scd_cont_state& _st_idle;
95 scd_cont_state& _st_done;
96 scd_cont_state& _st_time_req;
97 scd_cont_state& _st_time_ack;
98 scd_cont_state& _st_term_req;
99 scd_cont_state& _st_term_ack;
100 scd_cont_state& _st_terminate;
101 scd_cont_state& _st_terminated;
102 scd_cont_state& _st_fail;
103 scd_cont_state& _st_failed;