00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 #ifndef SC_SIMCONTEXT_H
00029 #define SC_SIMCONTEXT_H
00030 
00031 #include "sysc/kernel/sc_cmnhdr.h"
00032 #include "sysc/kernel/sc_process.h"
00033 #include "sysc/kernel/sc_status.h"
00034 #include "sysc/kernel/sc_time.h"
00035 #include "sysc/utils/sc_hash.h"
00036 #include "sysc/utils/sc_pq.h"
00037 #include <list>
00038 
00039 
00040 namespace sc_core {
00041 
00042 
00043 
00044 class sc_cor;
00045 class sc_cor_pkg;
00046 class sc_event;
00047 class sc_event_timed;
00048 class sc_export_registry;
00049 class sc_module;
00050 class sc_module_name;
00051 class sc_module_registry;
00052 class sc_name_gen;
00053 class sc_object;
00054 class sc_object_manager;
00055 class sc_phase_callback_registry;
00056 class sc_process_handle;
00057 class sc_port_registry;
00058 class sc_prim_channel_registry;
00059 class sc_process_table;
00060 class sc_signal_bool_deval;
00061 class sc_trace_file;
00062 class sc_runnable;
00063 class sc_process_host;
00064 class sc_method_process;
00065 class sc_cthread_process;
00066 class sc_thread_process;
00067 
00068 template< typename > class sc_plist;
00069 typedef sc_plist< sc_process_b* > sc_process_list;
00070 
00071 
00072 
00073 
00074 
00075 
00076 
00077 
00078 
00079 
00080 enum sc_stop_mode {          
00081     SC_STOP_FINISH_DELTA,
00082     SC_STOP_IMMEDIATE
00083 };
00084 extern void sc_set_stop_mode( sc_stop_mode mode );
00085 extern sc_stop_mode sc_get_stop_mode();
00086 
00087 enum sc_starvation_policy 
00088 {
00089     SC_EXIT_ON_STARVATION,
00090     SC_RUN_TO_TIME
00091 };
00092 extern void sc_start();
00093 extern void sc_start( const sc_time& duration, 
00094                       sc_starvation_policy p=SC_RUN_TO_TIME );
00095 inline void sc_start( int duration, sc_time_unit unit, 
00096                       sc_starvation_policy p=SC_RUN_TO_TIME )
00097 {
00098     sc_start( sc_time((double)duration,unit), p );
00099 }
00100 
00101 inline void sc_start( double duration, sc_time_unit unit, 
00102                       sc_starvation_policy p=SC_RUN_TO_TIME )
00103 {
00104     sc_start( sc_time(duration,unit), p );
00105 }
00106 
00107 extern void sc_stop();
00108 
00109 
00110 
00111 sc_dt::uint64 sc_delta_count();
00112 const std::vector<sc_event*>& sc_get_top_level_events(
00113                                 const   sc_simcontext* simc_p);
00114 const std::vector<sc_object*>& sc_get_top_level_objects(
00115                                 const   sc_simcontext* simc_p);
00116 bool    sc_is_running( const sc_simcontext* simc_p );
00117 void    sc_pause();
00118 bool    sc_end_of_simulation_invoked();
00119 void    sc_start( const sc_time&, sc_starvation_policy );
00120 bool    sc_start_of_simulation_invoked();
00121 void    sc_set_time_resolution( double, sc_time_unit );
00122 sc_time sc_get_time_resolution();
00123 void    sc_set_default_time_unit( double, sc_time_unit );
00124 sc_time sc_get_default_time_unit();
00125 bool    sc_pending_activity_at_current_time( const sc_simcontext* );
00126 bool    sc_pending_activity_at_future_time( const sc_simcontext* );
00127 sc_time sc_time_to_pending_activity( const sc_simcontext* );
00128 
00129 struct sc_invoke_method; 
00130 
00134 
00135 struct sc_kernel_lock {
00136     sc_simcontext* simc_p;
00137     sc_cor* m_cor_p;
00138     explicit sc_kernel_lock();
00139     ~sc_kernel_lock(); 
00140 };
00141 
00145 
00146 extern bool _OoO_Data_Conflict_Table[];
00147 
00151 
00152 extern unsigned int _OoO_Data_Conflict_Table_Size;
00153 
00157 
00158 extern bool _OoO_Event_Notify_Table[];
00159 
00163 
00164 extern unsigned int _OoO_Event_Notify_Table_Size;
00165 
00170 
00171 extern int _OoO_Conflict_Index_Lookup_Table[];
00172 
00176 
00177 extern unsigned int _OoO_Max_Number_of_Instances;
00178 
00182 
00183 extern unsigned int _OoO_Number_of_Segments;
00184 
00189 
00190 extern long long _OoO_Curr_Time_Advance_Table_Time[];
00191 
00196 
00197 extern int _OoO_Curr_Time_Advance_Table_Delta[];
00198 
00202 
00203 extern unsigned int _OoO_Curr_Time_Advance_Table_Size;
00204 
00209 
00210 extern long long _OoO_Next_Time_Advance_Table_Time[];
00211 
00216 
00217 extern int _OoO_Next_Time_Advance_Table_Delta[];
00218 
00222 
00223 extern unsigned int _OoO_Next_Time_Advance_Table_Size;
00224 
00228 
00229 extern int _OoO_Time_Advance_Index_Lookup_Table[];
00230 
00234 
00235 extern unsigned int _OoO_Time_Advance_Index_Lookup_Table_Size;
00236 
00237 
00243 class sc_simcontext
00244 {
00245     friend struct sc_invoke_method; 
00246     friend class sc_event;
00247     friend class sc_module;
00248 
00249     
00250     friend class sc_channel;
00251 
00252     friend class sc_object;
00253     friend class sc_time;
00254     friend class sc_clock;
00255     friend class sc_method_process;
00256     friend class sc_phase_callback_registry;
00257     friend class sc_process_b;
00258     friend class sc_process_handle;
00259     friend class sc_prim_channel;
00260     friend class sc_cthread_process;
00261     friend class sc_thread_process;
00262     friend sc_dt::uint64 sc_delta_count();
00263     friend const std::vector<sc_event*>& sc_get_top_level_events(
00264         const sc_simcontext* simc_p);
00265     friend const std::vector<sc_object*>& sc_get_top_level_objects(
00266         const sc_simcontext* simc_p);
00267     friend bool sc_is_running( const sc_simcontext* simc_p );
00268     friend void sc_pause();
00269     friend bool sc_end_of_simulation_invoked();
00270     friend void sc_start( const sc_time&, sc_starvation_policy );
00271     friend bool sc_start_of_simulation_invoked();
00272     friend void sc_thread_cor_fn(void*);
00273     friend sc_time sc_time_to_pending_activity( const sc_simcontext* );
00274     friend bool sc_pending_activity_at_current_time( const sc_simcontext* );
00275     friend bool sc_pending_activity_at_future_time( const sc_simcontext* );
00276 
00277     
00278     friend struct sc_kernel_lock;
00279 
00280     
00281     friend sc_cor* get_cor_pointer( sc_process_b* process_p ); 
00282 
00283 
00284     void init();
00285     void clean();
00286 
00287 public:
00288 
00289     sc_simcontext();
00290     ~sc_simcontext();
00291 
00292     void initialize( bool = false );
00293 
00298     
00299     void cycle( const sc_time& );
00300 
00301     void simulate( const sc_time& duration );
00302     void stop();
00303     void end();
00304     void reset();
00305 
00306     
00307     
00308 
00314     
00315     
00316 
00320     
00321     void oooschedule( sc_cor *cor );
00322 
00323     int sim_status() const;
00324     bool elaboration_done() const;
00325 
00326     std::vector<sc_thread_handle>& get_active_invokers();
00327 
00328     sc_object_manager* get_object_manager();
00329 
00330     inline sc_status get_status() const;
00331 
00332     sc_object* active_object();
00333 
00334     void hierarchy_push( sc_module* );
00335     sc_module* hierarchy_pop();
00336     sc_module* hierarchy_curr() const;
00337     sc_object* first_object();
00338     sc_object* next_object();
00339     sc_object* find_object( const char* name );
00340 
00341     sc_module_registry* get_module_registry();
00342     sc_port_registry* get_port_registry();
00343     sc_export_registry* get_export_registry();
00344     sc_prim_channel_registry* get_prim_channel_registry();
00345 
00346     
00347     const char* gen_unique_name( const char* basename_, 
00348                                  bool preserve_first = false 
00349                                );
00350 
00351     
00352 
00357     
00358     
00359     sc_process_handle create_cthread_process( 
00360     const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 
00361     sc_process_host* host_p, const sc_spawn_options* opt_p,
00362     int seg_id, int inst_id );
00363 
00368     
00369     
00370     sc_process_handle create_method_process( 
00371     const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 
00372     sc_process_host* host_p, const sc_spawn_options* opt_p,
00373     int seg_id, int inst_id );
00374 
00379     
00380     
00381     sc_process_handle create_thread_process( 
00382     const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 
00383     sc_process_host* host_p, const sc_spawn_options* opt_p,
00384     int seg_id, int inst_id );
00385 
00386     
00387     
00388 
00389     sc_process_b* get_curr_proc() const;
00390     sc_object* get_current_writer() const;
00391     bool write_check() const;
00392 
00397     
00398     void set_curr_proc( sc_process_b* );
00399 
00400     void reset_curr_proc();
00401 
00402     int next_proc_id();
00403 
00404     void add_trace_file( sc_trace_file* );
00405     void remove_trace_file( sc_trace_file* );
00406 
00407     friend void    sc_set_time_resolution( double, sc_time_unit );
00408     friend sc_time sc_get_time_resolution();
00409     friend void    sc_set_default_time_unit( double, sc_time_unit );
00410     friend sc_time sc_get_default_time_unit();
00411 
00412     const sc_time& max_time() const;
00413 
00414     
00415     const sc_time& time_stamp() const;
00416 
00417     sc_dt::uint64 change_stamp() const;
00418 
00419     
00420     sc_dt::uint64 delta_count() const;
00421 
00422     bool event_occurred( sc_dt::uint64 last_change_count ) const;
00423     bool evaluation_phase() const;
00424     bool is_running() const;
00425     bool update_phase() const;
00426     bool notify_phase() const;
00427     bool get_error();
00428     void set_error( sc_report* );
00429 
00430     sc_cor_pkg* cor_pkg()
00431         { return m_cor_pkg; }
00432     sc_cor* next_cor(); 
00433 
00434     const ::std::vector<sc_object*>& get_child_objects() const;
00435 
00436     void elaborate();
00437     void prepare_to_simulate();
00438 
00443     
00444     inline void initial_crunch( bool no_crunch );
00445 
00446     bool next_time( sc_time& t ) const; 
00447     bool pending_activity_at_current_time() const; 
00448 
00452     
00453     void remove_running_process( sc_process_b* );
00454 
00458     
00459     bool is_running_process( sc_process_b* );
00460 
00464     
00465     void suspend_cor( sc_cor* );
00466 
00470     
00471     void resume_cor( sc_cor* );
00472 
00476     
00477     bool is_locked();
00478 
00482     
00483     bool is_unlocked();
00484 
00489     
00490     bool is_lock_owner();
00491 
00496     
00497     bool is_not_owner();
00498 
00503     
00504     bool is_locked_and_owner();
00505 
00510     
00511     unsigned int conflict_table_index_lookup( int, int );
00512 
00516     
00517     unsigned int time_adv_table_index_lookup( int );
00518 
00519 private:
00520 
00521     void add_child_event( sc_event* );
00522     void add_child_object( sc_object* );
00523     void remove_child_event( sc_event* );
00524     void remove_child_object( sc_object* );
00525 
00526     
00527 
00528     int add_delta_event( sc_event* );
00529     void remove_delta_event( sc_event* );
00530     void add_timed_event( sc_event_timed* );
00531 
00532     void trace_cycle( bool delta_cycle );
00533 
00534     const ::std::vector<sc_event*>& get_child_events_internal() const;
00535     const ::std::vector<sc_object*>& get_child_objects_internal() const;
00536 
00537     void execute_method_next( sc_method_handle );
00538     void execute_thread_next( sc_thread_handle );
00539 
00540     sc_method_handle pop_runnable_method();
00541     sc_thread_handle pop_runnable_thread();
00542 
00547     
00548     void preempt_with( sc_method_handle );
00549 
00554     
00555     inline void preempt_with( sc_thread_handle );
00556 
00557     void push_runnable_method( sc_method_handle );
00558     void push_runnable_thread( sc_thread_handle );
00559 
00560     void push_runnable_method_front( sc_method_handle );
00561     void push_runnable_thread_front( sc_thread_handle );
00562 
00563     void remove_runnable_method( sc_method_handle );
00564     void remove_runnable_thread( sc_thread_handle );
00565 
00566     void requeue_current_process();
00567     void suspend_current_process();
00568 
00569     void do_sc_stop_action();
00570     void mark_to_collect_process( sc_process_b* zombie_p );
00571 
00575     
00576     void acquire_sched_mutex();
00577 
00581     
00582     void release_sched_mutex();
00583 
00587     
00588     bool has_no_conflicts( sc_process_b* );
00589 
00593     
00594     bool conflict_between( sc_process_b*, sc_process_b* );
00595 
00596 
00597 private:
00598 
00599     enum execution_phases {
00600         phase_initialize = 0,
00601         phase_evaluate,
00602         phase_update,
00603         phase_notify
00604     };
00605     sc_object_manager*          m_object_manager;
00606 
00607     sc_module_registry*         m_module_registry;
00608     sc_port_registry*           m_port_registry;
00609     sc_export_registry*         m_export_registry;
00610     sc_prim_channel_registry*   m_prim_channel_registry;
00611     sc_phase_callback_registry* m_phase_cb_registry;
00612 
00613     sc_name_gen*                m_name_gen;
00614 
00615     sc_process_table*           m_process_table;
00616 
00617     
00618     
00619 
00620     std::list<sc_process_b*>    m_curr_proc_queue;
00621 
00622     
00623     
00624 
00625     
00626     
00627 
00628     bool                        m_write_check;
00629     int                         m_next_proc_id;
00630 
00631     std::vector<sc_thread_handle> m_active_invokers;
00632 
00633     std::vector<sc_event*>      m_child_events;
00634     std::vector<sc_object*>     m_child_objects;
00635 
00636     std::vector<sc_event*>      m_delta_events;
00637     sc_ppq<sc_event_timed*>*    m_timed_events;
00638 
00639     std::vector<sc_trace_file*> m_trace_files;
00640     bool                        m_something_to_trace;
00641 
00642     sc_runnable*                m_runnable;
00643     sc_process_list*            m_collectable;
00644 
00645     sc_time_params*             m_time_params;
00646 
00647     
00648     
00649 
00650     mutable sc_time             m_max_time;
00651  
00652     sc_invoke_method*           m_method_invoker_p;
00653     sc_dt::uint64               m_change_stamp; 
00654 
00655     
00656     
00657 
00658     bool                        m_forced_stop;
00659     bool                        m_paused;
00660     bool                        m_ready_to_simulate;
00661     bool                        m_elaboration_done;
00662     execution_phases            m_execution_phase;
00663     sc_report*                  m_error;
00664     bool                        m_in_simulator_control;   
00665     bool                        m_end_of_simulation_called;
00666     sc_status                   m_simulation_status;
00667     bool                        m_start_of_simulation_called;
00668 
00669     sc_cor_pkg*                 m_cor_pkg; 
00670     sc_cor*                     m_cor;     
00671 
00672     
00673     
00674     bool                        m_one_delta_cycle; 
00675     bool                        m_one_timed_cycle;
00676     sc_time                     m_finish_time;
00677 
00678 private:
00679 
00680     
00681     sc_simcontext( const sc_simcontext& );
00682     sc_simcontext& operator = ( const sc_simcontext& );
00683 };
00684 
00685 
00686 
00687 
00688 
00689 #if 1
00690 extern sc_simcontext* sc_curr_simcontext;
00691 extern sc_simcontext* sc_default_global_context;
00692 
00693 inline sc_simcontext*
00694 sc_get_curr_simcontext()
00695 {
00696     if( sc_curr_simcontext == 0 ) {
00697         sc_default_global_context = new sc_simcontext;
00698         sc_curr_simcontext = sc_default_global_context;
00699     }
00700     return sc_curr_simcontext;
00701 }
00702 #else
00703     extern sc_simcontext* sc_get_curr_simcontext();
00704 #endif // 0
00705 inline sc_status sc_get_status()
00706 {
00707     return sc_get_curr_simcontext()->get_status();
00708 }
00709 
00710 
00711 
00712 
00713 inline
00714 bool
00715 sc_simcontext::elaboration_done() const
00716 {
00717     return m_elaboration_done;
00718 }
00719 
00720 
00721 inline sc_status sc_simcontext::get_status() const
00722 {
00723     return m_simulation_status != SC_RUNNING ? 
00724                   m_simulation_status :
00725                   (m_in_simulator_control ? SC_RUNNING : SC_PAUSED);
00726 }
00727 
00728 inline
00729 int
00730 sc_simcontext::sim_status() const
00731 {
00732     if( m_error ) {
00733         return SC_SIM_ERROR;
00734     }
00735     if( m_forced_stop ) {
00736         return SC_SIM_USER_STOP;
00737     }
00738     return SC_SIM_OK;
00739 }
00740 
00741 
00742 inline
00743 sc_object_manager*
00744 sc_simcontext::get_object_manager()
00745 {
00746     return m_object_manager;
00747 }
00748 
00749 inline
00750 sc_module_registry*
00751 sc_simcontext::get_module_registry()
00752 {
00753     return m_module_registry;
00754 }
00755 
00756 inline
00757 sc_port_registry*
00758 sc_simcontext::get_port_registry()
00759 {
00760     return m_port_registry;
00761 }
00762 
00763 inline
00764 sc_export_registry*
00765 sc_simcontext::get_export_registry()
00766 {
00767     return m_export_registry;
00768 }
00769 
00770 inline
00771 sc_prim_channel_registry*
00772 sc_simcontext::get_prim_channel_registry()
00773 {
00774     return m_prim_channel_registry;
00775 }
00776 
00777 
00778 inline
00779 int
00780 sc_simcontext::next_proc_id()
00781 {
00782     return ( ++ m_next_proc_id );
00783 }
00784 
00785 
00786 inline
00787 const sc_time&
00788 sc_simcontext::max_time() const
00789 {
00790     if ( m_max_time == SC_ZERO_TIME )
00791     {
00792         m_max_time = sc_time::from_value( ~sc_dt::UINT64_ZERO );
00793     }
00794     return m_max_time;
00795 }
00796 
00797 inline
00798 sc_dt::uint64
00799 sc_simcontext::change_stamp() const
00800 {
00801     return m_change_stamp;
00802 }
00803 
00804 inline
00805 const sc_time&
00806 sc_simcontext::time_stamp() const
00807 {
00808     
00809 
00810     
00811     sc_process_b* proc = get_curr_proc();
00812     static sc_time zero_time = sc_time::from_value( 0 );
00813 
00814     if ( proc )
00815         return proc->get_timestamp().get_time_count();
00816     else
00817         return zero_time;
00818 }
00819 
00820 
00821 inline 
00822 bool
00823 sc_simcontext::event_occurred(sc_dt::uint64 last_change_stamp) const
00824 {
00825     return m_change_stamp == last_change_stamp;
00826 }
00827 
00828 inline
00829 bool
00830 sc_simcontext::evaluation_phase() const
00831 {
00832     return (m_execution_phase == phase_evaluate) &&
00833            m_ready_to_simulate;
00834 }
00835 
00836 inline
00837 bool
00838 sc_simcontext::update_phase() const
00839 {
00840     return m_execution_phase == phase_update;
00841 }
00842 
00843 inline
00844 bool
00845 sc_simcontext::notify_phase() const
00846 {
00847     return m_execution_phase == phase_notify;
00848 }
00849 
00850 inline
00851 void
00852 sc_simcontext::set_error( sc_report* err )
00853 {
00854     delete m_error;
00855     m_error = err;
00856 }
00857 
00858 
00859 inline
00860 bool
00861 sc_simcontext::get_error()
00862 {
00863     return m_error != NULL;
00864 }
00865 
00866 inline
00867 int
00868 sc_simcontext::add_delta_event( sc_event* e )
00869 {
00870     m_delta_events.push_back( e );
00871     return ( m_delta_events.size() - 1 );
00872 }
00873 
00874 inline
00875 void
00876 sc_simcontext::add_timed_event( sc_event_timed* et )
00877 {
00878     m_timed_events->insert( et );
00879 }
00880 
00881 inline sc_object* 
00882 sc_simcontext::get_current_writer() const
00883 {
00884     
00885     return m_write_check ? get_curr_proc() : (sc_object*)0;
00886 }
00887 
00888 inline bool 
00889 sc_simcontext::write_check() const
00890 {
00891     return m_write_check;
00892 }
00893 
00894 inline void
00895 sc_simcontext::remove_running_process( sc_process_b* proc )
00896 {
00897     m_curr_proc_queue.remove( proc );
00898 }
00899 
00900 inline bool
00901 sc_simcontext::is_running_process( sc_process_b* proc )
00902 {
00903     for ( std::list<sc_process_b*>::iterator it = m_curr_proc_queue.begin(); 
00904           it != m_curr_proc_queue.end(); it++ )
00905         if ( *it == proc )
00906             return true;
00907     return false;
00908 }
00909 
00910 
00911 
00912 
00913 class sc_process_handle;
00914 sc_process_handle sc_get_current_process_handle();
00915 
00916 
00917 
00918 
00919 
00920 
00921 
00922 inline sc_object*
00923 sc_get_current_object()
00924 {
00925   return sc_get_curr_simcontext()->active_object();
00926 }
00927 
00928 inline
00929 sc_process_b*
00930 sc_get_current_process_b()
00931 {
00932     return sc_get_curr_simcontext()->get_curr_proc();
00933 }
00934 
00935 
00936 extern sc_process_b* sc_get_curr_process_handle();
00937 
00938 inline
00939 sc_curr_proc_kind
00940 sc_get_curr_process_kind()
00941 {
00942     return sc_get_curr_simcontext()->get_curr_proc()->proc_kind();
00943 }
00944 
00945 
00946 inline int sc_get_simulator_status()
00947 {
00948     return sc_get_curr_simcontext()->sim_status();
00949 }
00950 
00951 
00952 
00953 extern
00954 const char*
00955 sc_gen_unique_name( const char* basename_, bool preserve_first = false );
00956 
00957 
00958 
00959 extern
00960 void
00961 sc_set_random_seed( unsigned int seed_ );
00962 
00963 
00964 extern void sc_initialize();
00965 
00966 extern const sc_time& sc_max_time();    
00967 extern const sc_time& sc_time_stamp();  
00968 extern double sc_simulation_time();     
00969 
00970 inline
00971 const std::vector<sc_event*>& sc_get_top_level_events(
00972     const sc_simcontext* simc_p = sc_get_curr_simcontext() )
00973 {
00974     return simc_p->m_child_events;
00975 }
00976 
00977 inline
00978 const std::vector<sc_object*>& sc_get_top_level_objects(
00979     const sc_simcontext* simc_p = sc_get_curr_simcontext() )
00980 {
00981     return simc_p->m_child_objects;
00982 }
00983 
00984 extern sc_event* sc_find_event( const char* name );
00985 
00986 extern sc_object* sc_find_object( const char* name );
00987 
00991 inline
00992 sc_dt::uint64 sc_delta_count()
00993 {
00994     
00995 
00996     
00997     sc_process_b* proc = sc_get_current_process_b();
00998 
00999     if ( proc )
01000         return proc->get_timestamp().get_delta_count();
01001     else
01002         return 0;
01003 }
01004 
01005 inline 
01006 bool sc_is_running( const sc_simcontext* simc_p = sc_get_curr_simcontext() )
01007 {
01008     return simc_p->m_ready_to_simulate;
01009 }
01010 
01011 bool sc_is_unwinding();
01012 
01013 inline void sc_pause()
01014 {
01015     sc_get_curr_simcontext()->m_paused = true;
01016 }
01017 
01018 
01019 
01020 inline bool sc_pending_activity_at_current_time
01021   ( const sc_simcontext* simc_p = sc_get_curr_simcontext() )
01022 {
01023   return simc_p->pending_activity_at_current_time();
01024 }
01025 
01026 
01027 
01028 inline bool sc_pending_activity_at_future_time
01029   ( const sc_simcontext* simc_p = sc_get_curr_simcontext() )
01030 {
01031   sc_time ignored;
01032   return simc_p->next_time( ignored );
01033 }
01034 
01035 
01036 
01037 
01038 inline bool sc_pending_activity
01039   ( const sc_simcontext* simc_p = sc_get_curr_simcontext() )
01040 {
01041   return sc_pending_activity_at_current_time( simc_p )
01042       || sc_pending_activity_at_future_time( simc_p );
01043 }
01044 
01045 sc_time
01046 sc_time_to_pending_activity
01047   ( const sc_simcontext* simc_p = sc_get_curr_simcontext() );
01048 
01049 
01050 inline
01051 bool
01052 sc_end_of_simulation_invoked()
01053 {
01054     return sc_get_curr_simcontext()->m_end_of_simulation_called;
01055 }
01056 
01057 inline bool sc_hierarchical_name_exists( const char* name )
01058 {
01059     return sc_find_object(name) || sc_find_event(name);
01060 }
01061 
01062 inline
01063 bool 
01064 sc_start_of_simulation_invoked()
01065 {
01066     return sc_get_curr_simcontext()->m_start_of_simulation_called;
01067 }
01068 
01069 
01070 
01071 
01072 
01073 extern bool sc_allow_process_control_corners;
01074 
01075 } 
01076 
01077 
01078 
01079 
01080 
01081 
01082 
01083 
01084 
01085 
01086 
01087 
01088 
01089 
01090 
01091 
01092 
01093 
01094 
01095 
01096 
01097 
01098 
01099 
01100 
01101 
01102 
01103 
01104 
01105 
01106 
01107 
01108 
01109 
01110 
01111 
01112 
01113 
01114 
01115 
01116 
01117 
01118 
01119 
01120 
01121 
01122 
01123 
01124 
01125 
01126 
01127 
01128 
01129 
01130 
01131 
01132 
01133 
01134 
01135 
01136 
01137 
01138 
01139 
01140 
01141 
01142 
01143 
01144 
01145 
01146 
01147 
01148 
01149 
01150 
01151 
01152 
01153 
01154 
01155 
01156 
01157 
01158 
01159 
01160 
01161 
01162 
01163 
01164 
01165 
01166 
01167 
01168 
01169 
01170 
01171 
01172 
01173 
01174 
01175 
01176 
01177 
01178 
01179 
01180 
01181 
01182 
01183 
01184 
01185 
01186 
01187 
01188 
01189 
01190 
01191 
01192 
01193 
01194 
01195 
01196 
01197 
01198 
01199 
01200 
01201 
01202 
01203 
01204 
01205 
01206 
01207 
01208 
01209 
01210 
01211 
01212 
01213 
01214 
01215 
01216 
01217 
01218 
01219 
01220 
01221 
01222 
01223 
01224 
01225 
01226 
01227 
01228 
01229 
01230 
01231 
01232 
01233 
01234 
01235 
01236 
01237 
01238 
01239 
01240 
01241 
01242 
01243 
01244 
01245 #endif