SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_runnable.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_runnable.h --
21 
22  Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21
23 
24  CHANGE LOG AT THE END OF THE FILE
25  *****************************************************************************/
26 
27 
28 #ifndef SC_RUNNABLE_H
29 #define SC_RUNNABLE_H
30 
31 
32 #include "sysc/kernel/sc_process.h"
33 
34 namespace sc_core {
35 
36 /**************************************************************************/
43 {
44 
45  public:
46  sc_runnable();
47  ~sc_runnable();
48 
49  inline void init();
50  inline void toggle_methods();
51  inline void toggle_threads();
52 
53  inline void remove_method( sc_method_handle );
54  inline void remove_thread( sc_thread_handle );
55 
58 
59  inline void push_back_method( sc_method_handle );
60  inline void push_back_thread( sc_thread_handle );
61  inline void push_front_method( sc_method_handle );
62  inline void push_front_thread( sc_thread_handle );
63 
64  inline bool is_initialized() const;
65  inline bool is_empty() const;
66 
69 
73  // 08/17/2015 GL.
75 
79  // 08/17/2015 GL.
81 
85  // 08/17/2015 GL.
87 
91  // 08/17/2015 GL.
92  inline bool is_methods_pop_end( sc_method_handle );
93 
97  // 08/17/2015 GL.
99 
103  // 08/17/2015 GL.
104  inline bool is_threads_push_end( sc_thread_handle );
105 
109  // 08/17/2015 GL.
111 
115  // 08/17/2015 GL.
116  inline bool is_threads_pop_end( sc_thread_handle );
117 
118  public: // diagnostics:
119  void dump() const;
120 
121  private:
122  sc_method_handle m_methods_push_head;
123  sc_method_handle m_methods_push_tail;
124  sc_method_handle m_methods_pop;
125  sc_thread_handle m_threads_push_head;
126  sc_thread_handle m_threads_push_tail;
127  sc_thread_handle m_threads_pop;
128 
129  private:
130  // disabled
131  sc_runnable( const sc_runnable& );
132  sc_runnable& operator = ( const sc_runnable& );
133 };
134 
135 } // namespace sc_core
136 
137 #endif
138 
139 /*****************************************************************************
140 
141  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
142  changes you are making here.
143 
144  Name, Affiliation, Date: Andy Goodrich, 30 June 2003, Forte Design Systems
145  Description of Modification: Total rewrite using linked list rather than
146  fixed vector.
147 
148 
149  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
150  25 August, 2003
151  Description of Modification: Add tail pointers for m_methods_push and
152  m_threads_push to maintain the same scheduler
153  ordering as 2.0.1
154 
155  *****************************************************************************/
156 
157 // $Log: sc_runnable.h,v $
158 // Revision 1.9 2011/08/26 20:46:10 acg
159 // Andy Goodrich: moved the modification log to the end of the file to
160 // eliminate source line number skew when check-ins are done.
161 //
162 // Revision 1.8 2011/04/08 18:26:07 acg
163 // Andy Goodrich: added execute_method_next() to handle method dispatch
164 // for asynchronous notifications that occur outside the evaluation phase.
165 //
166 // Revision 1.7 2011/02/18 20:27:14 acg
167 // Andy Goodrich: Updated Copyrights.
168 //
169 // Revision 1.6 2011/02/13 21:47:38 acg
170 // Andy Goodrich: update copyright notice.
171 //
172 // Revision 1.5 2011/02/02 06:37:03 acg
173 // Andy Goodrich: removed toggle() method since it is no longer used.
174 //
175 // Revision 1.4 2011/02/01 21:09:13 acg
176 // Andy Goodrich: addition of toggle_methods() and toggle_threads() calls.
177 //
178 // Revision 1.3 2011/01/25 20:50:37 acg
179 // Andy Goodrich: changes for IEEE 1666 2011.
180 //
181 // Revision 1.2 2008/05/22 17:06:26 acg
182 // Andy Goodrich: updated copyright notice to include 2008.
183 //
184 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
185 // SystemC 2.3
186 //
187 // Revision 1.3 2006/01/13 18:44:30 acg
188 // Added $Log to record CVS changes into the source.
189 
190 // Taf!
void push_back_thread(sc_thread_handle)
bool is_threads_pop_end(sc_thread_handle)
Check whether it is the end of threads pop queue.
sc_thread_handle pop_thread()
sc_thread_handle get_threads_push_first()
Return the first thread of threads push queue.
bool is_methods_push_end(sc_method_handle)
Check whether it is the end of methods push queue.
void push_back_method(sc_method_handle)
void execute_method_next(sc_method_handle)
sc_method_handle get_methods_pop_first()
Return the first method of methods pop queue.
class sc_method_process * sc_method_handle
Definition: sc_process.h:120
void remove_method(sc_method_handle)
bool is_initialized() const
void push_front_thread(sc_thread_handle)
Class that manages the ready-to-run queues.
Definition: sc_runnable.h:42
void push_front_method(sc_method_handle)
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:121
sc_thread_handle get_threads_pop_first()
Return the first thread of threads pop queue.
sc_method_handle pop_method()
void remove_thread(sc_thread_handle)
sc_method_handle get_methods_push_first()
Return the first method of methods push queue.
void execute_thread_next(sc_thread_handle)
bool is_threads_push_end(sc_thread_handle)
Check whether it is the end of threads push queue.
bool is_empty() const
bool is_methods_pop_end(sc_method_handle)
Check whether it is the end of methods pop queue.