31 #if !defined(sc_spawn_h_INCLUDED)
32 #define sc_spawn_h_INCLUDED
42 class sc_event_finder;
112 template <
typename T>
115 const char* name_p = 0,
125 if ( !opt_p || !opt_p->is_method() )
140 return thread_handle;
158 return method_handle;
218 #if !defined (__HP_aCC)
243 template <
typename T>
245 typename T::result_type* r_p,
247 const char* name_p = 0,
258 if ( !opt_p || !opt_p->is_method() )
273 return thread_handle;
291 return method_handle;
298 template<
typename T,
typename R>
299 class sc_spawn_object_v :
public sc_process_host {
321 template <
typename T,
typename R>
325 const char* name_p = 0,
326 const sc_spawn_options* opt_p = 0)
328 sc_simcontext* context_p;
329 sc_spawn_object_v<T,R>* spawn_p;
335 spawn_p =
new sc_spawn_object_v<T,R>(r_p, object);
336 if ( !opt_p || !opt_p->is_method() )
344 sc_process_handle thread_handle = context_p->create_thread_process(
346 static_cast<sc_core::SC_ENTRY_FUNC>(
347 &sc_spawn_object_v<T,R>::semantics),
352 return thread_handle;
363 sc_process_handle method_handle = context_p->create_method_process(
365 static_cast<sc_core::SC_ENTRY_FUNC>(
366 &sc_spawn_object_v<T,R>::semantics),
371 return method_handle;
421 #endif // !defined(sc_spawn_h_INCLUDED)
T::result_type * m_result_p
A scoped mutex for the kernel lock.
sc_spawn_object(T object)
sc_process_b sc_process_b
This class provides access to an sc_process_b object instance in a manner which allows some persisten...
sc_spawn_object_v(typename T::result_type *r_p, T object)
sc_process_handle sc_spawn(T object, const char *name_p=0, const sc_spawn_options *opt_p=0)
Semantic object with no return value.
sc_simcontext * sc_get_curr_simcontext()
#define SC_MAKE_FUNC_PTR(callback_tag, func)
This is the base class for objects which may have processes defined for their methods (e...
Semantic object with return value.
sc_process_handle create_method_process(const char *name_p, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p, int seg_id, int inst_id)
Two new parameters segment ID and instance ID are added for the out-of-order simulation.
sc_process_handle create_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, int seg_id, int inst_id)
Two new parameters segment ID and instance ID are added for the out-of-order simulation.