SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_sensitive.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distributed by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  *****************************************************************************/
17 
18 /*****************************************************************************
19 
20  sc_sensitive.h -- Sensitivity classes. Requires "sc_process.h"
21  for declarations of sc_method_handle, &.c.
22 
23  Original Author: Stan Y. Liao, Synopsys, Inc.
24  Martin Janssen, Synopsys, Inc.
25 
26  CHANGE LOG AT THE END OF THE FILE
27  *****************************************************************************/
28 
29 
30 #ifndef SC_SENSITIVE_H
31 #define SC_SENSITIVE_H
32 
33 #include "sysc/kernel/sc_process.h"
34 
35 namespace sc_dt
36 {
37  class sc_logic;
38 }
39 
40 namespace sc_core {
41 
42 class sc_process_handle;
43 class sc_event;
44 class sc_event_finder;
45 class sc_interface;
46 class sc_module;
47 class sc_port_base;
48 template <class T> class sc_in;
49 template <class T> class sc_inout;
50 template <class T> class sc_signal_in_if;
51 
52 
53 // ----------------------------------------------------------------------------
54 // CLASS : sc_sensitive
55 //
56 // Static sensitivity class for events.
57 // ----------------------------------------------------------------------------
58 
60 {
61  friend class sc_module;
62 
63 public:
64 
65  // typedefs
72 
73 private:
74 
75  // constructor
76  explicit sc_sensitive( sc_module* );
77 
78  // destructor
79  ~sc_sensitive();
80 
81 public:
82 
83  // changing between process handles
85 #if 0
88 #endif // 0
89 
94 
99 
107 
108  static void make_static_sensitivity( sc_process_b*, const sc_event& );
109  static void make_static_sensitivity( sc_process_b*, const sc_interface& );
110  static void make_static_sensitivity( sc_process_b*, const sc_port_base&);
112 
113  void reset();
114 
115 private:
116 
117  sc_module* m_module;
118  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
119  sc_process_b* m_handle;
120 
121 private:
122 
123  // disabled
124 
125  sc_sensitive();
126  sc_sensitive( const sc_sensitive& );
127  sc_sensitive& operator = ( const sc_sensitive& );
128 };
129 
130 
131 // ----------------------------------------------------------------------------
132 // CLASS : sc_sensitive_pos
133 //
134 // Static sensitivity class for positive edge events.
135 // ----------------------------------------------------------------------------
136 
138 {
139  friend class sc_module;
140 
141 public:
142 
143  // typedefs
150 
151 private:
152 
153  // constructor
154  explicit sc_sensitive_pos( sc_module* );
155 
156  // destructor
157  ~sc_sensitive_pos();
158 
159 public:
160 
161  // changing between process handles
165 
172 
179 
180  void reset();
181 
182 private:
183 
184  sc_module* m_module;
185  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
186  sc_process_b* m_handle;
187 
188 private:
189 
190  // disabled
193  sc_sensitive_pos& operator = ( const sc_sensitive_pos& );
194 };
195 
196 
197 // ----------------------------------------------------------------------------
198 // CLASS : sc_sensitive_neg
199 //
200 // Static sensitivity class for negative edge events.
201 // ----------------------------------------------------------------------------
202 
204 {
205  friend class sc_module;
206 
207 public:
208 
209  // typedefs
216 
217 private:
218 
219  // constructor
220  explicit sc_sensitive_neg( sc_module* );
221 
222  // destructor
223  ~sc_sensitive_neg();
224 
225 public:
226 
227  // changing between process handles
231 
238 
245 
246  void reset();
247 
248 private:
249 
250  sc_module* m_module;
251  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
252  sc_process_b* m_handle;
253 
254 private:
255 
256  // disabled
259  sc_sensitive_neg& operator = ( const sc_sensitive_neg& );
260 };
261 
262 } // namespace sc_core
263 
264 #endif
265 
266 /*****************************************************************************
267 
268  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
269  changes you are making here.
270 
271  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
272  25 August, 2003
273  Description of Modification: Add make_static_sensitivity() methods to enable
274  dynamic method process creation with static
275  sensitivity.
276 
277  *****************************************************************************/
278 
279 // $Log: sc_sensitive.h,v $
280 // Revision 1.5 2011/08/26 20:46:10 acg
281 // Andy Goodrich: moved the modification log to the end of the file to
282 // eliminate source line number skew when check-ins are done.
283 //
284 // Revision 1.4 2011/02/18 20:27:14 acg
285 // Andy Goodrich: Updated Copyrights.
286 //
287 // Revision 1.3 2011/02/13 21:47:38 acg
288 // Andy Goodrich: update copyright notice.
289 //
290 // Revision 1.2 2008/05/22 17:06:26 acg
291 // Andy Goodrich: updated copyright notice to include 2008.
292 //
293 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
294 // SystemC 2.3
295 //
296 // Revision 1.4 2006/04/11 23:13:21 acg
297 // Andy Goodrich: Changes for reduced reset support that only includes
298 // sc_cthread, but has preliminary hooks for expanding to method and thread
299 // processes also.
300 //
301 // Revision 1.3 2006/01/13 18:44:30 acg
302 // Added $Log to record CVS changes into the source.
303 
304 // Taf!
sc_sensitive_pos & operator<<(sc_process_handle)
static void make_static_sensitivity(sc_process_b *, const sc_event &)
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:213
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:210
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:214
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:149
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:66
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:148
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:71
sc_sensitive_neg & operator()(const in_if_b_type &)
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:215
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:58
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:69
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:70
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:146
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:68
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:147
sc_sensitive_neg & operator<<(sc_process_handle)
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:211
sc_sensitive & operator<<(sc_process_handle)
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:145
sc_sensitive & operator()(const sc_event &)
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:212
sc_sensitive_pos & operator()(const in_if_b_type &)
class sc_cthread_process * sc_cthread_handle
Definition: sc_process.h:56
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:67
class sc_method_process * sc_method_handle
Definition: sc_process.h:57
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:144