00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2014 by all Contributors. 00005 All Rights reserved. 00006 00007 The contents of this file are subject to the restrictions and limitations 00008 set forth in the SystemC Open Source License (the "License"); 00009 You may not use this file except in compliance with such restrictions and 00010 limitations. You may obtain instructions on how to receive a copy of the 00011 License at http://www.accellera.org/. Software distributed by Contributors 00012 under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF 00013 ANY KIND, either express or implied. See the License for the specific 00014 language governing rights and limitations under the License. 00015 00016 *****************************************************************************/ 00017 00018 /***************************************************************************** 00019 00020 sc_runnable.h -- 00021 00022 Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21 00023 00024 CHANGE LOG AT THE END OF THE FILE 00025 *****************************************************************************/ 00026 00027 00028 #ifndef SC_RUNNABLE_H 00029 #define SC_RUNNABLE_H 00030 00031 00032 #include "sysc/kernel/sc_process.h" 00033 00034 namespace sc_core { 00035 00036 /**************************************************************************/ 00042 class sc_runnable 00043 { 00044 00045 public: 00046 sc_runnable(); 00047 ~sc_runnable(); 00048 00049 inline void init(); 00050 inline void toggle_methods(); 00051 inline void toggle_threads(); 00052 00053 inline void remove_method( sc_method_handle ); 00054 inline void remove_thread( sc_thread_handle ); 00055 00056 inline void execute_method_next( sc_method_handle ); 00057 inline void execute_thread_next( sc_thread_handle ); 00058 00059 inline void push_back_method( sc_method_handle ); 00060 inline void push_back_thread( sc_thread_handle ); 00061 inline void push_front_method( sc_method_handle ); 00062 inline void push_front_thread( sc_thread_handle ); 00063 00064 inline bool is_initialized() const; 00065 inline bool is_empty() const; 00066 00067 inline sc_method_handle pop_method(); 00068 inline sc_thread_handle pop_thread(); 00069 00073 // 08/17/2015 GL. 00074 inline sc_method_handle get_methods_push_first(); 00075 00079 // 08/17/2015 GL. 00080 inline bool is_methods_push_end( sc_method_handle ); 00081 00085 // 08/17/2015 GL. 00086 inline sc_method_handle get_methods_pop_first(); 00087 00091 // 08/17/2015 GL. 00092 inline bool is_methods_pop_end( sc_method_handle ); 00093 00097 // 08/17/2015 GL. 00098 inline sc_thread_handle get_threads_push_first(); 00099 00103 // 08/17/2015 GL. 00104 inline bool is_threads_push_end( sc_thread_handle ); 00105 00109 // 08/17/2015 GL. 00110 inline sc_thread_handle get_threads_pop_first(); 00111 00115 // 08/17/2015 GL. 00116 inline bool is_threads_pop_end( sc_thread_handle ); 00117 00118 public: // diagnostics: 00119 void dump() const; 00120 00121 private: 00122 sc_method_handle m_methods_push_head; 00123 sc_method_handle m_methods_push_tail; 00124 sc_method_handle m_methods_pop; 00125 sc_thread_handle m_threads_push_head; 00126 sc_thread_handle m_threads_push_tail; 00127 sc_thread_handle m_threads_pop; 00128 00129 private: 00130 // disabled 00131 sc_runnable( const sc_runnable& ); 00132 sc_runnable& operator = ( const sc_runnable& ); 00133 }; 00134 00135 } // namespace sc_core 00136 00137 #endif 00138 00139 /***************************************************************************** 00140 00141 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00142 changes you are making here. 00143 00144 Name, Affiliation, Date: Andy Goodrich, 30 June 2003, Forte Design Systems 00145 Description of Modification: Total rewrite using linked list rather than 00146 fixed vector. 00147 00148 00149 Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems, 00150 25 August, 2003 00151 Description of Modification: Add tail pointers for m_methods_push and 00152 m_threads_push to maintain the same scheduler 00153 ordering as 2.0.1 00154 00155 *****************************************************************************/ 00156 00157 // $Log: sc_runnable.h,v $ 00158 // Revision 1.9 2011/08/26 20:46:10 acg 00159 // Andy Goodrich: moved the modification log to the end of the file to 00160 // eliminate source line number skew when check-ins are done. 00161 // 00162 // Revision 1.8 2011/04/08 18:26:07 acg 00163 // Andy Goodrich: added execute_method_next() to handle method dispatch 00164 // for asynchronous notifications that occur outside the evaluation phase. 00165 // 00166 // Revision 1.7 2011/02/18 20:27:14 acg 00167 // Andy Goodrich: Updated Copyrights. 00168 // 00169 // Revision 1.6 2011/02/13 21:47:38 acg 00170 // Andy Goodrich: update copyright notice. 00171 // 00172 // Revision 1.5 2011/02/02 06:37:03 acg 00173 // Andy Goodrich: removed toggle() method since it is no longer used. 00174 // 00175 // Revision 1.4 2011/02/01 21:09:13 acg 00176 // Andy Goodrich: addition of toggle_methods() and toggle_threads() calls. 00177 // 00178 // Revision 1.3 2011/01/25 20:50:37 acg 00179 // Andy Goodrich: changes for IEEE 1666 2011. 00180 // 00181 // Revision 1.2 2008/05/22 17:06:26 acg 00182 // Andy Goodrich: updated copyright notice to include 2008. 00183 // 00184 // Revision 1.1.1.1 2006/12/15 20:20:05 acg 00185 // SystemC 2.3 00186 // 00187 // Revision 1.3 2006/01/13 18:44:30 acg 00188 // Added $Log to record CVS changes into the source. 00189 00190 // Taf!