sc_core::sc_process_b Class Reference

User initiated dynamic process support. More...

#include <sysc/kernel/sc_process.h>

Inheritance diagram for sc_core::sc_process_b:
Inheritance graph
[legend]
Collaboration diagram for sc_core::sc_process_b:
Collaboration graph
[legend]

List of all members.

Public Types

enum  process_throw_type {
  THROW_NONE = 0, THROW_KILL, THROW_USER, THROW_ASYNC_RESET,
  THROW_SYNC_RESET
}
enum  process_state {
  ps_bit_disabled = 1, ps_bit_ready_to_run = 2, ps_bit_suspended = 4, ps_bit_zombie = 8,
  ps_normal = 0
}
enum  reset_type { reset_asynchronous = 0, reset_synchronous_off, reset_synchronous_on }
enum  trigger_t {
  STATIC, EVENT, OR_LIST, AND_LIST,
  TIMEOUT, EVENT_TIMEOUT, OR_LIST_TIMEOUT, AND_LIST_TIMEOUT
}

Public Member Functions

void set_upcoming_segment_ids (int *segment_ids)
 sets the upcoming segment ids TS 07/08/17
int * get_upcoming_segment_ids ()
 returns the upcoming segment ids TS 07/08/17
 sc_process_b (const char *name_p, bool is_thread, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p)
int current_state ()
bool dont_initialize () const
virtual void dont_initialize (bool dont)
std::string dump_state () const
const ::std::vector< sc_object * > & get_child_objects () const
sc_curr_proc_kind proc_kind () const
sc_eventreset_event ()
sc_eventterminated_event ()
void lock_and_push (CHNL_MTX_TYPE_ *lock)
 Acquire a new channel lock or increment the lock counter.
void pop_and_unlock (CHNL_MTX_TYPE_ *lock)
 Release a channel lock or decrement the lock counter.
void lock_all_channels (void)
 Acquire all the channel locks.
void unlock_all_channels (void)
 Release all the channel locks.
int get_segment_id ()
 Set the current segment ID of this process.
void set_segment_id (int id)
 Get the current segment ID of this process.
const sc_timestampget_timestamp ()
 Set the local time stamp of this process.
void set_timestamp (const sc_timestamp &ts)
 Get the local time stamp of this process.
int get_instance_id ()
 Set the instance ID of this process.
void set_instance_id (int id)
 Get the instance ID of this process.
void add_sensitivity_event (const sc_event &e)

Static Public Member Functions

static sc_process_handle last_created_process_handle ()

Public Attributes

bool event_list_member_triggered
sc_timestamp wake_up_time_for_event_list
int * segment_ids
 stores the upcoming segment ids TS 07/08/17
const char * file
int lineno
int proc_id
int m_process_state
 The name of this process.
sc_event_or_listm_sensitivity_events

Protected Member Functions

virtual ~sc_process_b ()
virtual void add_child_object (sc_object *)
void add_static_event (const sc_event &)
bool dynamic () const
const char * gen_unique_name (const char *basename_, bool preserve_first)
sc_reportget_last_report ()
bool is_disabled () const
bool is_runnable () const
virtual bool remove_child_object (sc_object *)
void remove_dynamic_events (bool skip_timeout=false)
void remove_static_events ()
void set_last_report (sc_report *last_p)
bool timed_out () const
void report_error (const char *msgid, const char *msg="") const
void report_immediate_self_notification () const
virtual void disable_process (sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
void disconnect_process ()
virtual void enable_process (sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
void initially_in_reset (bool async)
bool is_unwinding () const
bool start_unwinding ()
bool clear_unwinding ()
virtual void kill_process (sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
void reset_changed (bool async, bool asserted)
void reset_process (reset_type rt, sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
virtual void resume_process (sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
virtual void suspend_process (sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
virtual void throw_user (const sc_throw_it_helper &helper, sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)=0
virtual void throw_reset (bool async)=0
virtual bool terminated () const
void trigger_reset_event ()
void semantics ()

Static Protected Member Functions

static sc_process_blast_created_process_base ()

Protected Attributes

int m_active_areset_n
int m_active_reset_n
bool m_dont_init
bool m_dynamic_proc
const sc_eventm_event_p
int m_event_count
const sc_event_listm_event_list_p
sc_process_bm_exist_p
bool m_free_host
bool m_has_reset_signal
bool m_has_stack
bool m_is_thread
sc_reportm_last_report_p
sc_name_genm_name_gen_p
sc_curr_proc_kind m_process_kind
int m_references_n
std::vector< sc_reset * > m_resets
sc_eventm_reset_event_p
sc_eventm_resume_event_p
sc_process_bm_runnable_p
sc_process_hostm_semantics_host_p
SC_ENTRY_FUNC m_semantics_method_p
int m_state
std::vector< const sc_event * > m_static_events
bool m_sticky_reset
sc_eventm_term_event_p
sc_throw_it_helperm_throw_helper_p
process_throw_type m_throw_status
bool m_timed_out
sc_eventm_timeout_event_p
trigger_t m_trigger_type
bool m_unwinding
sc_acq_chnl_lock_queue m_acq_chnl_lock_queue
 A list of channel locks acquired by this process.
int m_segment_id
 The current segment ID of this process.
sc_timestamp m_timestamp
 The local time stamp of this process.
int m_instance_id
 The instance ID of this process.

Static Protected Attributes

static sc_process_bm_last_created_process_p

Friends

class sc_simcontext
class sc_cthread_process
class sc_method_process
class sc_process_handle
class sc_thread_process
class sc_object
class sc_port_base
class sc_runnable
class sc_sensitive
class sc_sensitive_pos
class sc_sensitive_neg
class sc_module
class sc_channel
class sc_report_handler
class sc_reset
class sc_reset_finder
class sc_unwind_exception
const char * sc_gen_unique_name (const char *, bool preserve_first)
sc_process_handle sc_get_current_process_handle ()
void sc_thread_cor_fn (void *arg)
bool timed_out (sc_simcontext *)

Detailed Description

User initiated dynamic process support.

This class implements the base class for a threaded process_base process whose semantics are provided by the true virtual method semantics(). Classes derived from this one will provide a version of semantics which implements the desired semantics. See the sc_spawn_xxx classes below.

Notes: (1) Object instances of this class maintain a reference count of outstanding handles. When the handle count goes to zero the object will be deleted. (2) Descriptions of the methods and operators in this class appear with their implementations. (3) The m_sticky_reset field is used to handle synchronous resets that are enabled via the sc_process_handle::sync_reset_on() method. These resets are not generated by a signal, but rather are modal by method call: sync_reset_on - sync_reset_off.

Definition at line 550 of file sc_process.h.


Member Enumeration Documentation

Enumerator:
ps_bit_disabled 
ps_bit_ready_to_run 
ps_bit_suspended 
ps_bit_zombie 
ps_normal 

Definition at line 640 of file sc_process.h.

Enumerator:
THROW_NONE 
THROW_KILL 
THROW_USER 
THROW_ASYNC_RESET 
THROW_SYNC_RESET 

Definition at line 632 of file sc_process.h.

Enumerator:
reset_asynchronous 
reset_synchronous_off 
reset_synchronous_on 

Definition at line 648 of file sc_process.h.

Enumerator:
STATIC 
EVENT 
OR_LIST 
AND_LIST 
TIMEOUT 
EVENT_TIMEOUT 
OR_LIST_TIMEOUT 
AND_LIST_TIMEOUT 

Definition at line 654 of file sc_process.h.


Constructor & Destructor Documentation

sc_core::sc_process_b::sc_process_b ( const char *  name_p,
bool  is_thread,
bool  free_host,
SC_ENTRY_FUNC  method_p,
sc_process_host host_p,
const sc_spawn_options opt_p 
)
virtual sc_core::sc_process_b::~sc_process_b (  )  [protected, virtual]

Member Function Documentation

void sc_core::sc_process_b::add_child_object ( sc_object object_p  )  [inline, protected, virtual]

Definition at line 903 of file sc_process.h.

void sc_core::sc_process_b::add_sensitivity_event ( const sc_event e  ) 
void sc_core::sc_process_b::add_static_event ( const sc_event  )  [protected]
bool sc_core::sc_process_b::clear_unwinding (  )  [inline, protected]

Definition at line 1012 of file sc_process.h.

int sc_core::sc_process_b::current_state (  )  [inline]

Definition at line 676 of file sc_process.h.

virtual void sc_core::sc_process_b::disable_process ( sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS  )  [protected, pure virtual]
void sc_core::sc_process_b::disconnect_process (  )  [protected]
virtual void sc_core::sc_process_b::dont_initialize ( bool  dont  )  [virtual]

Reimplemented in sc_core::sc_cthread_process.

bool sc_core::sc_process_b::dont_initialize (  )  const [inline]

Definition at line 677 of file sc_process.h.

std::string sc_core::sc_process_b::dump_state (  )  const
bool sc_core::sc_process_b::dynamic (  )  const [inline, protected]

Definition at line 763 of file sc_process.h.

virtual void sc_core::sc_process_b::enable_process ( sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS  )  [protected, pure virtual]
const char* sc_core::sc_process_b::gen_unique_name ( const char *  basename_,
bool  preserve_first 
) [protected]
const ::std::vector< sc_object * > & sc_core::sc_process_b::get_child_objects (  )  const [inline, virtual]

Reimplemented from sc_core::sc_object.

Definition at line 925 of file sc_process.h.

int sc_core::sc_process_b::get_instance_id (  ) 

Set the instance ID of this process.

sc_report* sc_core::sc_process_b::get_last_report (  )  [inline, protected]

Definition at line 765 of file sc_process.h.

int sc_core::sc_process_b::get_segment_id (  ) 

Set the current segment ID of this process.

const sc_timestamp& sc_core::sc_process_b::get_timestamp (  ) 

Set the local time stamp of this process.

int* sc_core::sc_process_b::get_upcoming_segment_ids (  )  [inline]

returns the upcoming segment ids TS 07/08/17

Definition at line 621 of file sc_process.h.

void sc_core::sc_process_b::initially_in_reset ( bool  async  )  [inline, protected]

Definition at line 940 of file sc_process.h.

bool sc_core::sc_process_b::is_disabled (  )  const [inline, protected]

Definition at line 953 of file sc_process.h.

bool sc_core::sc_process_b::is_runnable (  )  const [inline, protected]

Definition at line 964 of file sc_process.h.

bool sc_core::sc_process_b::is_unwinding (  )  const [inline, protected]

Definition at line 974 of file sc_process.h.

virtual void sc_core::sc_process_b::kill_process ( sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS  )  [protected, pure virtual]
sc_process_b * sc_core::sc_process_b::last_created_process_base (  )  [inline, static, protected]

Definition at line 1025 of file sc_process.h.

sc_process_handle sc_core::sc_process_b::last_created_process_handle (  )  [inline, static]

Definition at line 517 of file sc_process_handle.h.

void sc_core::sc_process_b::lock_all_channels ( void   ) 

Acquire all the channel locks.

Acquire all the channel locks in the list m_acq_chnl_lock_queue, from the beginning to the end.

void sc_core::sc_process_b::lock_and_push ( CHNL_MTX_TYPE_ *  lock  ) 

Acquire a new channel lock or increment the lock counter.

Acquire a new channel lock and push it to the end of the list m_acq_chnl_lock_queue, or increment the lock counter of the corresponding channel lock in the list.

void sc_core::sc_process_b::pop_and_unlock ( CHNL_MTX_TYPE_ *  lock  ) 

Release a channel lock or decrement the lock counter.

Release the channel lock at the end of the list m_acq_chnl_lock_queue if its lock counter equals one, or decrement its lock counter.

sc_curr_proc_kind sc_core::sc_process_b::proc_kind (  )  const [inline]

Definition at line 1037 of file sc_process.h.

bool sc_core::sc_process_b::remove_child_object ( sc_object object_p  )  [inline, protected, virtual]

Definition at line 912 of file sc_process.h.

void sc_core::sc_process_b::remove_dynamic_events ( bool  skip_timeout = false  )  [protected]
void sc_core::sc_process_b::remove_static_events (  )  [protected]
void sc_core::sc_process_b::report_error ( const char *  msgid,
const char *  msg = "" 
) const [protected]
void sc_core::sc_process_b::report_immediate_self_notification (  )  const [protected]
void sc_core::sc_process_b::reset_changed ( bool  async,
bool  asserted 
) [protected]
sc_event& sc_core::sc_process_b::reset_event (  ) 
void sc_core::sc_process_b::reset_process ( reset_type  rt,
sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS 
) [protected]
virtual void sc_core::sc_process_b::resume_process ( sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS  )  [protected, pure virtual]
void sc_core::sc_process_b::semantics (  )  [inline, protected]

Definition at line 1086 of file sc_process.h.

void sc_core::sc_process_b::set_instance_id ( int  id  ) 

Get the instance ID of this process.

void sc_core::sc_process_b::set_last_report ( sc_report last_p  )  [inline, protected]

Definition at line 772 of file sc_process.h.

void sc_core::sc_process_b::set_segment_id ( int  id  ) 

Get the current segment ID of this process.

void sc_core::sc_process_b::set_timestamp ( const sc_timestamp ts  ) 

Get the local time stamp of this process.

void sc_core::sc_process_b::set_upcoming_segment_ids ( int *  segment_ids  )  [inline]

sets the upcoming segment ids TS 07/08/17

Definition at line 612 of file sc_process.h.

bool sc_core::sc_process_b::start_unwinding (  )  [inline, protected]

Definition at line 987 of file sc_process.h.

virtual void sc_core::sc_process_b::suspend_process ( sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS  )  [protected, pure virtual]
bool sc_core::sc_process_b::terminated (  )  const [inline, protected, virtual]

Definition at line 1127 of file sc_process.h.

sc_event& sc_core::sc_process_b::terminated_event (  ) 
virtual void sc_core::sc_process_b::throw_reset ( bool  async  )  [protected, pure virtual]
virtual void sc_core::sc_process_b::throw_user ( const sc_throw_it_helper helper,
sc_descendant_inclusion_info  descendants = SC_NO_DESCENDANTS 
) [protected, pure virtual]
bool sc_core::sc_process_b::timed_out (  )  const [inline, protected]

Definition at line 1138 of file sc_process.h.

void sc_core::sc_process_b::trigger_reset_event (  )  [protected]
void sc_core::sc_process_b::unlock_all_channels ( void   ) 

Release all the channel locks.

Release all the channel locks in the list m_acq_chnl_lock_queue, from the end of the beginning.


Friends And Related Function Documentation

friend class sc_channel [friend]

Reimplemented from sc_core::sc_object.

Reimplemented in sc_core::sc_cthread_process, sc_core::sc_method_process, and sc_core::sc_thread_process.

Definition at line 566 of file sc_process.h.

friend class sc_cthread_process [friend]

Definition at line 552 of file sc_process.h.

const char* sc_gen_unique_name ( const char *  ,
bool  preserve_first 
) [friend]
sc_process_handle sc_get_current_process_handle (  )  [friend]
friend class sc_method_process [friend]

Definition at line 553 of file sc_process.h.

friend class sc_module [friend]

Reimplemented from sc_core::sc_object.

Reimplemented in sc_core::sc_cthread_process, sc_core::sc_method_process, and sc_core::sc_thread_process.

Definition at line 563 of file sc_process.h.

friend class sc_object [friend]

Definition at line 557 of file sc_process.h.

friend class sc_port_base [friend]

Definition at line 558 of file sc_process.h.

friend class sc_process_handle [friend]
friend class sc_report_handler [friend]

Definition at line 568 of file sc_process.h.

friend class sc_reset [friend]

Definition at line 569 of file sc_process.h.

friend class sc_reset_finder [friend]

Definition at line 570 of file sc_process.h.

friend class sc_runnable [friend]

Reimplemented from sc_core::sc_object.

Reimplemented in sc_core::sc_method_process, and sc_core::sc_thread_process.

Definition at line 559 of file sc_process.h.

friend class sc_sensitive [friend]

Definition at line 560 of file sc_process.h.

friend class sc_sensitive_neg [friend]

Definition at line 562 of file sc_process.h.

friend class sc_sensitive_pos [friend]

Definition at line 561 of file sc_process.h.

friend class sc_simcontext [friend]

Reimplemented from sc_core::sc_object.

Reimplemented in sc_core::sc_cthread_process, sc_core::sc_method_process, and sc_core::sc_thread_process.

Definition at line 551 of file sc_process.h.

void sc_thread_cor_fn ( void *  arg  )  [friend]

Reimplemented in sc_core::sc_thread_process.

friend class sc_thread_process [friend]

Reimplemented in sc_core::sc_cthread_process.

Definition at line 555 of file sc_process.h.

friend class sc_unwind_exception [friend]

Definition at line 571 of file sc_process.h.

bool timed_out ( sc_simcontext  )  [friend]

Member Data Documentation

Definition at line 595 of file sc_process.h.

Definition at line 817 of file sc_process.h.

Definition at line 818 of file sc_process.h.

A list of channel locks acquired by this process.

Definition at line 867 of file sc_process.h.

Definition at line 829 of file sc_process.h.

Definition at line 830 of file sc_process.h.

Definition at line 831 of file sc_process.h.

Definition at line 832 of file sc_process.h.

Definition at line 835 of file sc_process.h.

Definition at line 836 of file sc_process.h.

Definition at line 833 of file sc_process.h.

Definition at line 837 of file sc_process.h.

Definition at line 838 of file sc_process.h.

Definition at line 839 of file sc_process.h.

Definition at line 840 of file sc_process.h.

The instance ID of this process.

Definition at line 885 of file sc_process.h.

Definition at line 841 of file sc_process.h.

Definition at line 891 of file sc_process.h.

Definition at line 842 of file sc_process.h.

Definition at line 843 of file sc_process.h.

Definition at line 844 of file sc_process.h.

The name of this process.

Definition at line 825 of file sc_process.h.

Definition at line 845 of file sc_process.h.

Definition at line 847 of file sc_process.h.

std::vector<sc_reset*> sc_core::sc_process_b::m_resets [protected]

Definition at line 846 of file sc_process.h.

Definition at line 848 of file sc_process.h.

Definition at line 849 of file sc_process.h.

The current segment ID of this process.

Definition at line 873 of file sc_process.h.

Definition at line 850 of file sc_process.h.

Definition at line 851 of file sc_process.h.

Definition at line 827 of file sc_process.h.

Definition at line 852 of file sc_process.h.

std::vector<const sc_event*> sc_core::sc_process_b::m_static_events [protected]

Definition at line 853 of file sc_process.h.

Definition at line 854 of file sc_process.h.

Definition at line 855 of file sc_process.h.

Definition at line 856 of file sc_process.h.

Definition at line 857 of file sc_process.h.

Definition at line 858 of file sc_process.h.

Definition at line 859 of file sc_process.h.

The local time stamp of this process.

Definition at line 879 of file sc_process.h.

Definition at line 860 of file sc_process.h.

Definition at line 861 of file sc_process.h.

Definition at line 819 of file sc_process.h.

stores the upcoming segment ids TS 07/08/17

Definition at line 630 of file sc_process.h.

Definition at line 603 of file sc_process.h.


The documentation for this class was generated from the following files:

Generated on 30 Sep 2018 for SystemC by  doxygen 1.6.1