00001 /***************************************************************************** 00002 00003 The following code is derived, directly or indirectly, from the SystemC 00004 source code Copyright (c) 1996-2006 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 Version 2.4 (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.systemc.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 *****************************************************************************/ 00025 00026 /***************************************************************************** 00027 00028 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 00029 changes you are making here. 00030 00031 Name, Affiliation, Date: Andy Goodrich, 30 June 2003, Forte Design Systems 00032 Description of Modification: Total rewrite using linked list rather than 00033 fixed vector. 00034 00035 00036 Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems, 00037 25 August, 2003 00038 Description of Modification: Add tail pointers for m_methods_push and 00039 m_threads_push to maintain the same scheduler 00040 ordering as 2.0.1 00041 00042 *****************************************************************************/ 00043 00044 // $Log: sc_runnable.h,v $ 00045 // Revision 1.1.1.1 2006/12/15 20:31:37 acg 00046 // SystemC 2.2 00047 // 00048 // Revision 1.3 2006/01/13 18:44:30 acg 00049 // Added $Log to record CVS changes into the source. 00050 // 00051 00052 #ifndef SC_RUNNABLE_H 00053 #define SC_RUNNABLE_H 00054 00055 00056 #include "sysc/kernel/sc_process.h" 00057 00058 namespace sc_core { 00059 00060 //============================================================================= 00061 // CLASS : sc_runnable 00062 // 00063 // Class that manages the ready-to-run queues. 00064 //============================================================================= 00065 00066 class sc_runnable 00067 { 00068 00069 public: 00070 sc_runnable(); 00071 ~sc_runnable(); 00072 00073 inline void init(); 00074 inline void toggle(); 00075 00076 inline void remove_method( sc_method_handle ); 00077 inline void remove_thread( sc_thread_handle ); 00078 00079 inline void push_back_method( sc_method_handle ); 00080 inline void push_back_thread( sc_thread_handle ); 00081 inline void push_front_method( sc_method_handle ); 00082 inline void push_front_thread( sc_thread_handle ); 00083 00084 inline bool is_empty() const; 00085 00086 inline sc_method_handle pop_method(); 00087 inline sc_thread_handle pop_thread(); 00088 00089 private: 00090 sc_method_handle m_methods_push_head; 00091 sc_method_handle m_methods_push_tail; 00092 sc_method_handle m_methods_pop; 00093 sc_thread_handle m_threads_push_head; 00094 sc_thread_handle m_threads_push_tail; 00095 sc_thread_handle m_threads_pop; 00096 00097 private: 00098 // disabled 00099 sc_runnable( const sc_runnable& ); 00100 sc_runnable& operator = ( const sc_runnable& ); 00101 }; 00102 00103 } // namespace sc_core 00104 00105 #endif 00106 00107 // Taf!