SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_sensitive.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  Licensed to Accellera Systems Initiative Inc. (Accellera) under one or
4  more contributor license agreements. See the NOTICE file distributed
5  with this work for additional information regarding copyright ownership.
6  Accellera licenses this file to you under the Apache License, Version 2.0
7  (the "License"); you may not use this file except in compliance with the
8  License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12  Unless required by applicable law or agreed to in writing, software
13  distributed under the License is distributed on an "AS IS" BASIS,
14  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
15  implied. See the License for the specific language governing
16  permissions and limitations under the License.
17 
18  *****************************************************************************/
19 
20 /*****************************************************************************
21 
22  sc_sensitive.h -- Sensitivity classes. Requires "sc_process.h"
23 */
36 #ifndef SC_SENSITIVE_H
37 #define SC_SENSITIVE_H
38 
39 #include "sysc/kernel/sc_process.h"
40 
41 namespace sc_dt
42 {
43  class sc_logic;
44 }
45 
46 namespace sc_core {
47 
48 class sc_process_handle;
49 class sc_event;
50 class sc_event_finder;
51 class sc_interface;
52 class sc_module;
53 class sc_port_base;
54 template <class T> class sc_in;
55 template <class T> class sc_inout;
56 template <class T> class sc_signal_in_if;
57 
58 
66 {
67  friend class sc_module;
68 
69 public:
70 
71  // typedefs
78 
79 private:
80 
81  // constructor
82  explicit sc_sensitive( sc_module* );
83 
84  // destructor
85  ~sc_sensitive();
86 
87 public:
88 
89  // changing between process handles
91 #if 0
94 #endif // 0
95 
96  sc_sensitive& operator () ( const sc_event& );
97  sc_sensitive& operator () ( const sc_interface& );
98  sc_sensitive& operator () ( const sc_port_base& );
99  sc_sensitive& operator () ( sc_event_finder& );
100 
105 
107  sc_sensitive& operator () ( sc_cthread_handle, const in_if_b_type& );
108  sc_sensitive& operator () ( sc_cthread_handle, const in_if_l_type& );
109  sc_sensitive& operator () ( sc_cthread_handle, const in_port_b_type& );
110  sc_sensitive& operator () ( sc_cthread_handle, const in_port_l_type& );
111  sc_sensitive& operator () ( sc_cthread_handle, const inout_port_b_type& );
112  sc_sensitive& operator () ( sc_cthread_handle, const inout_port_l_type& );
113 
114  static void make_static_sensitivity( sc_process_b*, const sc_event& );
115  static void make_static_sensitivity( sc_process_b*, const sc_interface& );
116  static void make_static_sensitivity( sc_process_b*, const sc_port_base&);
117  static void make_static_sensitivity( sc_process_b*, sc_event_finder& );
118 
119  void reset();
120 
121 private:
122 
123  sc_module* m_module;
124  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
125  sc_process_b* m_handle;
126 
127 private:
128 
129  // disabled
130 
131  sc_sensitive();
132  sc_sensitive( const sc_sensitive& );
133  sc_sensitive& operator = ( const sc_sensitive& );
134 };
135 
136 
144 {
145  friend class sc_module;
146 
147 public:
148 
149  // typedefs
156 
157 private:
158 
159  // constructor
160  explicit sc_sensitive_pos( sc_module* );
161 
162  // destructor
163  ~sc_sensitive_pos();
164 
165 public:
166 
167  // changing between process handles
171 
172  sc_sensitive_pos& operator () ( const in_if_b_type& );
173  sc_sensitive_pos& operator () ( const in_if_l_type& );
174  sc_sensitive_pos& operator () ( const in_port_b_type& );
175  sc_sensitive_pos& operator () ( const in_port_l_type& );
176  sc_sensitive_pos& operator () ( const inout_port_b_type& );
177  sc_sensitive_pos& operator () ( const inout_port_l_type& );
178 
179  sc_sensitive_pos& operator << ( const in_if_b_type& );
180  sc_sensitive_pos& operator << ( const in_if_l_type& );
181  sc_sensitive_pos& operator << ( const in_port_b_type& );
182  sc_sensitive_pos& operator << ( const in_port_l_type& );
183  sc_sensitive_pos& operator << ( const inout_port_b_type& );
184  sc_sensitive_pos& operator << ( const inout_port_l_type& );
185 
186  void reset();
187 
188 private:
189 
190  sc_module* m_module;
191  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
192  sc_process_b* m_handle;
193 
194 private:
195 
196  // disabled
199  sc_sensitive_pos& operator = ( const sc_sensitive_pos& );
200 };
201 
202 
210 {
211  friend class sc_module;
212 
213 public:
214 
215  // typedefs
222 
223 private:
224 
225  // constructor
226  explicit sc_sensitive_neg( sc_module* );
227 
228  // destructor
229  ~sc_sensitive_neg();
230 
231 public:
232 
233  // changing between process handles
237 
238  sc_sensitive_neg& operator () ( const in_if_b_type& );
239  sc_sensitive_neg& operator () ( const in_if_l_type& );
240  sc_sensitive_neg& operator () ( const in_port_b_type& );
241  sc_sensitive_neg& operator () ( const in_port_l_type& );
242  sc_sensitive_neg& operator () ( const inout_port_b_type& );
243  sc_sensitive_neg& operator () ( const inout_port_l_type& );
244 
245  sc_sensitive_neg& operator << ( const in_if_b_type& );
246  sc_sensitive_neg& operator << ( const in_if_l_type& );
247  sc_sensitive_neg& operator << ( const in_port_b_type& );
248  sc_sensitive_neg& operator << ( const in_port_l_type& );
249  sc_sensitive_neg& operator << ( const inout_port_b_type& );
250  sc_sensitive_neg& operator << ( const inout_port_l_type& );
251 
252  void reset();
253 
254 private:
255 
256  sc_module* m_module;
257  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
258  sc_process_b* m_handle;
259 
260 private:
261 
262  // disabled
265  sc_sensitive_neg& operator = ( const sc_sensitive_neg& );
266 };
267 
268 } // namespace sc_core
269 
270 #endif
271 
272 /*****************************************************************************
273 
274  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
275  changes you are making here.
276 
277  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
278  25 August, 2003
279  Description of Modification: Add make_static_sensitivity() methods to enable
280  dynamic method process creation with static
281  sensitivity.
282 
283  *****************************************************************************/
284 
285 // $Log: sc_sensitive.h,v $
286 // Revision 1.5 2011/08/26 20:46:10 acg
287 // Andy Goodrich: moved the modification log to the end of the file to
288 // eliminate source line number skew when check-ins are done.
289 //
290 // Revision 1.4 2011/02/18 20:27:14 acg
291 // Andy Goodrich: Updated Copyrights.
292 //
293 // Revision 1.3 2011/02/13 21:47:38 acg
294 // Andy Goodrich: update copyright notice.
295 //
296 // Revision 1.2 2008/05/22 17:06:26 acg
297 // Andy Goodrich: updated copyright notice to include 2008.
298 //
299 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
300 // SystemC 2.3
301 //
302 // Revision 1.4 2006/04/11 23:13:21 acg
303 // Andy Goodrich: Changes for reduced reset support that only includes
304 // sc_cthread, but has preliminary hooks for expanding to method and thread
305 // processes also.
306 //
307 // Revision 1.3 2006/01/13 18:44:30 acg
308 // Added $Log to record CVS changes into the source.
309 
310 // Taf!
Static sensitivity class for negative edge events.
Definition: sc_sensitive.h:209
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:77
Process base class support.
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:73
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:220
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:221
Specialization of sc_signal_in_if<T> for type bool.
Specialization of sc_inout<T> for type bool.
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:153
Event finder base class.
class sc_cthread_process * sc_cthread_handle
Definition: sc_process.h:65
Abstract base class for class sc_port_b.
Definition: sc_port.h:81
The event class.
Definition: sc_event.h:256
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:152
Static sensitivity class for positive edge events.
Definition: sc_sensitive.h:143
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:219
Base class for all structural entities.
Definition: sc_module.h:83
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:218
class SC_API sc_event
Definition: sc_interface.h:40
Static sensitivity class for events.
Definition: sc_sensitive.h:65
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:74
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:72
Specialization of sc_in<T> for type sc_dt::sc_logic.
Abstract base class of all interface classes.
Definition: sc_interface.h:51
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:75
Specialization of sc_signal_in_if<T> for type sc_dt::sc_logic.
class SC_API sc_module
Definition: sc_object.h:48
Specialization of sc_in<T> for type bool.
class SC_API sc_port_base
Definition: sc_interface.h:41
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:76
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:67
class sc_method_process * sc_method_handle
Definition: sc_process.h:66
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:151
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:155
Specialization of sc_inout<T> for type sc_dt::sc_logic.
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:154
class SC_API sc_logic
Definition: sc_signal_ifs.h:43
inline ::std::ostream & operator<<(::std::ostream &os, const sc_bit &a)
Definition: sc_bit.h:390
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:217
#define SC_API
Definition: sc_cmnhdr.h:168
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:216
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:150