User initiated dynamic process support. More...
#include <sysc/kernel/sc_process.h>
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_event & | reset_event () |
sc_event & | terminated_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_timestamp & | get_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. | |
Static Public Member Functions | |
static sc_process_handle | last_created_process_handle () |
Public Attributes | |
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. | |
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_report * | get_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_b * | last_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_event * | m_event_p |
int | m_event_count |
const sc_event_list * | m_event_list_p |
sc_process_b * | m_exist_p |
bool | m_free_host |
bool | m_has_reset_signal |
bool | m_has_stack |
bool | m_is_thread |
sc_report * | m_last_report_p |
sc_name_gen * | m_name_gen_p |
sc_curr_proc_kind | m_process_kind |
int | m_references_n |
std::vector< sc_reset * > | m_resets |
sc_event * | m_reset_event_p |
sc_event * | m_resume_event_p |
sc_process_b * | m_runnable_p |
sc_process_host * | m_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_event * | m_term_event_p |
sc_throw_it_helper * | m_throw_helper_p |
process_throw_type | m_throw_status |
bool | m_timed_out |
sc_event * | m_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_b * | m_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 *) |
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 545 of file sc_process.h.
Definition at line 610 of file sc_process.h.
Definition at line 602 of file sc_process.h.
Definition at line 618 of file sc_process.h.
Definition at line 624 of file sc_process.h.
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] |
void sc_core::sc_process_b::add_child_object | ( | sc_object * | object_p | ) | [inline, protected, virtual] |
Definition at line 871 of file sc_process.h.
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 980 of file sc_process.h.
int sc_core::sc_process_b::current_state | ( | ) | [inline] |
Definition at line 646 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
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 647 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 733 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
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 893 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 735 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 591 of file sc_process.h.
void sc_core::sc_process_b::initially_in_reset | ( | bool | async | ) | [inline, protected] |
Definition at line 908 of file sc_process.h.
bool sc_core::sc_process_b::is_disabled | ( | ) | const [inline, protected] |
Definition at line 921 of file sc_process.h.
bool sc_core::sc_process_b::is_runnable | ( | ) | const [inline, protected] |
Definition at line 932 of file sc_process.h.
bool sc_core::sc_process_b::is_unwinding | ( | ) | const [inline, protected] |
Definition at line 942 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
sc_process_b * sc_core::sc_process_b::last_created_process_base | ( | ) | [inline, static, protected] |
Definition at line 993 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 1005 of file sc_process.h.
bool sc_core::sc_process_b::remove_child_object | ( | sc_object * | object_p | ) | [inline, protected, virtual] |
Definition at line 880 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
void sc_core::sc_process_b::semantics | ( | ) | [inline, protected] |
Definition at line 1054 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 742 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 582 of file sc_process.h.
bool sc_core::sc_process_b::start_unwinding | ( | ) | [inline, protected] |
Definition at line 955 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
bool sc_core::sc_process_b::terminated | ( | ) | const [inline, protected, virtual] |
Definition at line 1095 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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
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] |
Implemented in sc_core::sc_method_process, and sc_core::sc_thread_process.
bool sc_core::sc_process_b::timed_out | ( | ) | const [inline, protected] |
Definition at line 1106 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.
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 561 of file sc_process.h.
friend class sc_cthread_process [friend] |
Definition at line 547 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 548 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 558 of file sc_process.h.
friend class sc_object [friend] |
Definition at line 552 of file sc_process.h.
friend class sc_port_base [friend] |
Definition at line 553 of file sc_process.h.
friend class sc_process_handle [friend] |
Reimplemented in sc_core::sc_cthread_process, sc_core::sc_method_process, and sc_core::sc_thread_process.
Definition at line 549 of file sc_process.h.
friend class sc_report_handler [friend] |
Definition at line 563 of file sc_process.h.
friend class sc_reset [friend] |
Definition at line 564 of file sc_process.h.
friend class sc_reset_finder [friend] |
Definition at line 565 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 554 of file sc_process.h.
friend class sc_sensitive [friend] |
Definition at line 555 of file sc_process.h.
friend class sc_sensitive_neg [friend] |
Definition at line 557 of file sc_process.h.
friend class sc_sensitive_pos [friend] |
Definition at line 556 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 546 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 550 of file sc_process.h.
friend class sc_unwind_exception [friend] |
Definition at line 566 of file sc_process.h.
bool timed_out | ( | sc_simcontext * | ) | [friend] |
const char* sc_core::sc_process_b::file |
Definition at line 787 of file sc_process.h.
Definition at line 788 of file sc_process.h.
A list of channel locks acquired by this process.
Definition at line 835 of file sc_process.h.
int sc_core::sc_process_b::m_active_areset_n [protected] |
Definition at line 797 of file sc_process.h.
int sc_core::sc_process_b::m_active_reset_n [protected] |
Definition at line 798 of file sc_process.h.
bool sc_core::sc_process_b::m_dont_init [protected] |
Definition at line 799 of file sc_process.h.
bool sc_core::sc_process_b::m_dynamic_proc [protected] |
Definition at line 800 of file sc_process.h.
int sc_core::sc_process_b::m_event_count [protected] |
Definition at line 803 of file sc_process.h.
const sc_event_list* sc_core::sc_process_b::m_event_list_p [protected] |
Definition at line 804 of file sc_process.h.
const sc_event* sc_core::sc_process_b::m_event_p [protected] |
Definition at line 801 of file sc_process.h.
sc_process_b* sc_core::sc_process_b::m_exist_p [protected] |
Definition at line 805 of file sc_process.h.
bool sc_core::sc_process_b::m_free_host [protected] |
Definition at line 806 of file sc_process.h.
bool sc_core::sc_process_b::m_has_reset_signal [protected] |
Definition at line 807 of file sc_process.h.
bool sc_core::sc_process_b::m_has_stack [protected] |
Definition at line 808 of file sc_process.h.
int sc_core::sc_process_b::m_instance_id [protected] |
The instance ID of this process.
Definition at line 853 of file sc_process.h.
bool sc_core::sc_process_b::m_is_thread [protected] |
Definition at line 809 of file sc_process.h.
sc_process_b* sc_core::sc_process_b::m_last_created_process_p [static, protected] |
Definition at line 859 of file sc_process.h.
sc_report* sc_core::sc_process_b::m_last_report_p [protected] |
Definition at line 810 of file sc_process.h.
sc_name_gen* sc_core::sc_process_b::m_name_gen_p [protected] |
Definition at line 811 of file sc_process.h.
Definition at line 812 of file sc_process.h.
The name of this process.
Definition at line 795 of file sc_process.h.
int sc_core::sc_process_b::m_references_n [protected] |
Definition at line 813 of file sc_process.h.
sc_event* sc_core::sc_process_b::m_reset_event_p [protected] |
Definition at line 815 of file sc_process.h.
std::vector<sc_reset*> sc_core::sc_process_b::m_resets [protected] |
Definition at line 814 of file sc_process.h.
sc_event* sc_core::sc_process_b::m_resume_event_p [protected] |
Definition at line 816 of file sc_process.h.
sc_process_b* sc_core::sc_process_b::m_runnable_p [protected] |
Definition at line 817 of file sc_process.h.
int sc_core::sc_process_b::m_segment_id [protected] |
The current segment ID of this process.
Definition at line 841 of file sc_process.h.
sc_process_host* sc_core::sc_process_b::m_semantics_host_p [protected] |
Definition at line 818 of file sc_process.h.
Definition at line 819 of file sc_process.h.
int sc_core::sc_process_b::m_state [protected] |
Definition at line 820 of file sc_process.h.
std::vector<const sc_event*> sc_core::sc_process_b::m_static_events [protected] |
Definition at line 821 of file sc_process.h.
bool sc_core::sc_process_b::m_sticky_reset [protected] |
Definition at line 822 of file sc_process.h.
sc_event* sc_core::sc_process_b::m_term_event_p [protected] |
Definition at line 823 of file sc_process.h.
Definition at line 824 of file sc_process.h.
Definition at line 825 of file sc_process.h.
bool sc_core::sc_process_b::m_timed_out [protected] |
Definition at line 826 of file sc_process.h.
sc_event* sc_core::sc_process_b::m_timeout_event_p [protected] |
Definition at line 827 of file sc_process.h.
sc_timestamp sc_core::sc_process_b::m_timestamp [protected] |
The local time stamp of this process.
Definition at line 847 of file sc_process.h.
trigger_t sc_core::sc_process_b::m_trigger_type [protected] |
Definition at line 828 of file sc_process.h.
bool sc_core::sc_process_b::m_unwinding [protected] |
Definition at line 829 of file sc_process.h.
Definition at line 789 of file sc_process.h.
stores the upcoming segment ids TS 07/08/17
Definition at line 600 of file sc_process.h.