src/sysc/kernel/sc_runnable.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002 
00003   The following code is derived, directly or indirectly, from the SystemC
00004   source code Copyright (c) 1996-2005 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 #ifndef SC_RUNNABLE_H
00045 #define SC_RUNNABLE_H
00046 
00047 
00048 #include "sysc/kernel/sc_process_b.h"
00049 
00050 namespace sc_core {
00051 
00052 //=============================================================================
00053 //  CLASS : sc_runnable
00054 //
00055 //  Class that manages the ready-to-run queues.
00056 //=============================================================================
00057 
00058 class sc_runnable
00059 {
00060 
00061   public:
00062     sc_runnable();
00063     ~sc_runnable();
00064 
00065     inline void init();
00066     inline void toggle();
00067 
00068     inline void remove_method( sc_method_handle );
00069     inline void remove_thread( sc_thread_handle );
00070 
00071     inline void push_back_method( sc_method_handle );
00072     inline void push_back_thread( sc_thread_handle );
00073     inline void push_front_method( sc_method_handle );
00074     inline void push_front_thread( sc_thread_handle );
00075 
00076     inline bool is_empty() const;
00077 
00078     inline sc_method_handle pop_method();
00079     inline sc_thread_handle pop_thread();
00080 
00081   private:
00082     sc_method_handle m_methods_push_head;
00083     sc_method_handle m_methods_push_tail;
00084     sc_method_handle m_methods_pop;
00085     sc_thread_handle m_threads_push_head;
00086     sc_thread_handle m_threads_push_tail;
00087     sc_thread_handle m_threads_pop;
00088 
00089   private:
00090     // disabled
00091     sc_runnable( const sc_runnable& );
00092     sc_runnable& operator = ( const sc_runnable& );
00093 };
00094 
00095 } // namespace sc_core
00096 
00097 #endif
00098 
00099 // Taf!

Generated on Wed Apr 25 13:53:27 2007 for SystemC by  doxygen 1.5.1