35 #if !defined(sc_thread_process_h_INCLUDED) 36 #define sc_thread_process_h_INCLUDED 55 # define DEBUG_NAME "" 56 # define DEBUG_MSG(NAME,P,MSG) \ 58 if ( P && ( (std::strlen(NAME)==0) || !std::strcmp(NAME,P->name())) ) \ 59 std::cout << "**** " << sc_time_stamp() << " (" \ 60 << sc_get_current_process_name("** NONE **") << "): " << MSG \ 61 << " - " << P->name() << std::endl; \ 64 # define DEBUG_MSG(NAME,P,MSG) 71 class sc_event_and_list;
72 class sc_event_or_list;
79 class sc_process_handle;
80 class sc_process_table;
125 virtual const char*
kind()
const 126 {
return "sc_thread_process"; }
224 DEBUG_MSG( DEBUG_NAME ,
this,
"suspending thread");
226 DEBUG_MSG( DEBUG_NAME ,
this,
"resuming thread");
244 DEBUG_MSG( DEBUG_NAME ,
this,
"throwing reset for");
249 DEBUG_MSG( DEBUG_NAME,
this,
"invoking throw_it for");
257 DEBUG_MSG( DEBUG_NAME,
this,
"throwing kill for");
261 if( !unwinding_preempted )
263 ,
"unexpected unwinding/throw status" );
266 DEBUG_MSG( DEBUG_NAME,
this,
"restarting thread");
284 e.add_dynamic(
this );
338 e.add_dynamic(
this );
411 for (
int mon_i = 0; mon_i < mon_n; mon_i++ )
448 return thread_p->m_cor_p;
481 #if ! defined( SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS ) 487 #endif // SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS 643 #endif // !defined(sc_thread_process_h_INCLUDED) friend class sc_process_table
friend void sc_set_stack_size(sc_thread_handle, std::size_t)
void signal_monitors(int type=0)
sc_process_b * sc_get_current_process_b()
sc_process_b * m_runnable_p
Process base class support.
void add_monitor(sc_process_monitor *monitor_p)
std::vector< sc_process_monitor * > m_monitor_q
sc_cor * get_cor_pointer(sc_process_b *process_p)
bool trigger_dynamic(sc_event *)
virtual void resume_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
Coroutine abstract base classes.
void set_next_runnable(sc_thread_handle next_p)
friend void sc_thread_cor_fn(void *)
virtual ~sc_thread_process()
#define DEBUG_MSG(NAME, P, MSG)
const sc_event * m_event_p
void report_immediate_self_notification() const
virtual void throw_reset(bool async)
sc_thread_handle next_exist()
virtual void prepare_for_simulation()
const sc_event_list * m_event_list_p
sc_event * m_reset_event_p
sc_event * m_timeout_event_p
Coroutine abstract base class.
virtual void yield(sc_cor *next_cor)=0
Base class for all structural entities.
virtual void suspend_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
#define SC_REPORT_FATAL(msg_type, msg)
void remove_monitor(sc_process_monitor *monitor_p)
void wait_cycles(int n=1)
void(sc_process_host::* SC_ENTRY_FUNC)()
friend void wait(sc_simcontext *)
virtual const char * kind() const
void sc_thread_cor_fn(void *arg)
virtual void disable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
friend class sc_unwind_exception
SC_API void sc_set_stack_size(sc_method_handle, std::size_t)
SC_API const char SC_ID_INTERNAL_ERROR_[]
Process spawning options specification.
friend sc_cor * get_cor_pointer(sc_process_b *process_p)
void set_next_exist(sc_thread_handle next_p)
const char * name() const
class sc_thread_process * sc_thread_handle
virtual void throw_it()=0
#define SC_REPORT_ERROR(msg_type, msg)
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 add_dynamic(sc_method_handle) const
sc_throw_it_helper * m_throw_helper_p
void set_stack_size(std::size_t size)
sc_process_b sc_process_b
virtual void kill_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
class SC_API sc_simcontext
process_throw_type m_throw_status
virtual void enable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
sc_simcontext * simcontext() const
virtual void throw_user(const sc_throw_it_helper &helper, sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
sc_descendant_inclusion_info
Original Author: Martin Janssen, Synopsys, Inc., 2001-05-21.
sc_thread_handle next_runnable()
void SC_API wait(int, sc_simcontext *)