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