sc_sensitive.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2006 by all Contributors.
00005   All Rights reserved.
00006 
00007   The contents of this file are subject to the restrictions and limitations
00008   set forth in the SystemC Open Source License Version 2.4 (the "License");
00009   You may not use this file except in compliance with such restrictions and
00010   limitations. You may obtain instructions on how to receive a copy of the
00011   License at http://www.systemc.org/. Software distributed by Contributors
00012   under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
00013   ANY KIND, either express or implied. See the License for the specific
00014   language governing rights and limitations under the License.
00015 
00016  *****************************************************************************/
00017 
00018 /*****************************************************************************
00019 
00020   sc_sensitive.h -- Sensitivity classes. Requires "sc_process.h"
00021   for declarations of sc_method_handle, &.c.
00022 
00023   Original Author: Stan Y. Liao, Synopsys, Inc.
00024                    Martin Janssen, Synopsys, Inc.
00025 
00026  *****************************************************************************/
00027 
00028 /*****************************************************************************
00029 
00030   MODIFICATION LOG - modifiers, enter your name, affiliation, date and
00031   changes you are making here.
00032 
00033       Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
00034                                25 August, 2003
00035   Description of Modification: Add make_static_sensitivity() methods to enable
00036                                dynamic method process creation with static 
00037                                sensitivity.
00038 
00039  *****************************************************************************/
00040 
00041 // $Log: sc_sensitive.h,v $
00042 // Revision 1.1.1.1  2006/12/15 20:31:37  acg
00043 // SystemC 2.2
00044 //
00045 // Revision 1.4  2006/04/11 23:13:21  acg
00046 //   Andy Goodrich: Changes for reduced reset support that only includes
00047 //   sc_cthread, but has preliminary hooks for expanding to method and thread
00048 //   processes also.
00049 //
00050 // Revision 1.3  2006/01/13 18:44:30  acg
00051 // Added $Log to record CVS changes into the source.
00052 //
00053 
00054 #ifndef SC_SENSITIVE_H
00055 #define SC_SENSITIVE_H
00056 
00057 #include "sysc/kernel/sc_process.h"
00058 
00059 namespace sc_dt
00060 {
00061     class sc_logic;
00062 }
00063 
00064 namespace sc_core {
00065 
00066 class sc_process_handle;
00067 class sc_event;
00068 class sc_event_finder;
00069 class sc_interface;
00070 class sc_module;
00071 class sc_port_base;
00072 template <class T> class sc_in;
00073 template <class T> class sc_inout;
00074 template <class T> class sc_signal_in_if;
00075 
00076 
00077 // ----------------------------------------------------------------------------
00078 //  CLASS : sc_sensitive
00079 //
00080 //  Static sensitivity class for events.
00081 // ----------------------------------------------------------------------------
00082 
00083 class sc_sensitive
00084 {
00085     friend class sc_module;
00086 
00087 public:
00088 
00089     // typedefs
00090     typedef sc_signal_in_if<bool>            in_if_b_type;
00091     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00092     typedef sc_in<bool>                      in_port_b_type;
00093     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00094     typedef sc_inout<bool>                   inout_port_b_type;
00095     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00096 
00097 private:
00098 
00099     // constructor
00100     explicit sc_sensitive( sc_module* );
00101 
00102     // destructor
00103     ~sc_sensitive();
00104 
00105 public:
00106 
00107     // changing between process handles
00108     sc_sensitive& operator << ( sc_process_handle );
00109 #if 0
00110     sc_sensitive& operator << ( sc_method_handle );
00111     sc_sensitive& operator << ( sc_thread_handle );
00112 #endif // 0
00113 
00114     sc_sensitive& operator () ( const sc_event& );
00115     sc_sensitive& operator () ( const sc_interface& );
00116     sc_sensitive& operator () ( const sc_port_base& );
00117     sc_sensitive& operator () ( sc_event_finder& );
00118 
00119     sc_sensitive& operator << ( const sc_event& );
00120     sc_sensitive& operator << ( const sc_interface& );
00121     sc_sensitive& operator << ( const sc_port_base& );
00122     sc_sensitive& operator << ( sc_event_finder& );
00123 
00124     sc_sensitive& operator () ( sc_cthread_handle, sc_event_finder& );
00125     sc_sensitive& operator () ( sc_cthread_handle, const in_if_b_type& );
00126     sc_sensitive& operator () ( sc_cthread_handle, const in_if_l_type& );
00127     sc_sensitive& operator () ( sc_cthread_handle, const in_port_b_type& );
00128     sc_sensitive& operator () ( sc_cthread_handle, const in_port_l_type& );
00129     sc_sensitive& operator () ( sc_cthread_handle, const inout_port_b_type& );
00130     sc_sensitive& operator () ( sc_cthread_handle, const inout_port_l_type& );
00131 
00132     static void make_static_sensitivity( sc_process_b*, const sc_event& );
00133     static void make_static_sensitivity( sc_process_b*, const sc_interface& );
00134     static void make_static_sensitivity( sc_process_b*, const sc_port_base&);
00135     static void make_static_sensitivity( sc_process_b*, sc_event_finder& );
00136 
00137     void reset();
00138 
00139 private:
00140 
00141     sc_module*                                m_module;
00142     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00143     sc_process_b*                          m_handle;
00144 
00145 private:
00146 
00147     // disabled
00148 
00149     sc_sensitive();
00150     sc_sensitive( const sc_sensitive& );
00151     sc_sensitive& operator = ( const sc_sensitive& );
00152 };
00153 
00154 
00155 // ----------------------------------------------------------------------------
00156 //  CLASS : sc_sensitive_pos
00157 //
00158 //  Static sensitivity class for positive edge events.
00159 // ----------------------------------------------------------------------------
00160 
00161 class sc_sensitive_pos
00162 {
00163     friend class sc_module;
00164 
00165 public:
00166 
00167     // typedefs
00168     typedef sc_signal_in_if<bool>            in_if_b_type;
00169     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00170     typedef sc_in<bool>                      in_port_b_type;
00171     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00172     typedef sc_inout<bool>                   inout_port_b_type;
00173     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00174 
00175 private:
00176 
00177     // constructor
00178     explicit sc_sensitive_pos( sc_module* );
00179 
00180     // destructor
00181     ~sc_sensitive_pos();
00182 
00183 public:
00184 
00185     // changing between process handles
00186     sc_sensitive_pos& operator << ( sc_process_handle );
00187     sc_sensitive_pos& operator << ( sc_method_handle );
00188     sc_sensitive_pos& operator << ( sc_thread_handle );
00189 
00190     sc_sensitive_pos& operator () ( const in_if_b_type& );
00191     sc_sensitive_pos& operator () ( const in_if_l_type& );
00192     sc_sensitive_pos& operator () ( const in_port_b_type& );
00193     sc_sensitive_pos& operator () ( const in_port_l_type& );
00194     sc_sensitive_pos& operator () ( const inout_port_b_type& );
00195     sc_sensitive_pos& operator () ( const inout_port_l_type& );
00196 
00197     sc_sensitive_pos& operator << ( const in_if_b_type& );
00198     sc_sensitive_pos& operator << ( const in_if_l_type& );
00199     sc_sensitive_pos& operator << ( const in_port_b_type& );
00200     sc_sensitive_pos& operator << ( const in_port_l_type& );
00201     sc_sensitive_pos& operator << ( const inout_port_b_type& );
00202     sc_sensitive_pos& operator << ( const inout_port_l_type& );
00203 
00204     void reset();
00205 
00206 private:
00207 
00208     sc_module*                                m_module;
00209     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00210     sc_process_b*                          m_handle;
00211 
00212 private:
00213 
00214     // disabled
00215     sc_sensitive_pos();
00216     sc_sensitive_pos( const sc_sensitive_pos& );
00217     sc_sensitive_pos& operator = ( const sc_sensitive_pos& );
00218 };
00219 
00220 
00221 // ----------------------------------------------------------------------------
00222 //  CLASS : sc_sensitive_neg
00223 //
00224 //  Static sensitivity class for negative edge events.
00225 // ----------------------------------------------------------------------------
00226 
00227 class sc_sensitive_neg
00228 {
00229     friend class sc_module;
00230 
00231 public:
00232 
00233     // typedefs
00234     typedef sc_signal_in_if<bool>            in_if_b_type;
00235     typedef sc_signal_in_if<sc_dt::sc_logic> in_if_l_type;
00236     typedef sc_in<bool>                      in_port_b_type;
00237     typedef sc_in<sc_dt::sc_logic>           in_port_l_type;
00238     typedef sc_inout<bool>                   inout_port_b_type;
00239     typedef sc_inout<sc_dt::sc_logic>        inout_port_l_type;
00240 
00241 private:
00242 
00243     // constructor
00244     explicit sc_sensitive_neg( sc_module* );
00245 
00246     // destructor
00247     ~sc_sensitive_neg();
00248 
00249 public:
00250 
00251     // changing between process handles
00252     sc_sensitive_neg& operator << ( sc_process_handle );
00253     sc_sensitive_neg& operator << ( sc_method_handle );
00254     sc_sensitive_neg& operator << ( sc_thread_handle );
00255 
00256     sc_sensitive_neg& operator () ( const in_if_b_type& );
00257     sc_sensitive_neg& operator () ( const in_if_l_type& );
00258     sc_sensitive_neg& operator () ( const in_port_b_type& );
00259     sc_sensitive_neg& operator () ( const in_port_l_type& );
00260     sc_sensitive_neg& operator () ( const inout_port_b_type& );
00261     sc_sensitive_neg& operator () ( const inout_port_l_type& );
00262 
00263     sc_sensitive_neg& operator << ( const in_if_b_type& );
00264     sc_sensitive_neg& operator << ( const in_if_l_type& );
00265     sc_sensitive_neg& operator << ( const in_port_b_type& );
00266     sc_sensitive_neg& operator << ( const in_port_l_type& );
00267     sc_sensitive_neg& operator << ( const inout_port_b_type& );
00268     sc_sensitive_neg& operator << ( const inout_port_l_type& );
00269 
00270     void reset();
00271 
00272 private:
00273 
00274     sc_module*                                m_module;
00275     enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
00276     sc_process_b*                          m_handle;
00277 
00278 private:
00279 
00280     // disabled
00281     sc_sensitive_neg();
00282     sc_sensitive_neg( const sc_sensitive_neg& );
00283     sc_sensitive_neg& operator = ( const sc_sensitive_neg& );
00284 };
00285 
00286 } // namespace sc_core 
00287 
00288 #endif
00289 
00290 // Taf!

Generated on Wed Jan 21 15:32:09 2009 for SystemC by  doxygen 1.5.5