SystemC  Recoding Infrastructure for SystemC v0.6.0 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_simcontext.h
Go to the documentation of this file.
1 /*****************************************************************************
2 
3  The following code is derived, directly or indirectly, from the SystemC
4  source code Copyright (c) 1996-2014 by all Contributors.
5  All Rights reserved.
6 
7  The contents of this file are subject to the restrictions and limitations
8  set forth in the SystemC Open Source License (the "License");
9  You may not use this file except in compliance with such restrictions and
10  limitations. You may obtain instructions on how to receive a copy of the
11  License at http://www.accellera.org/. Software distribu ted by Contributors
12  under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
13  ANY KIND, either express or implied. See the License for the specific
14  language governing rights and limitations under the License.
15 
16  ***************************** ** **********************************************/
17 
18 /*****************************************************************************
19 
20  sc_simcontext.h -- Definition of the simulation context class.
21 
22  Original Author: Stan Y. Liao, Synopsys, Inc.
23  Martin Janssen, Synopsys, Inc.
24 
25  CHANGE LOG AT THE END OF THE FILE
26  *****************************************************************************/
27 
28 #ifndef SC_SIMCONTEXT_H
29 #define SC_SIMCONTEXT_H
30 
31 #include "sysc/kernel/sc_cmnhdr.h"
32 #include "sysc/kernel/sc_process.h"
33 #include "sysc/kernel/sc_status.h"
34 #include "sysc/kernel/sc_time.h"
35 #include "sysc/utils/sc_hash.h"
36 #include "sysc/utils/sc_pq.h"
37 #include <map>
38 #include <unordered_map>
39 #include <list>
40 #include <string.h>
41 #include <time.h>
42 
43 // 02/22/2016 ZC: to enable verbose display or not
44 #ifndef _SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR
45 #define _SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR "SYSC_PRINT_VERBOSE_MESSAGE"
46 #endif
47 namespace sc_core {
48 
49 // forward declarations
50 class Invoker; //DM 05/16/2019
51 
52 class sc_cor;
53 class sc_cor_pkg;
54 class sc_event;
55 class sc_event_timed;
56 class sc_export_registry;
57 class sc_module;
58 class sc_module_name;
59 class sc_module_registry;
60 class sc_name_gen;
61 class sc_object;
62 class sc_object_manager;
63 class sc_phase_callback_registry;
64 class sc_process_handle;
65 class sc_port_registry;
66 class sc_prim_channel_registry;
67 class sc_process_table;
68 class sc_signal_bool_deval;
69 class sc_trace_file;
70 class sc_runnable;
71 class sc_process_host;
72 class sc_method_process;
73 class sc_cthread_process;
74 class sc_thread_process;
75 
76 template< typename > class sc_plist;
78 
79 
80 
81 enum sc_stop_mode { // sc_stop modes:
84 };
85 extern void sc_set_stop_mode( sc_stop_mode mode );
87 
89 {
92 };
93 extern void sc_start();
94 extern void sc_start( const sc_time& duration,
96 inline void sc_start( int duration, sc_time_unit unit,
98 {
99  sc_start( sc_time((double)duration,unit), p );
100 }
101 
102 inline void sc_start( double duration, sc_time_unit unit,
104 {
105  sc_start( sc_time(duration,unit), p );
106 }
107 
108 extern void sc_stop();
109 
110 // 06/16/2016 GL: enable synchronized parallel simulation
111 extern bool _SYSC_SYNC_PAR_SIM;
112 
113 // friend function declarations
114 
116 const std::vector<sc_event*>& sc_get_top_level_events(
117  const sc_simcontext* simc_p);
118 const std::vector<sc_object*>& sc_get_top_level_objects(
119  const sc_simcontext* simc_p);
120 bool sc_is_running( const sc_simcontext* simc_p );
121 void sc_pause();
123 void sc_start( const sc_time&, sc_starvation_policy );
125 void sc_set_time_resolution( double, sc_time_unit );
126 sc_time sc_get_time_resolution();
127 void sc_set_default_time_unit( double, sc_time_unit );
128 sc_time sc_get_default_time_unit();
129 bool sc_pending_activity_at_current_time( const sc_simcontext* );
130 bool sc_pending_activity_at_future_time( const sc_simcontext* );
131 sc_time sc_time_to_pending_activity( const sc_simcontext* );
132 
133 struct sc_invoke_method;
134 
138 // 05/22/2015 GL.
142  explicit sc_kernel_lock();
143  ~sc_kernel_lock();
144 };
145 
146 // 09/01/2019 ZC.
147 extern const char* _OoO_Table_File_Name;
148 
149 // 09/01/2019 ZC.
150 // extern std::string _OoO_File_Name_;
151 // 02/21/2017 ZC.
152 extern unsigned int _OoO_Combined_Data_Conflict_Table_Size;
153 
154 // 02/21/2017 ZC.
156 
157 // 02/21/2017 ZC.
159 
160 // 02/21/2017 ZC.
162 
163 // 02/21/2017 ZC.
165 
166 // 02/21/2017 ZC.
168 
169 // 02/21/2017 ZC.
171 
172 // 02/21/2017 ZC.
174 
175 // 02/21/2017 ZC.
177 
178 
179 // 02/21/2017 ZC.
181 
182 // 02/21/2017 ZC.
184 
185 // 02/21/2017 ZC.
187 
188 // 02/21/2017 ZC.
190 
191 // 02/21/2017 ZC.
193 
194 // 02/21/2017 ZC.
196 
197 // 02/21/2017 ZC.
199 
200 // 02/21/2017 ZC.
202 
203 // 02/21/2017 ZC.
205 
206 // 02/21/2017 ZC.
208 
209 // 02/21/2017 ZC.
211 
212 
216 // 08/17/2015 GL.
217 extern bool _OoO_Data_Conflict_Table[];
218 
222 // 08/17/2015 GL.
223 extern unsigned int _OoO_Data_Conflict_Table_Size;
224 
228 // 08/17/2015 GL.
229 extern bool _OoO_Event_Notify_Table[];
230 
234 // 08/17/2015 GL.
235 extern unsigned int _OoO_Event_Notify_Table_Size;
236 
241 // 09/01/2015 GL.
243 
247 // 09/01/2015 GL.
248 extern unsigned int _OoO_Max_Number_of_Instances;
249 
253 // 09/01/2015 GL.
254 extern unsigned int _OoO_Number_of_Segments;
255 
260 // 08/18/2015 GL.
261 extern long long _OoO_Curr_Time_Advance_Table_Time[];
262 
267 // 08/18/2015 GL.
269 
273 // 08/18/2015 GL.
274 extern unsigned int _OoO_Curr_Time_Advance_Table_Size;
275 
280 // 08/18/2015 GL.
281 extern long long _OoO_Next_Time_Advance_Table_Time[];
282 
287 // 08/18/2015 GL.
289 
293 // 08/18/2015 GL.
294 extern unsigned int _OoO_Next_Time_Advance_Table_Size;
295 
299 // 09/01/2015 GL.
301 
305 // 09/01/2015 GL.
307 
308 /**************************************************************************/
314 class sc_segid{
315 public:
316  int seg_id;
317  inline explicit sc_segid(int val):
318  seg_id(val)
319  {}
320 };
321 
322 /**************************************************************************/
329 {
330  //DM 05/16/2019
331  friend class Invoker;
332 
333  friend struct sc_invoke_method;
334  friend class sc_event;
335  friend class sc_module;
336 
337  // 04/07/2015 GL: a new sc_channel class is derived from sc_module
338  friend class sc_channel;
339 
340  friend class sc_object;
341  friend class sc_time;
342  friend class sc_clock;
343  friend class sc_method_process;
345  friend class sc_process_b;
346  friend class sc_process_handle;
347  friend class sc_prim_channel;
348  friend class sc_cthread_process;
349  friend class sc_thread_process;
350  friend class sc_runnable;
351  friend sc_dt::uint64 sc_delta_count();
352  friend const std::vector<sc_event*>& sc_get_top_level_events(
353  const sc_simcontext* simc_p);
354  friend const std::vector<sc_object*>& sc_get_top_level_objects(
355  const sc_simcontext* simc_p);
356  friend bool sc_is_running( const sc_simcontext* simc_p );
357  friend void sc_pause();
358  friend bool sc_end_of_simulation_invoked();
359  friend void sc_start( const sc_time&, sc_starvation_policy );
360  friend bool sc_start_of_simulation_invoked();
361  friend void sc_thread_cor_fn(void*);
362  friend void sc_method_cor_fn(void*);//DM 05/24/2019
366 
367  // 05/25/2015 GL: a scoped mutex for the kernel lock
368  friend struct sc_kernel_lock;
369 
370  // 05/26/2015 GL: get sc_cor pointer
371  friend sc_cor* get_cor_pointer( sc_process_b* process_p );
372 
373 
374  void init();
375  void clean();
376 public:
377 
378  sc_simcontext();
379  ~sc_simcontext();
380 
381  void initialize( bool = false );
382 
387  // 08/20/2015 GL.
388  void cycle( const sc_time& );
389 
390  void simulate( const sc_time& duration );
391  void stop();
392  void end();
393  void reset();
394 
395  void print_threads_states();
396  void print_events_states();
397 
398  // 11/05/2014 GL: thread mapping function used in parallel simulators
399  //void mapper( sc_cor *cor );
400 
406  // 05/18/2015 GL.
407  //void schedule( sc_cor *cor );
408 
412  // 08/12/2015 GL.
413  void oooschedule( sc_cor *cor );
414 
415  int sim_status() const;
416  bool elaboration_done() const;
417 
418  std::vector<sc_thread_handle>& get_active_invokers();
419 
421 
422  inline sc_status get_status() const;
423 
425 
426  void hierarchy_push( sc_module* );
428  sc_module* hierarchy_curr() const;
431  sc_object* find_object( const char* name );
432 
437 
438  // to generate unique names for objects in an MT-Safe way
439  const char* gen_unique_name( const char* basename_,
440  bool preserve_first = false
441  );
442 
443  // process creation
444 
449  // 06/12/2015 GL: modified for the OoO simulation
450  // 09/02/2015 GL: set the instance id
452  const char* name_p, bool free_host, SC_ENTRY_FUNC method_p,
453  sc_process_host* host_p, const sc_spawn_options* opt_p,
454  int seg_id, int inst_id );
455 
460  // 06/12/2015 GL: modified for the OoO simulation
461  // 09/02/2015 GL: set the instance id
463  const char* name_p, bool free_host, SC_ENTRY_FUNC method_p,
464  sc_process_host* host_p, const sc_spawn_options* opt_p,
465  int seg_id, int inst_id );
466 
471  // 06/12/2015 GL: modified for the OoO simulation
472  // 09/02/2015 GL: set the instance id
474  const char* name_p, bool free_host, SC_ENTRY_FUNC method_p,
475  sc_process_host* host_p, const sc_spawn_options* opt_p,
476  int seg_id, int inst_id );
477 
478 private:
479  //DM 05/15/2019 for method clustering
480  sc_process_handle create_invoker_process(
481  const char* name_p, bool free_host, SC_ENTRY_FUNC method_p,
482  sc_process_host* host_p, const sc_spawn_options* opt_p,
483  int invoker_id );
484 
485 public:
486  // 10/28/2014 GL: to be replaced by get_curr_proc
487  //sc_curr_proc_handle get_curr_proc_info();
488 
489  sc_process_b* get_curr_proc() const;
490  sc_object* get_current_writer() const;
491  bool write_check() const;
492 
497  // 10/29/2014 GL.
498  void set_curr_proc( sc_process_b* );
499 
500  void reset_curr_proc();
501 
502  int next_proc_id();
503 
504  void add_trace_file( sc_trace_file* );
506 
507  friend void sc_set_time_resolution( double, sc_time_unit );
509  friend void sc_set_default_time_unit( double, sc_time_unit );
511 
512  const sc_time& max_time() const;
513 
514  // 08/19/2015 GL: obsolete, to be removed in the future
515  const sc_time& time_stamp();
516 
517  sc_dt::uint64 change_stamp() const;
518 
519  // 08/19/2015 GL: obsolete, to be removed in the future
520  sc_dt::uint64 delta_count() const;
521 
522  bool event_occurred( sc_dt::uint64 last_change_count ) const;
523  bool evaluation_phase() const;
524  bool is_running() const;
525  bool update_phase() const;
526  bool notify_phase() const;
527  bool get_error();
528  void set_error( sc_report* );
529 
531  { return m_cor_pkg; }
532  sc_cor* next_cor(); // 11/05/2014 GL: obsolete, to be removed in the future
533 
534  const ::std::vector<sc_object*>& get_child_objects() const;
535 
536  void elaborate();
537  void prepare_to_simulate();
538 
543  // 08/19/2015 GL.
544  inline void initial_crunch( bool no_crunch );
545 
546  bool next_time( sc_time& t ) const;
547  bool pending_activity_at_current_time() const;
548 
552  // 11/05/2014 GL.
554 
558  // 11/05/2014 GL.
560 
564  // 11/05/2014 GL.
565  void suspend_cor( sc_cor* );
566 
570  // 11/05/2014 GL.
571  void resume_cor( sc_cor* );
572 
576  // 04/29/2015 GL.
577  bool is_locked();
578 
582  // 04/29/2015 GL.
583  bool is_unlocked();
584 
589  // 04/29/2015 GL.
590  bool is_lock_owner();
591 
596  // 04/29/2015 GL.
597  bool is_not_owner();
598 
603  // 04/29/2015 GL.
604  bool is_locked_and_owner();
605 
610  // 09/02/2015 GL.
611  unsigned int conflict_table_index_lookup( int, int );
612 
616  // 09/02/2015 GL.
617  unsigned int time_adv_table_index_lookup( int );
618 
619 private:
620  void clean_up_old_event_notifications();
621  void predict_wakeup_time_by_running_ready_threads(std::unordered_map<sc_process_b*, sc_timestamp>& wkup_t_prd_run_rdy);
622  void predict_wakeup_time_by_events(std::unordered_map<sc_process_b*,
623  std::map<sc_event*, sc_timestamp> >& wkup_t_evnt);
624  void predict_wakeup_time_by_waiting_threads(
625  std::unordered_map<sc_process_b*, sc_timestamp>& wkup_t_pred_and_evnt,
626  std::unordered_map<sc_process_b*, std::map<sc_event*, sc_timestamp> >& wkup_t_evnt,
627  std::unordered_map<sc_process_b*, sc_timestamp>& wkup_t_prd_run_rdy);
628  bool check_and_deliver_events();
629 
630 
631  void add_child_event( sc_event* );
632  void add_child_object( sc_object* );
633  void remove_child_event( sc_event* );
634  void remove_child_object( sc_object* );
635 
636  //void crunch( bool once=false );
637 
638  int add_delta_event( sc_event* );
639  void remove_delta_event( sc_event* );
640  void add_timed_event( sc_event_timed* );
641 
642  void trace_cycle( bool delta_cycle );
643 
644  const ::std::vector<sc_event*>& get_child_events_internal() const;
645  const ::std::vector<sc_object*>& get_child_objects_internal() const;
646 
647  void execute_method_next( sc_method_handle );
648  void execute_thread_next( sc_thread_handle );
649 
650  sc_method_handle pop_runnable_method();
651  sc_thread_handle pop_runnable_thread();
652 
657  // 10/28/2014 GL.
658  void preempt_with( sc_method_handle );
659 
664  // 10/28/2014 GL.
665  inline void preempt_with( sc_thread_handle );
666 
667  void push_runnable_method( sc_method_handle );
668  void push_runnable_thread( sc_thread_handle );
669 
670  void push_runnable_method_front( sc_method_handle );
671  void push_runnable_thread_front( sc_thread_handle );
672 
673  void remove_runnable_method( sc_method_handle );
674  void remove_runnable_thread( sc_thread_handle );
675 
676  void requeue_current_process();
677  void suspend_current_process();
678 
679  void do_sc_stop_action();
680  void mark_to_collect_process( sc_process_b* zombie_p );
681 
685  // 05/22/2015 GL.
686  void acquire_sched_mutex();
687 
691  // 05/22/2015 GL.
692  void release_sched_mutex();
693 
697  // 08/17/2015 GL.
698  bool has_no_conflicts( sc_process_b*, std::list<sc_method_handle>, std::list<sc_thread_handle> );
699 
703  // 02/22/2017 ZC.
704  //int reverse_event_prediction_index_lookup_seg( int );
705 
709  // 02/22/2017 ZC.
710  //int reverse_event_prediction_index_lookup_inst( int );
711 
715  // 02/22/2017 ZC.
716  int combined_data_conflict_table_index_lookup( int , int );
717 
721  // 02/22/2017 ZC.
722  int event_prediction_table_index_lookup( int , int );
723 
727  // 02/22/2017 ZC.
728  int prediction_time_advance_table_index_lookup( int);
729 
733  // 02/22/2017 ZC.
734  bool conflict_between_two_segs(
735  int ,
736  int ,
737  int ,
738  int ,
739  sc_timestamp ,
740  sc_timestamp );
741 
745  // 02/22/2017 ZC.
746  bool conflict_between_with_prediction( sc_process_b*, sc_process_b* );
747 
751  // 10:54 2017/3/10 ZC.
752  void add_to_wait_queue( sc_process_b*) ;
753  void remove_from_wait_queue(sc_process_b*) ;
754 
758  // 08/17/2015 GL.
759  bool conflict_between( sc_process_b*, sc_process_b* );
760 
764  // 12/22/2016 GL.
765  void update_oldest_time( sc_time& curr_time );
766 
767 
768 private:
769 
770  enum execution_phases {
771  phase_initialize = 0,
772  phase_evaluate,
773  phase_update,
774  phase_notify
775  };
776  sc_object_manager* m_object_manager;
777 
778  sc_module_registry* m_module_registry;
779  sc_port_registry* m_port_registry;
780  sc_export_registry* m_export_registry;
781  sc_prim_channel_registry* m_prim_channel_registry;
782  sc_phase_callback_registry* m_phase_cb_registry;
783 
784  sc_name_gen* m_name_gen;
785 
786  sc_process_table* m_process_table;
787 
788  // 10/22/2014 GL: to be removed
789  //sc_curr_proc_info m_curr_proc_info;
790 
791  std::list<sc_process_b*> m_curr_proc_queue;
792 
793  // 10/22/2014 GL: to be replaced by m_curr_proc_queue.size()
794  //int m_curr_proc_num;
795 
796  // 02/06/2015 GL: to be removed
797  //sc_object* m_current_writer;
798 
799  bool m_write_check;
800  int m_next_proc_id;
801 
802  std::vector<sc_thread_handle> m_active_invokers;
803 
804  std::vector<sc_event*> m_child_events;
805  std::vector<sc_object*> m_child_objects;
806 
807  std::vector<sc_event*> m_delta_events;
808  sc_ppq<sc_event_timed*>* m_timed_events;
809 
810  std::vector<sc_trace_file*> m_trace_files;
811  bool m_something_to_trace;
812 
813  sc_runnable* m_runnable;
814  sc_process_list* m_collectable;
815 
816  sc_time_params* m_time_params;
817 
818  // 08/17/2015 GL: no global time count
819  //sc_time m_curr_time;
820 
821  mutable sc_time m_max_time;
822 
823  sc_invoke_method* m_method_invoker_p;
824  sc_dt::uint64 m_change_stamp; // "time" change occurred.
825 
826  // 08/17/2015 GL: no global delta count
827  //sc_dt::uint64 m_delta_count;
828 
829  bool m_forced_stop;
830  bool m_paused;
831  bool m_ready_to_simulate;
832  bool m_elaboration_done;
833  execution_phases m_execution_phase;
834  sc_report* m_error;
835  bool m_in_simulator_control;
836  bool m_end_of_simulation_called;
837  sc_status m_simulation_status;
838  bool m_start_of_simulation_called;
839 
840  sc_cor_pkg* m_cor_pkg; // the simcontext's coroutine package
841  sc_cor* m_cor; // the simcontext's coroutine
842 
843  // 05/19/2015 GL: the following variables are used in
844  // sc_simcontext::schedule
845  bool m_one_delta_cycle;
846  bool m_one_timed_cycle;
847  sc_time m_finish_time;
848 
849 
850  // 12/22/2016 GL: the oldest timestamp in simulation
851 
852 
853  long* workload_table;
854 
855  long* visits;
856 
857  long old_sys_time;
858  // 03/10/2017 ZC: wait queue
859  std::list<sc_process_b*> m_waiting_proc_queue;
860 
861 private:
862 
863  // disabled
864  sc_simcontext( const sc_simcontext& );
865  sc_simcontext& operator = ( const sc_simcontext& );
866 
867 public:
868  //std::list<sc_thread_handle> m_synch_thread_queue;
869  std::list<sc_process_b*> m_synch_thread_queue; //DM 05/27/2019 synch queue now includes both threads and methods
870 
871  // 12/22/2016 GL: a list of all threads and methods created in simulation
872  std::list<sc_process_b*> m_all_proc;
873 //4/10/2018 DM
874 private:
875  sc_time oldest_untraced_time;
876 
877  // 18.8.6 ZC paused processes, which is for sc_start(time)
878  std::vector<sc_process_b*> m_paused_processes;
879 
880 
881 public:
888  std::list<sc_process_b*> m_waking_up_threads;
889 
890 private:
891 //05/15/2019 DM TODO: use C++11 data structures
892 std::map<sc_process_b*,Invoker*> method_to_invoker_map;
893 std::vector<Invoker*> m_invokers;
894 std::set<Invoker*> ready_invokers;
895 std::set<Invoker*> running_invokers;
896 //bool check_and_deliver_events_now;
897 bool event_notification_update;
898 //DM 07/24/2019 sc_methods updates:
899 unsigned int running_methods;
900 };
901 
902 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
903 
904 // Not MT safe.
905 
906 #if 1
909 
910 inline sc_simcontext*
912 {
913  if( sc_curr_simcontext == 0 ) {
916  }
917  return sc_curr_simcontext;
918 }
919 #else
920  extern sc_simcontext* sc_get_curr_simcontext();
921 #endif // 0
923 {
925 }
926 
927 
928 // IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
929 
930 inline
931 bool
933 {
934  return m_elaboration_done;
935 }
936 
937 
939 {
940  return m_simulation_status != SC_RUNNING ?
941  m_simulation_status :
942  (m_in_simulator_control ? SC_RUNNING : SC_PAUSED);
943 }
944 
945 inline
946 int
948 {
949  if( m_error ) {
950  return SC_SIM_ERROR;
951  }
952  if( m_forced_stop ) {
953  return SC_SIM_USER_STOP;
954  }
955  return SC_SIM_OK;
956 }
957 
958 
959 inline
962 {
963  return m_object_manager;
964 }
965 
966 inline
969 {
970  return m_module_registry;
971 }
972 
973 inline
976 {
977  return m_port_registry;
978 }
979 
980 inline
983 {
984  return m_export_registry;
985 }
986 
987 inline
990 {
991  return m_prim_channel_registry;
992 }
993 
994 
995 inline
996 int
998 {
999  return ( ++ m_next_proc_id );
1000 }
1001 
1002 
1003 inline
1004 const sc_time&
1006 {
1007  if ( m_max_time == SC_ZERO_TIME )
1008  {
1009 // current RISC implementation uses 'long long', not 'unsigned long long'
1010 // (this was a poor choice to allow for "special" values, not easy to change now)
1011 // m_max_time = sc_time::from_value( ~sc_dt::UINT64_ZERO );
1012  m_max_time = sc_time::from_value( LLONG_MAX - 0x02ff );
1013  // note: lowest 10 bits are lost due to 'double' conversion (08/23/19, RD)
1014 // printf("DEBUG: m_max_time.m_value = %lld\n", m_max_time.m_value);
1015  }
1016  return m_max_time;
1017 }
1018 
1019 inline
1022 {
1023  return m_change_stamp;
1024 }
1025 
1026 
1027 
1028 inline
1029 bool
1031 {
1032  return m_change_stamp == last_change_stamp;
1033 }
1034 
1035 inline
1036 bool
1038 {
1039  return (m_execution_phase == phase_evaluate) &&
1040  m_ready_to_simulate;
1041 }
1042 
1043 inline
1044 bool
1046 {
1047  return m_execution_phase == phase_update;
1048 }
1049 
1050 inline
1051 bool
1053 {
1054  return m_execution_phase == phase_notify;
1055 }
1056 
1057 inline
1058 void
1060 {
1061  delete m_error;
1062  m_error = err;
1063 }
1064 
1065 
1066 inline
1067 bool
1069 {
1070  return m_error != NULL;
1071 }
1072 
1073 inline
1074 int
1075 sc_simcontext::add_delta_event( sc_event* e )
1076 {
1077  m_delta_events.push_back( e );
1078  return ( m_delta_events.size() - 1 );
1079 }
1080 
1081 inline
1082 void
1083 sc_simcontext::add_timed_event( sc_event_timed* et )
1084 {
1085  m_timed_events->insert( et );
1086 }
1087 
1088 inline sc_object*
1090 {
1091  // 02/06/2015 GL: m_current_writer are different in different threads
1092  return m_write_check ? get_curr_proc() : (sc_object*)0;
1093 }
1094 
1095 inline bool
1097 {
1098  return m_write_check;
1099 }
1100 
1101 inline void
1103 {
1104  m_curr_proc_queue.remove( proc );
1105 }
1106 
1107 inline bool
1109 {
1110  for ( std::list<sc_process_b*>::iterator it = m_curr_proc_queue.begin();
1111  it != m_curr_proc_queue.end(); it++ )
1112  if ( *it == proc )
1113  return true;
1114  return false;
1115 }
1116 
1117 
1118 // ----------------------------------------------------------------------------
1119 
1120 class sc_process_handle;
1122 
1123 // Get the current object hierarchy context
1124 //
1125 // Returns a pointer the the sc_object (module or process) that
1126 // would become the parent object of a newly created element
1127 // of the SystemC object hierarchy, or NULL.
1128 //
1129 inline sc_object*
1131 {
1133 }
1134 
1135 inline
1136 sc_process_b*
1138 {
1140 }
1141 
1142 // THE FOLLOWING FUNCTION IS DEPRECATED IN 2.1
1144 
1145 inline
1148 {
1150 }
1151 
1152 
1154 {
1155  return sc_get_curr_simcontext()->sim_status();
1156 }
1157 
1158 
1159 // Generates unique names within each module.
1160 extern
1161 const char*
1162 sc_gen_unique_name( const char* basename_, bool preserve_first = false );
1163 
1164 
1165 // Set the random seed for controlled randomization -- not yet implemented
1166 extern
1167 void
1168 sc_set_random_seed( unsigned int seed_ );
1169 
1170 
1171 extern void sc_initialize();
1172 
1173 extern const sc_time& sc_max_time(); // Get maximum time value.
1174 extern const sc_time& sc_time_stamp(); // Current simulation time.
1175 extern double sc_simulation_time(); // Current time in default time units.
1176 //4/10/2018 DM
1177 extern const sc_time& get_current_trace_time();
1178 
1179 inline
1180 const std::vector<sc_event*>& sc_get_top_level_events(
1181  const sc_simcontext* simc_p = sc_get_curr_simcontext() )
1182 {
1183  return simc_p->m_child_events;
1184 }
1185 
1186 inline
1187 const std::vector<sc_object*>& sc_get_top_level_objects(
1188  const sc_simcontext* simc_p = sc_get_curr_simcontext() )
1189 {
1190  return simc_p->m_child_objects;
1191 }
1192 
1193 extern sc_event* sc_find_event( const char* name );
1194 
1195 extern sc_object* sc_find_object( const char* name );
1196 
1200 inline
1202 {
1203  //return sc_get_curr_simcontext()->m_delta_count;
1204 
1205  // 08/20/2015 GL: get the local delta count instead of the global one
1207 
1208  if ( proc )
1209  return proc->get_timestamp().get_delta_count();
1210  else
1211  return 0;
1212 }
1213 
1214 inline
1216 {
1217  return simc_p->m_ready_to_simulate;
1218 }
1219 
1220 bool sc_is_unwinding();
1221 
1222 inline void sc_pause()
1223 {
1224  sc_get_curr_simcontext()->m_paused = true;
1225 }
1226 
1227 // Return indication if there are more processes to execute in this delta phase
1228 
1231 {
1232  return simc_p->pending_activity_at_current_time();
1233 }
1234 
1235 // Return indication if there are timed notifications in the future
1236 
1239 {
1240  sc_time ignored;
1241  return simc_p->next_time( ignored );
1242 }
1243 
1244 // Return indication if there are processes to run,
1245 // or notifications in the future
1246 
1247 inline bool sc_pending_activity
1249 {
1250  return sc_pending_activity_at_current_time( simc_p )
1252 }
1253 
1254 sc_time
1256  ( const sc_simcontext* simc_p = sc_get_curr_simcontext() );
1257 
1258 
1259 inline
1260 bool
1262 {
1263  return sc_get_curr_simcontext()->m_end_of_simulation_called;
1264 }
1265 
1266 inline bool sc_hierarchical_name_exists( const char* name )
1267 {
1268  return sc_find_object(name) || sc_find_event(name);
1269 }
1270 
1271 inline
1272 bool
1274 {
1275  return sc_get_curr_simcontext()->m_start_of_simulation_called;
1276 }
1277 
1278 // The following variable controls whether process control corners should
1279 // be considered errors or not. See sc_simcontext.cpp for details on what
1280 // happens if this value is set to true.
1281 
1283 
1284 } // namespace sc_core
1285 
1286 /*****************************************************************************
1287 
1288  MODIFICATION LOG - modifiers, enter your name, affiliation, date and
1289  changes you are making here.
1290 
1291  Name, Affiliation, Date: Andy Goodrich, Forte Design Systems 20 May 2003
1292  Description of Modification: - phase callbacks
1293  - sc_stop mode
1294 
1295  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
1296  25 August, 2003
1297  Description of Modification: - support for dynamic process
1298  - support for sc export registry
1299  - new member methods elaborate(),
1300  prepare_to_simulate(), and initial_crunch()
1301  that are invoked by initialize() in that order
1302  - add sc_get_last_created_process_handle() for
1303  use before simulation starts
1304 
1305  Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems,
1306  3 March, 2004
1307  Description of Modification: add sc_get_curr_process_kind()
1308 
1309  Name, Affiliation, Date:
1310  Description of Modification:
1311 
1312  *****************************************************************************/
1313 // $Log: sc_simcontext.h,v $
1314 // Revision 1.26 2011/09/05 21:20:22 acg
1315 // Andy Goodrich: result of automake invocation.
1316 //
1317 // Revision 1.25 2011/09/01 15:28:10 acg
1318 // Andy Goodrich: the aftermath of automake.
1319 //
1320 // Revision 1.24 2011/08/29 18:04:32 acg
1321 // Philipp A. Hartmann: miscellaneous clean ups.
1322 //
1323 // Revision 1.23 2011/08/26 20:46:10 acg
1324 // Andy Goodrich: moved the modification log to the end of the file to
1325 // eliminate source line number skew when check-ins are done.
1326 //
1327 // Revision 1.22 2011/08/24 22:05:51 acg
1328 // Torsten Maehne: initialization changes to remove warnings.
1329 //
1330 // Revision 1.21 2011/05/09 04:07:49 acg
1331 // Philipp A. Hartmann:
1332 // (1) Restore hierarchy in all phase callbacks.
1333 // (2) Ensure calls to before_end_of_elaboration.
1334 //
1335 // Revision 1.20 2011/04/08 18:26:07 acg
1336 // Andy Goodrich: added execute_method_next() to handle method dispatch
1337 // for asynchronous notifications that occur outside the evaluation phase.
1338 //
1339 // Revision 1.19 2011/04/05 20:50:57 acg
1340 // Andy Goodrich:
1341 // (1) changes to make sure that event(), posedge() and negedge() only
1342 // return true if the clock has not moved.
1343 // (2) fixes for method self-resumes.
1344 // (3) added SC_PRERELEASE_VERSION
1345 // (4) removed kernel events from the object hierarchy, added
1346 // sc_hierarchical_name_exists().
1347 //
1348 // Revision 1.18 2011/03/20 13:43:23 acg
1349 // Andy Goodrich: added async_signal_is() plus suspend() as a corner case.
1350 //
1351 // Revision 1.17 2011/03/07 18:25:19 acg
1352 // Andy Goodrich: tightening of check for resume on a disabled process to
1353 // only produce an error if it is ready to run.
1354 //
1355 // Revision 1.16 2011/03/06 15:58:50 acg
1356 // Andy Goodrich: added escape to turn off process control corner case
1357 // checks.
1358 //
1359 // Revision 1.15 2011/03/05 04:45:16 acg
1360 // Andy Goodrich: moved active process calculation to the sc_simcontext class.
1361 //
1362 // Revision 1.14 2011/03/05 01:39:21 acg
1363 // Andy Goodrich: changes for named events.
1364 //
1365 // Revision 1.13 2011/02/18 20:27:14 acg
1366 // Andy Goodrich: Updated Copyrights.
1367 //
1368 // Revision 1.12 2011/02/13 21:47:38 acg
1369 // Andy Goodrich: update copyright notice.
1370 //
1371 // Revision 1.11 2011/02/13 21:34:35 acg
1372 // Andy Goodrich: added SC_UNITIALIZED enum value to process status so
1373 // its possible to detect throws before initialization.
1374 //
1375 // Revision 1.10 2011/02/11 13:25:24 acg
1376 // Andy Goodrich: Philipp A. Hartmann's changes:
1377 // (1) Removal of SC_CTHREAD method overloads.
1378 // (2) New exception processing code.
1379 //
1380 // Revision 1.9 2011/02/01 21:18:56 acg
1381 // Andy Goodrich: addition of new preempt_with() method used to immediately
1382 // throw exceptions from threads.
1383 //
1384 // Revision 1.8 2011/01/25 20:50:37 acg
1385 // Andy Goodrich: changes for IEEE 1666 2011.
1386 //
1387 // Revision 1.7 2011/01/19 23:21:50 acg
1388 // Andy Goodrich: changes for IEEE 1666 2011
1389 //
1390 // Revision 1.6 2011/01/18 20:10:45 acg
1391 // Andy Goodrich: changes for IEEE1666_2011 semantics.
1392 //
1393 // Revision 1.5 2010/07/22 20:02:33 acg
1394 // Andy Goodrich: bug fixes.
1395 //
1396 // Revision 1.4 2009/05/22 16:06:29 acg
1397 // Andy Goodrich: process control updates.
1398 //
1399 // Revision 1.3 2008/05/22 17:06:26 acg
1400 // Andy Goodrich: updated copyright notice to include 2008.
1401 //
1402 // Revision 1.2 2007/09/20 20:32:35 acg
1403 // Andy Goodrich: changes to the semantics of throw_it() to match the
1404 // specification. A call to throw_it() will immediately suspend the calling
1405 // thread until all the throwees have executed. At that point the calling
1406 // thread will be restarted before the execution of any other threads.
1407 //
1408 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
1409 // SystemC 2.3
1410 //
1411 // Revision 1.13 2006/05/08 18:00:06 acg
1412 // Andy Goodrich: added David Long's forward declarations for friend
1413 // functions, methods, and operators to keep the Microsoft compiler happy.
1414 //
1415 // Revision 1.11 2006/04/11 23:13:21 acg
1416 // Andy Goodrich: Changes for reduced reset support that only includes
1417 // sc_cthread, but has preliminary hooks for expanding to method and thread
1418 // processes also.
1419 //
1420 // Revision 1.10 2006/03/21 00:00:34 acg
1421 // Andy Goodrich: changed name of sc_get_current_process_base() to be
1422 // sc_get_current_process_b() since its returning an sc_process_b instance.
1423 //
1424 // Revision 1.9 2006/01/26 21:04:54 acg
1425 // Andy Goodrich: deprecation message changes and additional messages.
1426 //
1427 // Revision 1.8 2006/01/24 20:49:05 acg
1428 // Andy Goodrich: changes to remove the use of deprecated features within the
1429 // simulator, and to issue warning messages when deprecated features are used.
1430 //
1431 // Revision 1.7 2006/01/19 00:29:52 acg
1432 // Andy Goodrich: Yet another implementation for signal write checking. This
1433 // one uses an environment variable SC_SIGNAL_WRITE_CHECK, that when set to
1434 // DISABLE will disable write checking on signals.
1435 //
1436 // Revision 1.6 2006/01/18 21:42:37 acg
1437 // Andy Goodrich: Changes for check writer support.
1438 //
1439 // Revision 1.5 2006/01/13 18:44:30 acg
1440 // Added $Log to record CVS changes into the source.
1441 //
1442 // Revision 1.4 2006/01/03 23:18:44 acg
1443 // Changed copyright to include 2006.
1444 //
1445 // Revision 1.3 2005/12/20 22:11:10 acg
1446 // Fixed $Log lines.
1447 //
1448 // Revision 1.2 2005/12/20 22:02:30 acg
1449 // Changed where delta cycles are incremented to match IEEE 1666. Added the
1450 // event_occurred() method to hide how delta cycle comparisions are done within
1451 // sc_simcontext. Changed the boolean update_phase to an enum that shows all
1452 // the phases.
1453 
1454 #endif
sc_starvation_policy
Definition: sc_simcontext.h:88
int _OoO_Prediction_Event_Notification_Table_Delta[]
friend sc_dt::uint64 sc_delta_count()
This function returns the local delta count of the running process.
void sc_set_time_resolution(double, sc_time_unit)
sc_process_b * sc_get_current_process_b()
void hierarchy_push(sc_module *)
friend struct sc_invoke_method
long long _OoO_Next_Time_Advance_Table_Time[]
Next time advance table (timed cycles) for the out-of-order simulation.
bool evaluation_phase() const
unsigned int _OoO_Combined_Data_Conflict_Lookup_Table_Number_Segments
friend sc_time sc_time_to_pending_activity(const sc_simcontext *)
sc_cor_pkg * cor_pkg()
static sc_time from_value(value_type)
unsigned int _OoO_Time_Advance_Index_Lookup_Table_Size
Size of the index lookup table for the time advance table.
friend sc_cor * get_cor_pointer(sc_process_b *process_p)
bool notify_phase() const
A scoped mutex for the kernel lock.
unsigned int _OoO_Curr_Time_Advance_Table_Size
Size of the current time advance table.
Coroutine package abstract base class.
Definition: sc_cor.h:101
sc_process_b sc_process_b
Definition: sc_process.h:964
void simulate(const sc_time &duration)
A time stamp combining timed cycles and delta cycles.
Definition: sc_process.h:433
Registry for all modules.
sc_object * get_current_writer() const
unsigned int _OoO_Prediction_Event_Notification_Table_No_Indirect_Max_Instances
sc_object * sc_find_object(const char *name)
void oooschedule(sc_cor *cor)
Scheduling function in the OoO simulation.
const sc_time & get_current_trace_time()
Class for storing the time to notify a timed event.
Definition: sc_event.h:398
int sc_get_simulator_status()
friend void sc_pause()
sc_port_registry * get_port_registry()
This class provides access to an sc_process_b object instance in a manner which allows some persisten...
sc_time sc_get_time_resolution()
The clock channel.
Definition: sc_clock.h:43
bool sc_allow_process_control_corners
int _OoO_Combined_Data_Conflict_Table[]
void(sc_process_host::* SC_ENTRY_FUNC)()
Definition: sc_process.h:211
Registry for all exports.
Definition: sc_export.h:217
bool sc_pending_activity(const sc_simcontext *simc_p=sc_get_curr_simcontext())
bool is_not_owner()
Check whether the kernel lock is not owned by the currently running coroutine.
void add_trace_file(sc_trace_file *)
unsigned int _OoO_Data_Conflict_Table_Size
Size of the data conflict table.
sc_object * next_object()
sc_time sc_get_default_time_unit()
sc_object * find_object(const char *name)
void cycle(const sc_time &)
This function is not supported by the out-of-order simulation in the current release.
void sc_pause()
sc_curr_proc_kind sc_get_curr_process_kind()
friend void sc_set_default_time_unit(double, sc_time_unit)
unsigned int _OoO_Combined_Data_Conflict_Lookup_Table_Max_Instances
friend bool sc_end_of_simulation_invoked()
friend class sc_phase_callback_registry
friend void sc_method_cor_fn(void *)
Coroutine abstract base class.
Definition: sc_cor.h:57
sc_starvation_policy m_starvation_policy
long long _OoO_Curr_Time_Advance_Table_Time[]
Current time advance table (timed cycles) for the out-of-order simulation.
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...
bool update_phase() const
sc_timestamp m_simulation_time
unsigned int _OoO_Event_Notify_Table_Size
Size of the event notification table.
Registry for all ports.
Definition: sc_port.h:190
class sc_method_process * sc_method_handle
Definition: sc_process.h:119
const int SC_SIM_OK
Definition: sc_status.h:36
bool event_occurred(sc_dt::uint64 last_change_count) const
bool is_locked_and_owner()
Check whether the kernel lock is acquired and owned by the currently running coroutine.
sc_process_b * get_curr_proc() const
bool sc_is_running(const sc_simcontext *simc_p)
void sc_set_random_seed(unsigned int seed_)
bool _OoO_Data_Conflict_Table[]
Data conflict table for the out-of-order simulation.
sc_object * active_object()
void sc_initialize()
User initiated dynamic process support.
Definition: sc_process.h:555
const std::vector< sc_object * > & sc_get_top_level_objects(const sc_simcontext *simc_p)
unsigned int _OoO_Next_Time_Advance_Table_Size
Size of the next time advance table.
unsigned int _OoO_Combined_Data_Conflict_Table_Size
bool next_time(sc_time &t) const
friend sc_time sc_get_time_resolution()
sc_dt::uint64 sc_delta_count()
This function returns the local delta count of the running process.
friend const std::vector< sc_event * > & sc_get_top_level_events(const sc_simcontext *simc_p)
bool pending_activity_at_current_time() const
bool _OoO_Event_Notify_Table[]
Event notification table for the out-of-order simulation.
sc_curr_proc_kind proc_kind() const
Definition: sc_process.h:1107
sc_module_registry * get_module_registry()
const char * sc_gen_unique_name(const char *, bool preserve_first)
void resume_cor(sc_cor *)
Resume a coroutine.
Class that manages the ready-to-run queues.
Definition: sc_runnable.h:42
int _OoO_Prediction_Time_Advance_Lookup_Table[]
friend class sc_runnable
const char * gen_unique_name(const char *basename_, bool preserve_first=false)
unsigned int _OoO_Prediction_Event_Notification_Table_Max_Instances
friend void sc_set_time_resolution(double, sc_time_unit)
sc_curr_proc_kind
Definition: sc_process.h:125
bool elaboration_done() const
sc_object * sc_get_current_object()
class sc_thread_process * sc_thread_handle
Definition: sc_process.h:120
bool is_running() const
int _OoO_Combined_Data_Conflict_Lookup_Table[]
friend sc_time sc_get_default_time_unit()
unsigned int _OoO_Prediction_Event_Notification_Table_Number_Segments
const char * _OoO_Table_File_Name
unsigned int _OoO_Prediction_Time_Advance_Table_Number_Segments
std::list< sc_process_b * > m_all_proc
int _OoO_Time_Advance_Index_Lookup_Table[]
Index lookup table for the time advance table.
void remove_running_process(sc_process_b *)
Remove a process from the running queue.
friend const std::vector< sc_object * > & sc_get_top_level_objects(const sc_simcontext *simc_p)
sc_simcontext * sc_curr_simcontext
The event class.
Definition: sc_event.h:260
sc_status sc_get_status()
friend bool sc_is_running(const sc_simcontext *simc_p)
uint64_t uint64
Definition: sc_nbdefs.h:183
const sc_time & sc_time_stamp()
sc_module * hierarchy_pop()
std::list< sc_process_b * > m_synch_thread_queue
sc_timestamp m_simulation_duration
const int SC_SIM_ERROR
Definition: sc_status.h:37
sc_process_handle sc_get_current_process_handle()
bool is_unlocked()
Check whether the kernel lock is released.
void sc_start()
const sc_time & max_time() const
const sc_time & get_oldest_untraced_time()
sc_prim_channel_registry * get_prim_channel_registry()
sc_time sc_time_to_pending_activity(const sc_simcontext *)
The simulation context.
int _OoO_Prediction_Event_Notification_Lookup_Table[]
long long _OoO_Prediction_Time_Advance_Table_Time_Units[]
const sc_time & time_stamp()
unsigned int _OoO_Number_of_Segments
The number of segments.
int _OoO_Prediction_Time_Advance_Table_Delta[]
sc_simcontext * simc_p
Base class for all structural entities.
Definition: sc_module.h:83
int _OoO_Prediction_Event_Notification_Table_No_Indirect_Delta[]
const ::std::vector< sc_object * > & get_child_objects() const
sc_object_manager * get_object_manager()
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.
bool is_running_process(sc_process_b *)
Check whether a process is in the running queue.
std::list< sc_process_b * > m_waking_up_threads
void initialize(bool=false)
bool is_locked()
Check whether the kernel lock is acquired.
bool write_check() const
void sc_set_stop_mode(sc_stop_mode mode)
void remove_trace_file(sc_trace_file *)
void initial_crunch(bool no_crunch)
This function is partially supported by the out-of-order simulation in the current release...
Registry for all primitive channels.
unsigned int _OoO_Prediction_Event_Notification_Table_No_Indirect_Number_Segments
bool _SYSC_SYNC_PAR_SIM
double sc_simulation_time()
unsigned int _OoO_Prediction_Time_Advance_Table_Number_Steps
Base class for all hierarchical channels.
Definition: sc_module.h:712
bool sc_is_unwinding()
const std::vector< sc_event * > & sc_get_top_level_events(const sc_simcontext *simc_p)
friend void sc_start(const sc_time &, sc_starvation_policy)
bool sc_pending_activity_at_current_time(const sc_simcontext *)
long long _OoO_Prediction_Event_Notification_Table_No_Indirect_Time_Units[]
friend bool sc_pending_activity_at_current_time(const sc_simcontext *)
friend bool sc_start_of_simulation_invoked()
bool is_lock_owner()
Check whether the kernel lock is owned by the currently running coroutine.
sc_simcontext * sc_get_curr_simcontext()
int _OoO_Conflict_Index_Lookup_Table[]
Index lookup table for the data conflict table and event notification table.
sc_plist< sc_process_b * > sc_process_list
Definition: sc_simcontext.h:76
void set_curr_proc(sc_process_b *)
This function is not supported by the out-of-order simulation in the current release.
int _OoO_Next_Time_Advance_Table_Delta[]
Next time advance table (delta cycles) for the out-of-order simulation.
const sc_time SC_ZERO_TIME
bool sc_hierarchical_name_exists(const char *name)
void set_error(sc_report *)
bool sc_end_of_simulation_invoked()
int _OoO_Curr_Time_Advance_Table_Delta[]
Current time advance table (delta cycles) for the out-of-order simulation.
This is the base class for objects which may have processes defined for their methods (e...
Definition: sc_process.h:148
sc_simcontext * sc_default_global_context
sc_process_b * sc_get_curr_process_handle()
sc_dt::uint64 change_stamp() const
sc_status get_status() const
friend void sc_thread_cor_fn(void *)
unsigned int time_adv_table_index_lookup(int)
Convert segment ID to index in the time advance table.
unsigned int _OoO_Max_Number_of_Instances
The maximum number of instances.
const int SC_SIM_USER_STOP
Definition: sc_status.h:38
sc_module * hierarchy_curr() const
const sc_timestamp & get_timestamp()
Set the local time stamp of this process.
value_type get_delta_count() const
Get the value of delta cycles.
int _OoO_Prediction_Event_Notification_No_Indirect_Lookup_Table[]
sc_stop_mode sc_get_stop_mode()
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.
const sc_time & sc_max_time()
sc_dt::uint64 delta_count() const
friend bool sc_pending_activity_at_future_time(const sc_simcontext *)
sc_object * first_object()
segment id currently only used for sc_fifo::read(...) as a bug fix
bool sc_pending_activity_at_future_time(const sc_simcontext *)
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.
void suspend_cor(sc_cor *)
Suspend a coroutine.
std::vector< sc_thread_handle > & get_active_invokers()
void sc_stop()
Abstract base class of all primitive channel classes.
Abstract base class of all SystemC `simulation&#39; objects.
Definition: sc_object.h:51
sc_event * sc_find_event(const char *name)
void sc_set_default_time_unit(double, sc_time_unit)
sc_export_registry * get_export_registry()
bool sc_start_of_simulation_invoked()
sc_time_unit
Definition: sc_time.h:56
long long _OoO_Prediction_Event_Notification_Table_Time_Units[]