32#ifndef SC_SIMCONTEXT_INT_H
33#define SC_SIMCONTEXT_INT_H
50# define DEBUG_MSG(NAME,P,MSG) \
52 if ( P && ( (std::strlen(NAME)==0) || !std::strcmp(NAME,P->name())) ) \
53 std::cout << "**** " << sc_time_stamp() << " (" \
54 << sc_get_current_process_name("** NONE **") << "): " << MSG \
55 << " - " << P->name() << std::endl; \
58# define DEBUG_MSG(NAME,P,MSG)
77 (m_write_check != SC_SIGNAL_WRITE_CHECK_DISABLE_) ? process_h : 0;
124 sc_curr_proc_info caller_info;
131 if ( thread_h->next_runnable() != NULL )
132 remove_runnable_thread( thread_h );
145 if ( active_p == NULL )
147 std::vector<sc_thread_handle>* invokers_p;
153 caller_info = m_curr_proc_info;
154 if ( invokers_p->size() != 0 )
156 invoke_thread_p = invokers_p->back();
158 "queueing invocation thread to execute next" );
159 execute_thread_next(invoke_thread_p);
161 DEBUG_MSG( DEBUG_NAME, thread_h,
"preempting method with thread" );
163 m_cor_pkg->
yield( thread_h->m_cor_p );
164 m_curr_proc_info = caller_info;
165 DEBUG_MSG(DEBUG_NAME, thread_h,
"back from preempting method w/thread");
166 method_p->check_for_throws();
177 else if ( active_p != thread_h )
180 "preempting active thread with thread" );
181 execute_thread_next( active_p );
182 execute_thread_next( thread_h );
183 active_p->suspend_me();
194 DEBUG_MSG(DEBUG_NAME,thread_h,
"self preemption of active thread");
195 execute_thread_next( thread_h );
196 active_p->suspend_me();
232sc_simcontext::pop_runnable_method()
235 if( method_h == 0 ) {
245sc_simcontext::pop_runnable_thread()
248 if( thread_h == 0 ) {
271std::vector<sc_thread_handle>&
274 return m_active_invokers;
280 return ( m_write_check == SC_SIGNAL_WRITE_CHECK_CONFLICT_ );
#define DEBUG_MSG(NAME, P, MSG)
class sc_method_process * sc_method_handle
class sc_thread_process * sc_thread_handle
SC_API void sc_defunct_process_function(sc_module *)
sc_process_b * sc_get_current_process_b()
virtual void yield(sc_cor *next_cor)=0
static sc_process_b * m_last_created_process_p
sc_curr_proc_kind proc_kind() const
void push_front_thread(sc_thread_handle)
void execute_thread_next(sc_thread_handle)
void remove_method(sc_method_handle)
void push_back_thread(sc_thread_handle)
void execute_method_next(sc_method_handle)
void remove_thread(sc_thread_handle)
void push_back_method(sc_method_handle)
void push_front_method(sc_method_handle)
sc_method_handle pop_method()
sc_thread_handle pop_thread()
sc_process_b * process_handle
bool write_check_conflicts_only() const
void set_curr_proc(sc_process_b *)
std::vector< sc_thread_handle > & get_active_invokers()
friend class sc_process_b