SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_runnable.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_runnable.h --
23 */
34 #ifndef SC_RUNNABLE_H
35 #define SC_RUNNABLE_H
36 
37 
38 #include "sysc/kernel/sc_process.h"
39 
40 namespace sc_core {
41 
42 //=============================================================================
43 // CLASS : sc_runnable
44 //
45 // Class that manages the ready-to-run queues.
46 //=============================================================================
47 
49 {
50 
51  public:
52  sc_runnable();
53  ~sc_runnable();
54 
55  inline void init();
56  inline void toggle_methods();
57  inline void toggle_threads();
58 
59  inline void remove_method( sc_method_handle );
60  inline void remove_thread( sc_thread_handle );
61 
62  inline void execute_method_next( sc_method_handle );
63  inline void execute_thread_next( sc_thread_handle );
64 
65  inline void push_back_method( sc_method_handle );
66  inline void push_back_thread( sc_thread_handle );
67  inline void push_front_method( sc_method_handle );
68  inline void push_front_thread( sc_thread_handle );
69 
70  inline bool is_initialized() const;
71  inline bool is_empty() const;
72 
73  inline sc_method_handle pop_method();
74  inline sc_thread_handle pop_thread();
75 
76  public: // diagnostics:
77  void dump() const;
78 
79  private:
80  sc_method_handle m_methods_push_head;
81  sc_method_handle m_methods_push_tail;
82  sc_method_handle m_methods_pop;
83  sc_thread_handle m_threads_push_head;
84  sc_thread_handle m_threads_push_tail;
85  sc_thread_handle m_threads_pop;
86 
87  private:
88  // disabled
89  sc_runnable( const sc_runnable& );
90  sc_runnable& operator = ( const sc_runnable& );
91 };
92 
93 } // namespace sc_core
94 
95 #endif
96 
97 /*****************************************************************************
98 
99  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
100  changes you are making here.
101 
102  Name, Affiliation, Date: Andy Goodrich, 30 June 2003, Forte Design Systems
103  Description of Modification: Total rewrite using linked list rather than
104  fixed vector.
105 
106 
107  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
108  25 August, 2003
109  Description of Modification: Add tail pointers for m_methods_push and
110  m_threads_push to maintain the same scheduler
111  ordering as 2.0.1
112 
113  *****************************************************************************/
114 
115 // $Log: sc_runnable.h,v $
116 // Revision 1.9 2011/08/26 20:46:10 acg
117 // Andy Goodrich: moved the modification log to the end of the file to
118 // eliminate source line number skew when check-ins are done.
119 //
120 // Revision 1.8 2011/04/08 18:26:07 acg
121 // Andy Goodrich: added execute_method_next() to handle method dispatch
122 // for asynchronous notifications that occur outside the evaluation phase.
123 //
124 // Revision 1.7 2011/02/18 20:27:14 acg
125 // Andy Goodrich: Updated Copyrights.
126 //
127 // Revision 1.6 2011/02/13 21:47:38 acg
128 // Andy Goodrich: update copyright notice.
129 //
130 // Revision 1.5 2011/02/02 06:37:03 acg
131 // Andy Goodrich: removed toggle() method since it is no longer used.
132 //
133 // Revision 1.4 2011/02/01 21:09:13 acg
134 // Andy Goodrich: addition of toggle_methods() and toggle_threads() calls.
135 //
136 // Revision 1.3 2011/01/25 20:50:37 acg
137 // Andy Goodrich: changes for IEEE 1666 2011.
138 //
139 // Revision 1.2 2008/05/22 17:06:26 acg
140 // Andy Goodrich: updated copyright notice to include 2008.
141 //
142 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
143 // SystemC 2.3
144 //
145 // Revision 1.3 2006/01/13 18:44:30 acg
146 // Added $Log to record CVS changes into the source.
147 
148 // Taf!
Process base class support.
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:67
class sc_method_process * sc_method_handle
Definition: sc_process.h:66
#define SC_API
Definition: sc_cmnhdr.h:168