36 #ifndef SC_SIMCONTEXT_INT_H 37 #define SC_SIMCONTEXT_INT_H 53 # define DEBUG_NAME "" 54 # define DEBUG_MSG(NAME,P,MSG) \ 56 if ( P && ( (std::strlen(NAME)==0) || !std::strcmp(NAME,P->name())) ) \ 57 std::cout << "**** " << sc_time_stamp() << " (" \ 58 << sc_get_current_process_name("** NONE **") << "): " << MSG \ 59 << " - " << P->name() << std::endl; \ 62 # define DEBUG_MSG(NAME,P,MSG) 77 result = active_p->
name();
96 (m_write_check != SC_SIGNAL_WRITE_CHECK_DISABLE_) ? process_h : 0;
105 m_current_writer = 0;
150 if ( thread_h->next_runnable() != NULL )
151 remove_runnable_thread( thread_h );
164 if ( active_p == NULL )
166 std::vector<sc_thread_handle>* invokers_p;
172 caller_info = m_curr_proc_info;
173 if ( invokers_p->size() != 0 )
175 invoke_thread_p = invokers_p->back();
177 "queueing invocation thread to execute next" );
178 execute_thread_next(invoke_thread_p);
180 DEBUG_MSG( DEBUG_NAME, thread_h,
"preempting method with thread" );
182 m_cor_pkg->
yield( thread_h->m_cor_p );
183 m_curr_proc_info = caller_info;
184 DEBUG_MSG(DEBUG_NAME, thread_h,
"back from preempting method w/thread");
185 method_p->check_for_throws();
196 else if ( active_p != thread_h )
199 "preempting active thread with thread" );
200 execute_thread_next( active_p );
201 execute_thread_next( thread_h );
202 active_p->suspend_me();
213 DEBUG_MSG(DEBUG_NAME,thread_h,
"self preemption of active thread");
214 execute_thread_next( thread_h );
215 active_p->suspend_me();
251 sc_simcontext::pop_runnable_method()
254 if( method_h == 0 ) {
264 sc_simcontext::pop_runnable_thread()
267 if( thread_h == 0 ) {
290 std::vector<sc_thread_handle>&
293 return m_active_invokers;
299 return ( m_write_check == SC_SIGNAL_WRITE_CHECK_CONFLICT_ );
sc_process_b * sc_get_current_process_b()
std::vector< sc_thread_handle > & get_active_invokers()
void execute_method_next(sc_method_handle)
sc_curr_proc_handle get_curr_proc_info()
const char * sc_get_current_process_name(const char *if_empty=NULL)
void set_curr_proc(sc_process_b *)
void push_front_thread(sc_thread_handle)
sc_thread_handle pop_thread()
void remove_method(sc_method_handle)
virtual void yield(sc_cor *next_cor)=0
void remove_thread(sc_thread_handle)
Base class for all structural entities.
void push_back_method(sc_method_handle)
sc_curr_proc_kind proc_kind() const
void push_back_thread(sc_thread_handle)
For inline definitions of some utility functions.
void push_front_method(sc_method_handle)
const char * name() const
SC_API void sc_defunct_process_function(sc_module *)
Definition of the simulation context class.
class sc_thread_process * sc_thread_handle
class sc_method_process * sc_method_handle
bool write_check_conflicts_only() const
sc_simcontext * sc_get_curr_simcontext()
sc_process_b * process_handle
static sc_process_b * m_last_created_process_p
void execute_thread_next(sc_thread_handle)
#define DEBUG_MSG(NAME, P, MSG)
sc_method_handle pop_method()
Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21.