SystemC  Recoding Infrastructure for SystemC v0.6.3 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
Public Member Functions | Public Attributes | Friends | List of all members
sc_core::sc_simcontext Class Reference

The simulation context. More...

#include <sysc/kernel/sc_simcontext.h>

Collaboration diagram for sc_core::sc_simcontext:
Collaboration graph
[legend]

Public Member Functions

 sc_simcontext ()
 
 ~sc_simcontext ()
 
void initialize (bool=false)
 
void cycle (const sc_time &)
 This function is not supported by the out-of-order simulation in the current release. More...
 
void simulate (const sc_time &duration)
 
void stop ()
 
void end ()
 
void reset ()
 
void print_threads_states ()
 
void print_events_states ()
 
void update_dependency_set ()
 
void oooschedule (sc_cor *cor)
 Scheduling function in the OoO simulation. More...
 
int sim_status () const
 
bool elaboration_done () const
 
std::vector< sc_thread_handle > & get_active_invokers ()
 
sc_object_managerget_object_manager ()
 
sc_status get_status () const
 
sc_objectactive_object ()
 
void hierarchy_push (sc_module *)
 
sc_modulehierarchy_pop ()
 
sc_modulehierarchy_curr () const
 
sc_objectfirst_object ()
 
sc_objectnext_object ()
 
sc_objectfind_object (const char *name)
 
sc_module_registryget_module_registry ()
 
sc_port_registryget_port_registry ()
 
sc_export_registryget_export_registry ()
 
sc_prim_channel_registryget_prim_channel_registry ()
 
const char * gen_unique_name (const char *basename_, bool preserve_first=false)
 
sc_process_handle create_cthread_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. More...
 
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. More...
 
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. More...
 
sc_process_bget_curr_proc () const
 
sc_objectget_current_writer () const
 
bool write_check () const
 
void set_curr_proc (sc_process_b *)
 This function is not supported by the out-of-order simulation in the current release. More...
 
void reset_curr_proc ()
 
int next_proc_id ()
 
void add_trace_file (sc_trace_file *)
 
void remove_trace_file (sc_trace_file *)
 
const sc_timemax_time () const
 
const sc_timetime_stamp ()
 
sc_dt::uint64 change_stamp () const
 
sc_dt::uint64 delta_count () const
 
bool event_occurred (sc_dt::uint64 last_change_count) const
 
bool evaluation_phase () const
 
bool is_running () const
 
bool update_phase () const
 
bool notify_phase () const
 
bool get_error ()
 
void set_error (sc_report *)
 
sc_cor_pkgcor_pkg ()
 
sc_cornext_cor ()
 
const ::std::vector< sc_object * > & get_child_objects () const
 
void elaborate ()
 
void prepare_to_simulate ()
 
void initial_crunch (bool no_crunch)
 This function is partially supported by the out-of-order simulation in the current release. More...
 
bool next_time (sc_time &t) const
 
bool pending_activity_at_current_time () const
 
void remove_running_process (sc_process_b *)
 Remove a process from the running queue. More...
 
bool is_running_process (sc_process_b *)
 Check whether a process is in the running queue. More...
 
void suspend_cor (sc_cor *)
 Suspend a coroutine. More...
 
void resume_cor (sc_cor *)
 Resume a coroutine. More...
 
bool is_locked ()
 Check whether the kernel lock is acquired. More...
 
bool is_unlocked ()
 Check whether the kernel lock is released. More...
 
bool is_lock_owner ()
 Check whether the kernel lock is owned by the currently running coroutine. More...
 
bool is_not_owner ()
 Check whether the kernel lock is not owned by the currently running coroutine. More...
 
bool is_locked_and_owner ()
 Check whether the kernel lock is acquired and owned by the currently running coroutine. More...
 
unsigned int conflict_table_index_lookup (int, int)
 Convert segment ID and instance ID to index in the data conflict table and event notification table. More...
 
unsigned int time_adv_table_index_lookup (int)
 Convert segment ID to index in the time advance table. More...
 
const sc_timeget_oldest_untraced_time ()
 

Public Attributes

std::list< sc_process_b * > m_synch_thread_queue
 
std::list< sc_process_b * > m_all_proc
 
sc_time m_oldest_time
 
sc_timestamp m_simulation_duration
 
sc_timestamp m_simulation_time
 
sc_starvation_policy m_starvation_policy
 
int last_seg_id
 
std::list< sc_process_b * > m_waking_up_threads
 

Friends

class Invoker
 
struct sc_invoke_method
 
class sc_event
 
class sc_module
 
class sc_channel
 
class sc_object
 
class sc_time
 
class sc_clock
 
class sc_method_process
 
class sc_phase_callback_registry
 
class sc_process_b
 
class sc_process_handle
 
class sc_prim_channel
 
class sc_cthread_process
 
class sc_thread_process
 
class sc_runnable
 
struct sc_kernel_lock
 
sc_dt::uint64 sc_delta_count ()
 This function returns the local delta count of the running process. More...
 
const std::vector< sc_event * > & sc_get_top_level_events (const sc_simcontext *simc_p)
 
const std::vector< sc_object * > & sc_get_top_level_objects (const sc_simcontext *simc_p)
 
bool sc_is_running (const sc_simcontext *simc_p)
 
void sc_pause ()
 
bool sc_end_of_simulation_invoked ()
 
void sc_start (const sc_time &, sc_starvation_policy)
 
bool sc_start_of_simulation_invoked ()
 
void sc_thread_cor_fn (void *)
 
void sc_method_cor_fn (void *)
 
sc_time sc_time_to_pending_activity (const sc_simcontext *)
 
bool sc_pending_activity_at_current_time (const sc_simcontext *)
 
bool sc_pending_activity_at_future_time (const sc_simcontext *)
 
sc_corget_cor_pointer (sc_process_b *process_p)
 
void sc_set_time_resolution (double, sc_time_unit)
 
sc_time sc_get_time_resolution ()
 
void sc_set_default_time_unit (double, sc_time_unit)
 
sc_time sc_get_default_time_unit ()
 

Detailed Description

The simulation context.

Definition at line 329 of file sc_simcontext.h.

Constructor & Destructor Documentation

sc_core::sc_simcontext::sc_simcontext ( )
sc_core::sc_simcontext::~sc_simcontext ( )

Member Function Documentation

sc_object* sc_core::sc_simcontext::active_object ( )
void sc_core::sc_simcontext::add_trace_file ( sc_trace_file )
sc_dt::uint64 sc_core::sc_simcontext::change_stamp ( ) const
inline

Definition at line 1047 of file sc_simcontext.h.

unsigned int sc_core::sc_simcontext::conflict_table_index_lookup ( int  ,
int   
)

Convert segment ID and instance ID to index in the data conflict table and event notification table.

sc_cor_pkg* sc_core::sc_simcontext::cor_pkg ( )
inline

Definition at line 534 of file sc_simcontext.h.

sc_process_handle sc_core::sc_simcontext::create_cthread_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 sc_core::sc_simcontext::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 sc_core::sc_simcontext::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.

void sc_core::sc_simcontext::cycle ( const sc_time )

This function is not supported by the out-of-order simulation in the current release.

sc_dt::uint64 sc_core::sc_simcontext::delta_count ( ) const
void sc_core::sc_simcontext::elaborate ( )
bool sc_core::sc_simcontext::elaboration_done ( ) const
inline

Definition at line 958 of file sc_simcontext.h.

void sc_core::sc_simcontext::end ( )
bool sc_core::sc_simcontext::evaluation_phase ( ) const
inline

Definition at line 1063 of file sc_simcontext.h.

bool sc_core::sc_simcontext::event_occurred ( sc_dt::uint64  last_change_count) const
inline

Definition at line 1056 of file sc_simcontext.h.

sc_object* sc_core::sc_simcontext::find_object ( const char *  name)
sc_object* sc_core::sc_simcontext::first_object ( )
const char* sc_core::sc_simcontext::gen_unique_name ( const char *  basename_,
bool  preserve_first = false 
)
std::vector< sc_thread_handle > & sc_core::sc_simcontext::get_active_invokers ( )
inline

Definition at line 332 of file sc_simcontext_int.h.

const ::std::vector<sc_object*>& sc_core::sc_simcontext::get_child_objects ( ) const
sc_process_b* sc_core::sc_simcontext::get_curr_proc ( ) const
sc_object * sc_core::sc_simcontext::get_current_writer ( ) const
inline

Definition at line 1115 of file sc_simcontext.h.

bool sc_core::sc_simcontext::get_error ( )
inline

Definition at line 1094 of file sc_simcontext.h.

sc_export_registry * sc_core::sc_simcontext::get_export_registry ( )
inline

Definition at line 1008 of file sc_simcontext.h.

sc_module_registry * sc_core::sc_simcontext::get_module_registry ( )
inline

Definition at line 994 of file sc_simcontext.h.

sc_object_manager * sc_core::sc_simcontext::get_object_manager ( )
inline

Definition at line 987 of file sc_simcontext.h.

const sc_time& sc_core::sc_simcontext::get_oldest_untraced_time ( )
sc_port_registry * sc_core::sc_simcontext::get_port_registry ( )
inline

Definition at line 1001 of file sc_simcontext.h.

sc_prim_channel_registry * sc_core::sc_simcontext::get_prim_channel_registry ( )
inline

Definition at line 1015 of file sc_simcontext.h.

sc_status sc_core::sc_simcontext::get_status ( ) const
inline

Definition at line 964 of file sc_simcontext.h.

sc_module* sc_core::sc_simcontext::hierarchy_curr ( ) const
sc_module* sc_core::sc_simcontext::hierarchy_pop ( )
void sc_core::sc_simcontext::hierarchy_push ( sc_module )
void sc_core::sc_simcontext::initial_crunch ( bool  no_crunch)
inline

This function is partially supported by the out-of-order simulation in the current release.

void sc_core::sc_simcontext::initialize ( bool  = false)
bool sc_core::sc_simcontext::is_lock_owner ( )

Check whether the kernel lock is owned by the currently running coroutine.

bool sc_core::sc_simcontext::is_locked ( )

Check whether the kernel lock is acquired.

bool sc_core::sc_simcontext::is_locked_and_owner ( )

Check whether the kernel lock is acquired and owned by the currently running coroutine.

bool sc_core::sc_simcontext::is_not_owner ( )

Check whether the kernel lock is not owned by the currently running coroutine.

bool sc_core::sc_simcontext::is_running ( ) const
bool sc_core::sc_simcontext::is_running_process ( sc_process_b proc)
inline

Check whether a process is in the running queue.

Definition at line 1134 of file sc_simcontext.h.

bool sc_core::sc_simcontext::is_unlocked ( )

Check whether the kernel lock is released.

const sc_time & sc_core::sc_simcontext::max_time ( ) const
inline

Definition at line 1031 of file sc_simcontext.h.

sc_cor* sc_core::sc_simcontext::next_cor ( )
sc_object* sc_core::sc_simcontext::next_object ( )
int sc_core::sc_simcontext::next_proc_id ( )
inline

Definition at line 1023 of file sc_simcontext.h.

bool sc_core::sc_simcontext::next_time ( sc_time t) const
bool sc_core::sc_simcontext::notify_phase ( ) const
inline

Definition at line 1078 of file sc_simcontext.h.

void sc_core::sc_simcontext::oooschedule ( sc_cor cor)

Scheduling function in the OoO simulation.

bool sc_core::sc_simcontext::pending_activity_at_current_time ( ) const
void sc_core::sc_simcontext::prepare_to_simulate ( )
void sc_core::sc_simcontext::print_events_states ( )
void sc_core::sc_simcontext::print_threads_states ( )
void sc_core::sc_simcontext::remove_running_process ( sc_process_b proc)
inline

Remove a process from the running queue.

Definition at line 1128 of file sc_simcontext.h.

void sc_core::sc_simcontext::remove_trace_file ( sc_trace_file )
void sc_core::sc_simcontext::reset ( )
void sc_core::sc_simcontext::reset_curr_proc ( )
inline

Definition at line 103 of file sc_simcontext_int.h.

void sc_core::sc_simcontext::resume_cor ( sc_cor )

Resume a coroutine.

void sc_core::sc_simcontext::set_curr_proc ( sc_process_b process_h)
inline

This function is not supported by the out-of-order simulation in the current release.

Definition at line 93 of file sc_simcontext_int.h.

void sc_core::sc_simcontext::set_error ( sc_report err)
inline

Definition at line 1085 of file sc_simcontext.h.

int sc_core::sc_simcontext::sim_status ( ) const
inline

Definition at line 973 of file sc_simcontext.h.

void sc_core::sc_simcontext::simulate ( const sc_time duration)
void sc_core::sc_simcontext::stop ( )
void sc_core::sc_simcontext::suspend_cor ( sc_cor )

Suspend a coroutine.

unsigned int sc_core::sc_simcontext::time_adv_table_index_lookup ( int  )

Convert segment ID to index in the time advance table.

const sc_time& sc_core::sc_simcontext::time_stamp ( )
void sc_core::sc_simcontext::update_dependency_set ( )
bool sc_core::sc_simcontext::update_phase ( ) const
inline

Definition at line 1071 of file sc_simcontext.h.

bool sc_core::sc_simcontext::write_check ( ) const
inline

Definition at line 1122 of file sc_simcontext.h.

Friends And Related Function Documentation

sc_cor* get_cor_pointer ( sc_process_b process_p)
friend
friend class Invoker
friend

Definition at line 332 of file sc_simcontext.h.

friend class sc_channel
friend

Definition at line 339 of file sc_simcontext.h.

friend class sc_clock
friend

Definition at line 343 of file sc_simcontext.h.

friend class sc_cthread_process
friend

Definition at line 349 of file sc_simcontext.h.

sc_dt::uint64 sc_delta_count ( )
friend

This function returns the local delta count of the running process.

bool sc_end_of_simulation_invoked ( )
friend
friend class sc_event
friend

Definition at line 335 of file sc_simcontext.h.

sc_time sc_get_default_time_unit ( )
friend
sc_time sc_get_time_resolution ( )
friend
const std::vector<sc_event*>& sc_get_top_level_events ( const sc_simcontext simc_p = sc_get_curr_simcontext())
friend
const std::vector<sc_object*>& sc_get_top_level_objects ( const sc_simcontext simc_p = sc_get_curr_simcontext())
friend
friend struct sc_invoke_method
friend

Definition at line 334 of file sc_simcontext.h.

bool sc_is_running ( const sc_simcontext simc_p = sc_get_curr_simcontext())
friend
friend struct sc_kernel_lock
friend

Definition at line 369 of file sc_simcontext.h.

void sc_method_cor_fn ( void *  )
friend
friend class sc_method_process
friend

Definition at line 344 of file sc_simcontext.h.

friend class sc_module
friend

Definition at line 336 of file sc_simcontext.h.

friend class sc_object
friend

Definition at line 341 of file sc_simcontext.h.

void sc_pause ( )
friend
bool sc_pending_activity_at_current_time ( const sc_simcontext simc_p = sc_get_curr_simcontext())
friend
bool sc_pending_activity_at_future_time ( const sc_simcontext simc_p = sc_get_curr_simcontext())
friend
friend class sc_phase_callback_registry
friend

Definition at line 345 of file sc_simcontext.h.

friend class sc_prim_channel
friend

Definition at line 348 of file sc_simcontext.h.

friend class sc_process_b
friend

Definition at line 346 of file sc_simcontext.h.

friend class sc_process_handle
friend

Definition at line 347 of file sc_simcontext.h.

friend class sc_runnable
friend

Definition at line 351 of file sc_simcontext.h.

void sc_set_default_time_unit ( double  ,
sc_time_unit   
)
friend
void sc_set_time_resolution ( double  ,
sc_time_unit   
)
friend
void sc_start ( const sc_time ,
sc_starvation_policy   
)
friend
bool sc_start_of_simulation_invoked ( )
friend
void sc_thread_cor_fn ( void *  )
friend
friend class sc_thread_process
friend

Definition at line 350 of file sc_simcontext.h.

friend class sc_time
friend

Definition at line 342 of file sc_simcontext.h.

sc_time sc_time_to_pending_activity ( const sc_simcontext )
friend

Member Data Documentation

int sc_core::sc_simcontext::last_seg_id

Definition at line 897 of file sc_simcontext.h.

std::list<sc_process_b*> sc_core::sc_simcontext::m_all_proc

Definition at line 882 of file sc_simcontext.h.

sc_time sc_core::sc_simcontext::m_oldest_time

Definition at line 893 of file sc_simcontext.h.

sc_timestamp sc_core::sc_simcontext::m_simulation_duration

Definition at line 894 of file sc_simcontext.h.

sc_timestamp sc_core::sc_simcontext::m_simulation_time

Definition at line 895 of file sc_simcontext.h.

sc_starvation_policy sc_core::sc_simcontext::m_starvation_policy

Definition at line 896 of file sc_simcontext.h.

std::list<sc_process_b*> sc_core::sc_simcontext::m_synch_thread_queue

Definition at line 879 of file sc_simcontext.h.

std::list<sc_process_b*> sc_core::sc_simcontext::m_waking_up_threads

Definition at line 898 of file sc_simcontext.h.


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