SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera 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  // 04/07/2015 GL: a new sc_channel class is derived from sc_module
64  friend class sc_channel;
65 
66 public:
67 
68  // typedefs
75 
76 private:
77 
78  // constructor
79  explicit sc_sensitive( sc_module* );
80 
81  // destructor
82  ~sc_sensitive();
83 
84 public:
85 
86  // changing between process handles
88 #if 0
91 #endif // 0
92 
97 
102 
110 
111  static void make_static_sensitivity( sc_process_b*, const sc_event& );
112  static void make_static_sensitivity( sc_process_b*, const sc_interface& );
113  static void make_static_sensitivity( sc_process_b*, const sc_port_base&);
115 
116  void reset();
117 
118 private:
119 
120  sc_module* m_module;
121  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
122  sc_process_b* m_handle;
123 
124 private:
125 
126  // disabled
127 
128  sc_sensitive();
129  sc_sensitive( const sc_sensitive& );
130  sc_sensitive& operator = ( const sc_sensitive& );
131 };
132 
133 
134 // ----------------------------------------------------------------------------
135 // CLASS : sc_sensitive_pos
136 //
137 // Static sensitivity class for positive edge events.
138 // ----------------------------------------------------------------------------
139 
141 {
142  friend class sc_module;
143 
144  // 04/07/2015 GL: a new sc_channel class is derived from sc_module
145  friend class sc_channel;
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 
178 
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 
203 // ----------------------------------------------------------------------------
204 // CLASS : sc_sensitive_neg
205 //
206 // Static sensitivity class for negative edge events.
207 // ----------------------------------------------------------------------------
208 
210 {
211  friend class sc_module;
212 
213  // 04/07/2015 GL: a new sc_channel class is derived from sc_module
214  friend class sc_channel;
215 
216 public:
217 
218  // typedefs
225 
226 private:
227 
228  // constructor
229  explicit sc_sensitive_neg( sc_module* );
230 
231  // destructor
232  ~sc_sensitive_neg();
233 
234 public:
235 
236  // changing between process handles
240 
247 
254 
255  void reset();
256 
257 private:
258 
259  sc_module* m_module;
260  enum { SC_NONE_, SC_METHOD_, SC_THREAD_ } m_mode;
261  sc_process_b* m_handle;
262 
263 private:
264 
265  // disabled
268  sc_sensitive_neg& operator = ( const sc_sensitive_neg& );
269 };
270 
271 } // namespace sc_core
272 
273 #endif
274 
275 /*****************************************************************************
276 
277  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
278  changes you are making here.
279 
280  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
281  25 August, 2003
282  Description of Modification: Add make_static_sensitivity() methods to enable
283  dynamic method process creation with static
284  sensitivity.
285 
286  *****************************************************************************/
287 
288 // $Log: sc_sensitive.h,v $
289 // Revision 1.5 2011/08/26 20:46:10 acg
290 // Andy Goodrich: moved the modification log to the end of the file to
291 // eliminate source line number skew when check-ins are done.
292 //
293 // Revision 1.4 2011/02/18 20:27:14 acg
294 // Andy Goodrich: Updated Copyrights.
295 //
296 // Revision 1.3 2011/02/13 21:47:38 acg
297 // Andy Goodrich: update copyright notice.
298 //
299 // Revision 1.2 2008/05/22 17:06:26 acg
300 // Andy Goodrich: updated copyright notice to include 2008.
301 //
302 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
303 // SystemC 2.3
304 //
305 // Revision 1.4 2006/04/11 23:13:21 acg
306 // Andy Goodrich: Changes for reduced reset support that only includes
307 // sc_cthread, but has preliminary hooks for expanding to method and thread
308 // processes also.
309 //
310 // Revision 1.3 2006/01/13 18:44:30 acg
311 // Added $Log to record CVS changes into the source.
312 
313 // Taf!
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:154
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:71
Specialization of sc_signal_in_if&lt;T&gt; for type bool.
Definition: sc_signal_ifs.h:96
sc_sensitive_pos & operator<<(sc_process_handle)
static void make_static_sensitivity(sc_process_b *, const sc_event &)
This class provides access to an sc_process_b object instance in a manner which allows some persisten...
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:72
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:224
class sc_cthread_process * sc_cthread_handle
Definition: sc_process.h:119
class sc_method_process * sc_method_handle
Definition: sc_process.h:120
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:152
User initiated dynamic process support.
Definition: sc_process.h:558
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:73
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:150
Specialization of sc_inout&lt;T&gt; for type bool.
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:69
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:121
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:74
Specialization of sc_in&lt;T&gt; for type sc_dt::sc_logic.
The event class.
Definition: sc_event.h:260
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:222
Abstract base class of all interface classes.
Definition: sc_interface.h:44
Event finder base class.
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:151
Specialization of sc_inout&lt;T&gt; for type sc_dt::sc_logic.
Base class for all structural entities.
Definition: sc_module.h:83
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:220
Specialization of sc_signal_in_if&lt;T&gt; for type sc_dt::sc_logic.
sc_inout< sc_dt::sc_logic > inout_port_l_type
Definition: sc_sensitive.h:155
Abstract base class for class sc_port_b.
Definition: sc_port.h:69
sc_sensitive & operator()(const sc_event &)
sc_in< sc_dt::sc_logic > in_port_l_type
Definition: sc_sensitive.h:153
Base class for all hierarchical channels.
Definition: sc_module.h:712
sc_in< bool > in_port_b_type
Definition: sc_sensitive.h:221
sc_signal_in_if< bool > in_if_b_type
Definition: sc_sensitive.h:219
sc_sensitive_neg & operator<<(sc_process_handle)
sc_signal_in_if< sc_dt::sc_logic > in_if_l_type
Definition: sc_sensitive.h:70
sc_inout< bool > inout_port_b_type
Definition: sc_sensitive.h:223
sc_sensitive & operator<<(sc_process_handle)
Specialization of sc_in&lt;T&gt; for type bool.
sc_sensitive_neg & operator()(const in_if_b_type &)
sc_sensitive_pos & operator()(const in_if_b_type &)