29 #if !defined(sc_thread_process_h_INCLUDED)
30 #define sc_thread_process_h_INCLUDED
48 # define DEBUG_NAME ""
49 # define DEBUG_MSG(NAME,P,MSG) \
51 if ( P && ( (strlen(NAME)==0) || !strcmp(NAME,P->name())) ) \
52 std::cout << "**** " << sc_time_stamp() << " (" \
53 << sc_get_current_process_name() << "): " << MSG \
54 << " - " << P->name() << std::endl; \
57 # define DEBUG_MSG(NAME,P,MSG)
64 class sc_event_and_list;
65 class sc_event_or_list;
72 class sc_process_handle;
73 class sc_process_table;
79 void wait( sc_simcontext* );
80 void wait(
const sc_event&, sc_simcontext* );
81 void wait(
const sc_event_or_list&, sc_simcontext* );
82 void wait(
const sc_event_and_list&, sc_simcontext* );
83 void wait(
const sc_time&, sc_simcontext* );
84 void wait(
const sc_time&,
const sc_event&, sc_simcontext* );
85 void wait(
const sc_time&,
const sc_event_or_list&, sc_simcontext* );
86 void wait(
const sc_time&,
const sc_event_and_list&, sc_simcontext* );
118 virtual const char*
kind()
const
119 {
return "sc_thread_process"; }
218 DEBUG_MSG( DEBUG_NAME ,
this,
"suspending thread");
220 DEBUG_MSG( DEBUG_NAME ,
this,
"resuming thread");
238 DEBUG_MSG( DEBUG_NAME ,
this,
"throwing reset for");
243 DEBUG_MSG( DEBUG_NAME,
this,
"invoking throw_it for");
251 DEBUG_MSG( DEBUG_NAME,
this,
"throwing kill for");
256 DEBUG_MSG( DEBUG_NAME,
this,
"restarting thread");
274 e.add_dynamic(
this );
328 e.add_dynamic(
this );
401 for (
int mon_i = 0; mon_i < mon_n; mon_i++ )
438 return thread_p->m_cor_p;
471 #if ! defined( SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS )
477 #endif // SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS
633 #endif // !defined(sc_thread_process_h_INCLUDED)
virtual void enable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
virtual void throw_user(const sc_throw_it_helper &helper, sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
const char * name() const
friend sc_cor * get_cor_pointer(sc_process_b *process_p)
friend class sc_unwind_exception
void wait(int, sc_simcontext *)
const sc_event * m_event_p
virtual void throw_it()=0
void add_monitor(sc_process_monitor *monitor_p)
sc_thread_handle next_runnable()
virtual void throw_reset(bool async)
friend void wait(sc_simcontext *)
sc_thread_handle next_exist()
virtual void suspend_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
void(sc_process_host::* SC_ENTRY_FUNC)()
friend void sc_thread_cor_fn(void *)
virtual void kill_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
sc_process_b sc_process_b
virtual void resume_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
sc_process_b * sc_get_current_process_b()
sc_process_b * m_runnable_p
class sc_thread_process * sc_thread_handle
const sc_event_list * m_event_list_p
sc_event * m_timeout_event_p
void report_immediate_self_notification() const
virtual void prepare_for_simulation()
void sc_set_stack_size(sc_method_handle, std::size_t)
friend void sc_set_stack_size(sc_thread_handle, std::size_t)
virtual const char * kind() const
#define DEBUG_MSG(NAME, P, MSG)
sc_throw_it_helper * m_throw_helper_p
void add_dynamic(sc_method_handle) const
void signal_monitors(int type=0)
virtual ~sc_thread_process()
sc_descendant_inclusion_info
void sc_thread_cor_fn(void *arg)
void set_stack_size(std::size_t size)
#define SC_REPORT_ERROR(msg_type, msg)
bool trigger_dynamic(sc_event *)
virtual void yield(sc_cor *next_cor)=0
sc_simcontext * simcontext() const
sc_thread_process(const char *name_p, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p)
void remove_monitor(sc_process_monitor *monitor_p)
void set_next_runnable(sc_thread_handle next_p)
process_throw_type m_throw_status
sc_event * m_reset_event_p
virtual void disable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
void set_next_exist(sc_thread_handle next_p)
std::vector< sc_process_monitor * > m_monitor_q
sc_cor * get_cor_pointer(sc_process_b *process_p)
friend class sc_process_table
void wait_cycles(int n=1)