00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00037 #ifndef RC_PRIM_CHANNEL_H_
00038 #define RC_PRIM_CHANNEL_H_
00039
00040 #include "ReChannel/core/rc_reconfigurable.h"
00041
00042 namespace ReChannel {
00043
00047 class rc_prim_channel
00048 : public sc_prim_channel,
00049 virtual public rc_resettable
00050 {
00051 public:
00052
00053 rc_prim_channel()
00054 : sc_prim_channel(), p_constr_done(false)
00055 {
00056 p_reconf =
00057 rc_register_resettable(*this, this->get_parent_object());
00058 }
00059
00060 explicit rc_prim_channel(const char* name_)
00061 : sc_prim_channel(name_), p_constr_done(false)
00062 {
00063 p_reconf =
00064 rc_register_resettable(*this, this->get_parent_object());
00065 }
00066
00067 protected:
00068
00069 inline bool rc_has_reconfigurable() const
00070 { return (p_reconf != NULL); }
00071
00072 inline const rc_reconfigurable* rc_get_reconfigurable() const
00073 { return p_reconf; }
00074
00075 inline bool rc_is_constr_done() const
00076 { return p_constr_done; }
00077
00078 inline rc_reconfigurable::state_type rc_get_state() const
00079 {
00080 return (p_reconf != NULL ?
00081 p_reconf->rc_get_state() : rc_reconfigurable::ACTIVE);
00082 }
00083
00084 inline rc_reconfigurable::state_type rc_get_next_state() const
00085 {
00086 return (p_reconf != NULL ?
00087 p_reconf->rc_get_next_state() : rc_reconfigurable::ACTIVE);
00088 }
00089
00090 inline bool rc_is_loaded() const
00091 { return (this->rc_get_state() != rc_reconfigurable::UNLOADED); }
00092
00093 inline bool rc_is_active() const
00094 { return (this->rc_get_state() == rc_reconfigurable::ACTIVE); }
00095
00096
00097
00098 inline void next_trigger()
00099 { rc_next_trigger(); }
00100
00101 inline void next_trigger(const sc_event& e)
00102 { rc_next_trigger(e); }
00103
00104 inline void next_trigger(sc_event_or_list& el)
00105 { rc_next_trigger(el); }
00106
00107 inline void next_trigger(sc_event_and_list& el)
00108 { rc_next_trigger(el); }
00109
00110 inline void next_trigger(const sc_time& t)
00111 { rc_next_trigger(t); }
00112
00113 inline void next_trigger(double v, sc_time_unit tu)
00114 { rc_next_trigger(v, tu); }
00115
00116 inline void next_trigger(const sc_time& t, const sc_event& e)
00117 { rc_next_trigger(t, e); }
00118
00119 inline void next_trigger(double v, sc_time_unit tu, const sc_event& e)
00120 { rc_next_trigger(v, tu, e); }
00121
00122 inline void next_trigger(const sc_time& t, sc_event_or_list& el)
00123 { rc_next_trigger(t, el); }
00124
00125 inline void next_trigger(
00126 double v, sc_time_unit t, sc_event_or_list& el)
00127 { rc_next_trigger(v, t, el); }
00128
00129 inline void next_trigger(const sc_time& t, sc_event_and_list& el)
00130 { rc_next_trigger(t, el); }
00131
00132 inline void next_trigger(
00133 double v, sc_time_unit tu, sc_event_and_list& el)
00134 { rc_next_trigger(v, tu, el); }
00135
00136
00137
00138 inline void wait()
00139 { rc_wait(); }
00140
00141 inline void wait(int n)
00142 { rc_wait(n); }
00143
00144 inline void wait(const sc_event& e)
00145 { rc_wait(e); }
00146
00147 inline void wait(sc_event_or_list& el)
00148 { rc_wait(el); }
00149
00150 inline void wait(sc_event_and_list& el)
00151 { rc_wait(el); }
00152
00153 inline void wait(const sc_time& t)
00154 { rc_wait(t); }
00155
00156 inline void wait(double v, sc_time_unit tu)
00157 { rc_wait(v, tu); }
00158
00159 inline void wait(const sc_time& t, const sc_event& e)
00160 { rc_wait(t, e); }
00161
00162 inline void wait(double v, sc_time_unit tu, const sc_event& e)
00163 { rc_wait(v, tu, e); }
00164
00165 inline void wait(const sc_time& t, sc_event_or_list& el)
00166 { rc_wait(t, el); }
00167
00168 inline void wait(double v, sc_time_unit t, sc_event_or_list& el)
00169 { rc_wait(v, t, el); }
00170
00171 inline void wait(const sc_time& t, sc_event_and_list& el)
00172 { rc_wait(t, el); }
00173
00174 inline void wait(double v, sc_time_unit tu, sc_event_and_list& el)
00175 { rc_wait(v, tu, el); }
00176
00177 virtual void start_of_simulation()
00178 {
00179 p_constr_done = true;
00180 }
00181
00182 RC_ON_INIT_RESETTABLE() {}
00183
00184 RC_ON_RESET() {}
00185
00186 private:
00187 const rc_reconfigurable* p_reconf;
00188 bool p_constr_done;
00189
00190 private:
00191
00192 rc_prim_channel(const rc_prim_channel& other);
00193 rc_prim_channel& operator=(const rc_prim_channel& other);
00194 };
00195
00196 }
00197
00198 #endif //RC_PRIM_CHANNEL_H_
00199
00200
00201
00202
00203