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 
00026 
00027 
00028 
00029 
00030 #ifndef SC_SENSITIVE_H
00031 #define SC_SENSITIVE_H
00032 
00033 #include "sysc/kernel/sc_process.h"
00034 
00035 namespace sc_dt
00036 {
00037     class sc_logic;
00038 }
00039 
00040 namespace sc_core {
00041 
00042 class sc_process_handle;
00043 class sc_event;
00044 class sc_event_finder;
00045 class sc_interface;
00046 class sc_module;
00047 class sc_port_base;
00048 template <class T> class sc_in;
00049 template <class T> class sc_inout;
00050 template <class T> class sc_signal_in_if;
00051 
00052 
00053 
00054 
00055 
00056 
00057 
00058 
00059 class sc_sensitive
00060 {
00061     friend class sc_module;
00062 
00063     
00064     friend class sc_channel;
00065 
00066 public:
00067 
00068     
00069     typedef sc_signal_in_if<bool>            in_if_b_type;
00070     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00071     typedef sc_in<bool>                      in_port_b_type;
00072     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00073     typedef sc_inout<bool>                   inout_port_b_type;
00074     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00075 
00076 private:
00077 
00078     
00079     explicit sc_sensitive( sc_module* );
00080 
00081     
00082     ~sc_sensitive();
00083 
00084 public:
00085 
00086     
00087     sc_sensitive& operator << ( sc_process_handle );
00088 #if 0
00089     sc_sensitive& operator << ( sc_method_handle );
00090     sc_sensitive& operator << ( sc_thread_handle );
00091 #endif // 0
00092 
00093     sc_sensitive& operator () ( const sc_event& );
00094     sc_sensitive& operator () ( const sc_interface& );
00095     sc_sensitive& operator () ( const sc_port_base& );
00096     sc_sensitive& operator () ( sc_event_finder& );
00097 
00098     sc_sensitive& operator << ( const sc_event& );
00099     sc_sensitive& operator << ( const sc_interface& );
00100     sc_sensitive& operator << ( const sc_port_base& );
00101     sc_sensitive& operator << ( sc_event_finder& );
00102 
00103     sc_sensitive& operator () ( sc_cthread_handle, sc_event_finder& );
00104     sc_sensitive& operator () ( sc_cthread_handle, const in_if_b_type& );
00105     sc_sensitive& operator () ( sc_cthread_handle, const in_if_l_type& );
00106     sc_sensitive& operator () ( sc_cthread_handle, const in_port_b_type& );
00107     sc_sensitive& operator () ( sc_cthread_handle, const in_port_l_type& );
00108     sc_sensitive& operator () ( sc_cthread_handle, const inout_port_b_type& );
00109     sc_sensitive& operator () ( sc_cthread_handle, const inout_port_l_type& );
00110 
00111     static void make_static_sensitivity( sc_process_b*, const sc_event& );
00112     static void make_static_sensitivity( sc_process_b*, const sc_interface& );
00113     static void make_static_sensitivity( sc_process_b*, const sc_port_base&);
00114     static void make_static_sensitivity( sc_process_b*, sc_event_finder& );
00115 
00116     void reset();
00117 
00118 private:
00119 
00120     sc_module*                                m_module;
00121     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00122     sc_process_b*                          m_handle;
00123 
00124 private:
00125 
00126     
00127 
00128     sc_sensitive();
00129     sc_sensitive( const sc_sensitive& );
00130     sc_sensitive& operator = ( const sc_sensitive& );
00131 };
00132 
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 class sc_sensitive_pos
00141 {
00142     friend class sc_module;
00143 
00144     
00145     friend class sc_channel;
00146 
00147 public:
00148 
00149     
00150     typedef sc_signal_in_if<bool>            in_if_b_type;
00151     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00152     typedef sc_in<bool>                      in_port_b_type;
00153     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00154     typedef sc_inout<bool>                   inout_port_b_type;
00155     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00156 
00157 private:
00158 
00159     
00160     explicit sc_sensitive_pos( sc_module* );
00161 
00162     
00163     ~sc_sensitive_pos();
00164 
00165 public:
00166 
00167     
00168     sc_sensitive_pos& operator << ( sc_process_handle );
00169     sc_sensitive_pos& operator << ( sc_method_handle );
00170     sc_sensitive_pos& operator << ( sc_thread_handle );
00171 
00172     sc_sensitive_pos& operator () ( const in_if_b_type& );
00173     sc_sensitive_pos& operator () ( const in_if_l_type& );
00174     sc_sensitive_pos& operator () ( const in_port_b_type& );
00175     sc_sensitive_pos& operator () ( const in_port_l_type& );
00176     sc_sensitive_pos& operator () ( const inout_port_b_type& );
00177     sc_sensitive_pos& operator () ( const inout_port_l_type& );
00178 
00179     sc_sensitive_pos& operator << ( const in_if_b_type& );
00180     sc_sensitive_pos& operator << ( const in_if_l_type& );
00181     sc_sensitive_pos& operator << ( const in_port_b_type& );
00182     sc_sensitive_pos& operator << ( const in_port_l_type& );
00183     sc_sensitive_pos& operator << ( const inout_port_b_type& );
00184     sc_sensitive_pos& operator << ( const inout_port_l_type& );
00185 
00186     void reset();
00187 
00188 private:
00189 
00190     sc_module*                                m_module;
00191     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00192     sc_process_b*                          m_handle;
00193 
00194 private:
00195 
00196     
00197     sc_sensitive_pos();
00198     sc_sensitive_pos( const sc_sensitive_pos& );
00199     sc_sensitive_pos& operator = ( const sc_sensitive_pos& );
00200 };
00201 
00202 
00203 
00204 
00205 
00206 
00207 
00208 
00209 class sc_sensitive_neg
00210 {
00211     friend class sc_module;
00212 
00213     
00214     friend class sc_channel;
00215 
00216 public:
00217 
00218     
00219     typedef sc_signal_in_if<bool>            in_if_b_type;
00220     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00221     typedef sc_in<bool>                      in_port_b_type;
00222     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00223     typedef sc_inout<bool>                   inout_port_b_type;
00224     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00225 
00226 private:
00227 
00228     
00229     explicit sc_sensitive_neg( sc_module* );
00230 
00231     
00232     ~sc_sensitive_neg();
00233 
00234 public:
00235 
00236     
00237     sc_sensitive_neg& operator << ( sc_process_handle );
00238     sc_sensitive_neg& operator << ( sc_method_handle );
00239     sc_sensitive_neg& operator << ( sc_thread_handle );
00240 
00241     sc_sensitive_neg& operator () ( const in_if_b_type& );
00242     sc_sensitive_neg& operator () ( const in_if_l_type& );
00243     sc_sensitive_neg& operator () ( const in_port_b_type& );
00244     sc_sensitive_neg& operator () ( const in_port_l_type& );
00245     sc_sensitive_neg& operator () ( const inout_port_b_type& );
00246     sc_sensitive_neg& operator () ( const inout_port_l_type& );
00247 
00248     sc_sensitive_neg& operator << ( const in_if_b_type& );
00249     sc_sensitive_neg& operator << ( const in_if_l_type& );
00250     sc_sensitive_neg& operator << ( const in_port_b_type& );
00251     sc_sensitive_neg& operator << ( const in_port_l_type& );
00252     sc_sensitive_neg& operator << ( const inout_port_b_type& );
00253     sc_sensitive_neg& operator << ( const inout_port_l_type& );
00254 
00255     void reset();
00256 
00257 private:
00258 
00259     sc_module*                                m_module;
00260     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00261     sc_process_b*                          m_handle;
00262 
00263 private:
00264 
00265     
00266     sc_sensitive_neg();
00267     sc_sensitive_neg( const sc_sensitive_neg& );
00268     sc_sensitive_neg& operator = ( const sc_sensitive_neg& );
00269 };
00270 
00271 } 
00272 
00273 #endif
00274 
00275 
00276 
00277 
00278 
00279 
00280 
00281 
00282 
00283 
00284 
00285 
00286 
00287 
00288 
00289 
00290 
00291 
00292 
00293 
00294 
00295 
00296 
00297 
00298 
00299 
00300 
00301 
00302 
00303 
00304 
00305 
00306 
00307 
00308 
00309 
00310 
00311 
00312 
00313