35 #if !defined(sc_process_h_INCLUDED) 36 #define sc_process_h_INCLUDED 43 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) 45 #pragma warning(disable: 4251) // DLL import for std::vector 51 class sc_process_handle;
52 class sc_thread_process;
120 virtual void signal(sc_thread_handle thread_p,
int type);
139 #if defined(_MSC_VER) 140 #if ( _MSC_VER > 1200 ) 141 # define SC_USE_MEMBER_FUNC_PTR 144 # define SC_USE_MEMBER_FUNC_PTR 150 #if defined(SC_USE_MEMBER_FUNC_PTR) 153 # define SC_DECL_HELPER_STRUCT(callback_tag, func) 154 # define SC_MAKE_FUNC_PTR(callback_tag, func) \ 155 static_cast<sc_core::SC_ENTRY_FUNC>(&callback_tag::func) 160 #else // !defined(SC_USE_MEMBER_FUNC_PTR) 161 class SC_API sc_process_call_base {
163 inline sc_process_call_base()
167 virtual ~sc_process_call_base()
171 virtual void invoke(sc_process_host* host_p)
175 extern sc_process_call_base sc_process_defunct;
178 class sc_process_call :
public sc_process_call_base {
180 sc_process_call(
void (T::*method_p)() ) :
181 sc_process_call_base()
183 m_method_p = method_p;
186 virtual ~sc_process_call()
190 virtual void invoke(sc_process_host* host_p)
192 (((T*)host_p)->*m_method_p)();
196 void (T::*m_method_p)();
200 # define SC_DECL_HELPER_STRUCT(callback_tag, func) 201 # define SC_MAKE_FUNC_PTR(callback_tag, func) \ 202 (::sc_core::SC_ENTRY_FUNC) (new \ 203 ::sc_core::sc_process_call<callback_tag>(&callback_tag::func)) 205 #endif // !defined(SC_USE_MEMBER_FUNC_PTR) 213 class sc_spawn_options;
214 class sc_unwind_exception;
239 virtual void throw_it() = 0;
244 template<
typename EXCEPT>
251 virtual inline this_type*
clone()
const {
return new this_type(m_value); }
282 friend class sc_process_table;
313 ps_bit_ready_to_run = 2,
314 ps_bit_suspended = 4,
320 reset_asynchronous = 0,
338 sc_process_b(
const char* name_p,
bool is_thread,
bool free_host,
350 std::string dump_state()
const;
351 const ::std::vector<sc_object*>& get_child_objects()
const;
360 virtual void add_child_object(
sc_object* );
361 void add_static_event(
const sc_event& );
362 bool dynamic()
const {
return m_dynamic_proc; }
363 const char* gen_unique_name(
const char* basename_,
bool preserve_first );
365 inline bool is_disabled()
const;
366 inline bool is_runnable()
const;
367 static inline sc_process_b* last_created_process_base();
368 virtual bool remove_child_object(
sc_object* );
369 void remove_dynamic_events(
bool skip_timeout =
false );
370 void remove_static_events();
373 delete m_last_report_p;
374 m_last_report_p = last_p;
377 void report_error(
const char* msgid,
const char* msg =
"" )
const;
378 void report_immediate_self_notification()
const;
381 virtual void disable_process(
383 void disconnect_process();
384 virtual void enable_process(
386 inline void initially_in_reset(
bool async );
387 inline bool is_unwinding()
const;
388 inline bool start_unwinding();
389 inline bool clear_unwinding();
390 virtual void kill_process(
392 void reset_changed(
bool async,
bool asserted );
395 virtual void resume_process(
397 virtual void suspend_process(
401 virtual void throw_reset(
bool async ) = 0;
402 virtual bool terminated()
const;
403 void trigger_reset_event();
406 void delete_process();
407 inline void reference_decrement();
408 inline void reference_increment();
411 inline void semantics();
470 reference_increment();
477 reference_decrement();
486 inline const ::std::vector<sc_object*>&
489 return m_child_objects;
517 return (m_state & ps_bit_disabled) ? true :
false;
528 return m_runnable_p != 0;
553 switch( m_throw_status )
556 case THROW_ASYNC_RESET:
557 case THROW_SYNC_RESET:
589 return m_last_created_process_p;
601 return m_process_kind;
612 inline void sc_process_b::reference_decrement()
615 if ( m_references_n == 0 ) delete_process();
625 inline void sc_process_b::reference_increment()
664 if ( m_reset_event_p &&
665 ( (m_throw_status == THROW_SYNC_RESET) ||
666 (m_throw_status == THROW_ASYNC_RESET) )
668 trigger_reset_event();
673 m_throw_status = m_active_areset_n ? THROW_ASYNC_RESET :
674 ( m_active_reset_n ? THROW_SYNC_RESET : THROW_NONE);
678 # ifndef SC_USE_MEMBER_FUNC_PTR 679 m_semantics_method_p->invoke( m_semantics_host_p );
681 (m_semantics_host_p->*m_semantics_method_p)();
693 return (m_state & ps_bit_zombie) != 0;
709 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN) 902 #endif // !defined(sc_process_h_INCLUDED)
std::vector< sc_reset * > m_resets
virtual bool remove_child_object(sc_object *object_p)
Static sensitivity class for negative edge events.
sc_process_b * m_runnable_p
void set_last_report(sc_report *last_p)
Default constants whose values may need to be.
virtual this_type * clone() const
Abstract base class of all SystemC `simulation' objects.
virtual ~sc_process_host()
virtual bool remove_child_object(sc_object *)
const sc_event * m_event_p
virtual ~sc_process_monitor()
class sc_cthread_process * sc_cthread_handle
Abstract base class for class sc_port_b.
static sc_process_b * last_created_process_base()
Base class for lists of events.
sc_name_gen * m_name_gen_p
Static sensitivity class for positive edge events.
uint64 const sc_uint_base int b
virtual bool terminated() const
sc_curr_proc_kind m_process_kind
const ::std::vector< sc_object * > & get_child_objects() const
const sc_event_list * m_event_list_p
sc_event * m_reset_event_p
sc_event * m_timeout_event_p
virtual ~sc_throw_it_helper()
Unique name generator class.
SC_ENTRY_FUNC m_semantics_method_p
Base class for all structural entities.
Static sensitivity class for events.
sc_curr_proc_kind proc_kind() const
void(sc_process_host::* SC_ENTRY_FUNC)()
bool dont_initialize() const
sc_clock period is zero sc_clock low time is zero sc_fifo< T > cannot have more than one writer bind interface to port failed complete binding failed remove port failed insert primitive channel failed sc_signal< T > cannot have more than one driver resolved port not bound to resolved signal sc_semaphore requires an initial value
void sc_thread_cor_fn(void *arg)
Abstract base class of all SystemC `simulation' objects.
SC_API bool timed_out(sc_simcontext *)
Base classes of all export classes.
SC_API void sc_set_stack_size(sc_method_handle, std::size_t)
sc_process_host * m_semantics_host_p
SC_API const char * sc_gen_unique_name(const char *, bool preserve_first)
SC_API bool sc_allow_process_control_corners
bool is_unwinding() const
sc_throw_it(const EXCEPT &value)
class sc_thread_process * sc_thread_handle
class sc_method_process * sc_method_handle
virtual void signal(sc_thread_handle thread_p, int type)
static sc_process_b * m_last_created_process_p
Report ids for the kernel code.
sc_event * m_term_event_p
virtual void add_child_object(sc_object *)
void initially_in_reset(bool async)
sc_event * m_resume_event_p
sc_throw_it_helper * m_throw_helper_p
operand is not sc_logic object already exists internal maximum number of processes per module module construction not properly hierarchical name as shown may be incorrect due to previous errors incorrect use of sc_module_name set time resolution failed default time unit changed to time resolution immediate notification is not allowed during update phase or elaboration use dont_initialize() has no effect for SC_CTHREADs" ) SC_DEFINE_MESSAGE(SC_ID_WAIT_N_INVALID_
SC_API sc_process_handle sc_get_current_process_handle()
sc_report * get_last_report()
sc_process_b sc_process_b
virtual void add_child_object(sc_object *object_p)
std::vector< const sc_event * > m_static_events
class SC_API sc_simcontext
process_throw_type m_throw_status
sc_report * m_last_report_p
sc_descendant_inclusion_info