00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #ifndef SC_SIMCONTEXT_INT_H
00056 #define SC_SIMCONTEXT_INT_H
00057
00058 #include "sysc/kernel/sc_simcontext.h"
00059 #include "sysc/kernel/sc_runnable.h"
00060 #include "sysc/kernel/sc_runnable_int.h"
00061
00062 namespace sc_core {
00063
00064
00065
00066
00067
00068
00069
00070 inline
00071 void
00072 sc_simcontext::set_curr_proc( sc_process_b* process_h )
00073 {
00074 m_curr_proc_info.process_handle = process_h;
00075 m_curr_proc_info.kind = process_h->proc_kind();
00076 m_current_writer = m_write_check ? process_h : (sc_object*)0;
00077 }
00078
00079 inline
00080 void
00081 sc_simcontext::reset_curr_proc()
00082 {
00083 m_curr_proc_info.process_handle = 0;
00084 m_curr_proc_info.kind = SC_NO_PROC_;
00085 m_current_writer = 0;
00086 sc_process_b::m_last_created_process_p = 0;
00087 }
00088
00089 inline
00090 void
00091 sc_simcontext::push_runnable_method( sc_method_handle method_h )
00092 {
00093 m_runnable->push_back_method( method_h );
00094 }
00095
00096 inline
00097 void
00098 sc_simcontext::push_runnable_method_front( sc_method_handle method_h )
00099 {
00100 m_runnable->push_front_method( method_h );
00101 }
00102
00103 inline
00104 void
00105 sc_simcontext::push_runnable_thread( sc_thread_handle thread_h )
00106 {
00107 m_runnable->push_back_thread( thread_h );
00108 }
00109
00110 inline
00111 void
00112 sc_simcontext::push_runnable_thread_front( sc_thread_handle thread_h )
00113 {
00114 m_runnable->push_front_thread( thread_h );
00115 }
00116
00117
00118 inline
00119 sc_method_handle
00120 sc_simcontext::pop_runnable_method()
00121 {
00122 sc_method_handle method_h = m_runnable->pop_method();
00123 if( method_h == 0 ) {
00124 reset_curr_proc();
00125 return 0;
00126 }
00127 set_curr_proc( (sc_process_b*)method_h );
00128 return method_h;
00129 }
00130
00131 inline
00132 sc_thread_handle
00133 sc_simcontext::pop_runnable_thread()
00134 {
00135 sc_thread_handle thread_h = m_runnable->pop_thread();
00136 if( thread_h == 0 ) {
00137 reset_curr_proc();
00138 return 0;
00139 }
00140 set_curr_proc( (sc_process_b*)thread_h );
00141 return thread_h;
00142 }
00143
00144 inline
00145 void
00146 sc_simcontext::remove_runnable_method( sc_method_handle method_h )
00147 {
00148 m_runnable->remove_method( method_h );
00149 }
00150
00151 inline
00152 void
00153 sc_simcontext::remove_runnable_thread( sc_thread_handle thread_h )
00154 {
00155 m_runnable->remove_thread( thread_h );
00156 }
00157
00158
00159
00160
00161
00162 extern void sc_defunct_process_function( sc_module* );
00163
00164
00165 }
00166
00167 #endif