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_MODULE_H_
00038 #define RC_MODULE_H_
00039
00040 #include "ReChannel/core/rc_process_support.h"
00041
00042 namespace ReChannel {
00043
00044 struct rc_module;
00045
00046 typedef sc_module_name rc_module_name;
00047 typedef rc_module rc_channel;
00048 typedef rc_module rc_behavior;
00049
00053 struct rc_module
00054 : public sc_module,
00055 virtual public rc_resettable
00056 {
00057 protected:
00058 rc_module()
00059 { rc_register_resettable(*this, this); }
00060
00061 rc_module(rc_module_name name_)
00062 { rc_register_resettable(*this, this); }
00063
00064 protected:
00065
00066
00067
00068 inline void next_trigger()
00069 { rc_next_trigger(); }
00070
00071 inline void next_trigger(const sc_event& e)
00072 { rc_next_trigger(e); }
00073
00074 inline void next_trigger(sc_event_or_list& el)
00075 { rc_next_trigger(el); }
00076
00077 inline void next_trigger(sc_event_and_list& el)
00078 { rc_next_trigger(el); }
00079
00080 inline void next_trigger(const sc_time& t)
00081 { rc_next_trigger(t); }
00082
00083 inline void next_trigger(double v, sc_time_unit tu)
00084 { rc_next_trigger(v, tu); }
00085
00086 inline void next_trigger(const sc_time& t, const sc_event& e)
00087 { rc_next_trigger(t, e); }
00088
00089 inline void next_trigger(double v, sc_time_unit tu, const sc_event& e)
00090 { rc_next_trigger(v, tu, e); }
00091
00092 inline void next_trigger(const sc_time& t, sc_event_or_list& el)
00093 { rc_next_trigger(t, el); }
00094
00095 inline void next_trigger(
00096 double v, sc_time_unit t, sc_event_or_list& el)
00097 { rc_next_trigger(v, t, el); }
00098
00099 inline void next_trigger(const sc_time& t, sc_event_and_list& el)
00100 { rc_next_trigger(t, el); }
00101
00102 inline void next_trigger(
00103 double v, sc_time_unit tu, sc_event_and_list& el)
00104 { rc_next_trigger(v, tu, el); }
00105
00106
00107
00108 inline void wait()
00109 { rc_wait(); }
00110
00111 inline void wait(int n)
00112 { rc_wait(n); }
00113
00114 inline void wait(const sc_event& e)
00115 { rc_wait(e); }
00116
00117 inline void wait(sc_event_or_list& el)
00118 { rc_wait(el); }
00119
00120 inline void wait(sc_event_and_list& el)
00121 { rc_wait(el); }
00122
00123 inline void wait(const sc_time& t)
00124 { rc_wait(t); }
00125
00126 inline void wait(double v, sc_time_unit tu)
00127 { rc_wait(v, tu); }
00128
00129 inline void wait(const sc_time& t, const sc_event& e)
00130 { rc_wait(t, e); }
00131
00132 inline void wait(double v, sc_time_unit tu, const sc_event& e)
00133 { rc_wait(v, tu, e); }
00134
00135 inline void wait(const sc_time& t, sc_event_or_list& el)
00136 { rc_wait(t, el); }
00137
00138 inline void wait(double v, sc_time_unit t, sc_event_or_list& el)
00139 { rc_wait(v, t, el); }
00140
00141 inline void wait(const sc_time& t, sc_event_and_list& el)
00142 { rc_wait(t, el); }
00143
00144 inline void wait(double v, sc_time_unit tu, sc_event_and_list& el)
00145 { rc_wait(v, tu, el); }
00146
00147 virtual void rc_on_reset() {}
00148
00149 virtual void rc_on_init_resettable() {}
00150
00151 virtual ~rc_module() {}
00152 };
00153
00154 }
00155
00156 #define RC_MODULE(user_module_name) \
00157 struct user_module_name \
00158 : public ::ReChannel::rc_module
00159
00160 #define RC_CTOR(user_module_name) \
00161 RC_HAS_PROCESS(user_module_name); \
00162 user_module_name(sc_module_name)
00163
00164 #endif //RC_MODULE_H_
00165
00166
00167
00168
00169