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_ABSTRACT_FILTER_H_
00038 #define RC_ABSTRACT_FILTER_H_
00039
00040 #include "ReChannel/core/rc_reconfigurable.h"
00041 #include "ReChannel/core/rc_transaction_counter.h"
00042 #include "ReChannel/communication/rc_interface_wrapper.h"
00043 #include "ReChannel/communication/accessors/rc_accessor.h"
00044
00045 namespace ReChannel {
00046
00050 template<class IF>
00051 class rc_abstract_filter
00052 : public rc_accessor<IF>,
00053 virtual public IF
00054 {
00055 RC_STATIC_ASSERT_VALID_INTERFACE(IF);
00056
00057 private:
00058 typedef rc_abstract_filter<IF> this_type;
00059
00060 protected:
00061 typedef rc_accessor<IF> accessor_type;
00062
00063 public:
00064 typedef IF if_type;
00065
00066 protected:
00067 rc_abstract_filter();
00068
00069 protected:
00070 inline rc_reconfigurable* rc_get_reconfigurable() const
00071 { return reconf; }
00072
00073 inline bool rc_is_deactivation_requested() const;
00074
00075 inline void rc_possible_deactivation()
00076 { this->_rc_possible_deactivation(false); }
00077
00078 inline void rc_nb_possible_deactivation()
00079 { this->_rc_possible_deactivation(true); }
00080
00081 inline void rc_cancel() const
00082 { throw new rc_process_cancel_exception(); }
00083
00084 inline void rc_nb_cancel() const
00085 { throw new rc_process_cancel_exception(); }
00086
00087
00088
00089 inline void next_trigger()
00090 { rc_next_trigger(); }
00091
00092 inline void next_trigger(const sc_event& e)
00093 { rc_next_trigger(e); }
00094
00095 inline void next_trigger(sc_event_or_list& el)
00096 { rc_next_trigger(el); }
00097
00098 inline void next_trigger(sc_event_and_list& el)
00099 { rc_next_trigger(el); }
00100
00101 inline void next_trigger(const sc_time& t)
00102 { rc_next_trigger(t); }
00103
00104 inline void next_trigger(double v, sc_time_unit tu)
00105 { rc_next_trigger(v, tu); }
00106
00107 inline void next_trigger(const sc_time& t, const sc_event& e)
00108 { rc_next_trigger(t, e); }
00109
00110 inline void next_trigger(double v, sc_time_unit tu, const sc_event& e)
00111 { rc_next_trigger(v, tu, e); }
00112
00113 inline void next_trigger(const sc_time& t, sc_event_or_list& el)
00114 { rc_next_trigger(t, el); }
00115
00116 inline void next_trigger(
00117 double v, sc_time_unit t, sc_event_or_list& el)
00118 { rc_next_trigger(v, t, el); }
00119
00120 inline void next_trigger(const sc_time& t, sc_event_and_list& el)
00121 { rc_next_trigger(t, el); }
00122
00123 inline void next_trigger(
00124 double v, sc_time_unit tu, sc_event_and_list& el)
00125 { rc_next_trigger(v, tu, el); }
00126
00127
00128
00129 inline void wait() const
00130 { rc_wait(); }
00131
00132 inline void wait(int n)
00133 { rc_wait(n); }
00134
00135 inline void wait(const sc_event& e)
00136 { rc_wait(e); }
00137
00138 inline void wait(sc_event_or_list& el)
00139 { rc_wait(el); }
00140
00141 inline void wait(sc_event_and_list& el)
00142 { rc_wait(el); }
00143
00144 inline void wait(const sc_time& t)
00145 { rc_wait(t); }
00146
00147 inline void wait(double v, sc_time_unit tu)
00148 { rc_wait(v, tu); }
00149
00150 inline void wait(const sc_time& t, const sc_event& e)
00151 { rc_wait(t, e); }
00152
00153 inline void wait(double v, sc_time_unit tu, const sc_event& e)
00154 { rc_wait(v, tu, e); }
00155
00156 inline void wait(const sc_time& t, sc_event_or_list& el)
00157 { rc_wait(t, el); }
00158
00159 inline void wait(double v, sc_time_unit t, sc_event_or_list& el)
00160 { rc_wait(v, t, el); }
00161
00162 inline void wait(const sc_time& t, sc_event_and_list& el)
00163 { rc_wait(t, el); }
00164
00165 inline void wait(double v, sc_time_unit tu, sc_event_and_list& el)
00166 { rc_wait(v, tu, el); }
00167
00168 private:
00169
00170 rc_reconfigurable* reconf;
00171
00172 private:
00173
00174 rc_abstract_filter(const this_type& other_);
00175 this_type& operator=(const this_type& other_);
00176 };
00177
00178
00179
00180 template<class IF>
00181 inline
00182 bool rc_abstract_filter<IF>::rc_is_deactivation_requested() const
00183 {
00184 if (reconf != NULL) {
00185 return reconf->rc_is_deactivation_requested();
00186 } else {
00187 return false;
00188 }
00189 }
00190
00191
00192
00193 template<class IF>
00194 rc_abstract_filter<IF>::rc_abstract_filter()
00195 : reconf(rc_get_reconfigurable_context())
00196 { }
00197
00198 }
00199
00200 #endif // RC_ABSTRACT_FILTER_H_
00201
00202
00203
00204
00205