1/***************************************************************************** 2 3 Licensed to Accellera Systems Initiative Inc. (Accellera) under one or 4 more contributor license agreements. See the NOTICE file distributed 5 with this work for additional information regarding copyright ownership. 6 Accellera licenses this file to you under the Apache License, Version 2.0 7 (the "License"); you may not use this file except in compliance with the 8 License. You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 15 implied. See the License for the specific language governing 16 permissions and limitations under the License. 17 18 *****************************************************************************/ 19 20/***************************************************************************** 21 22 sc_simcontext.h -- Definition of the simulation context class. 23 24 Original Author: Stan Y. Liao, Synopsys, Inc. 25 Martin Janssen, Synopsys, Inc. 26 27 CHANGE LOG AT THE END OF THE FILE 28 *****************************************************************************/ 29 30#ifndef SC_SIMCONTEXT_H 31#define SC_SIMCONTEXT_H 32 33#include "sysc/kernel/sc_cmnhdr.h" 34#include "sysc/kernel/sc_process.h" 35#include "sysc/kernel/sc_status.h" 36#include "sysc/kernel/sc_time.h" 37#include "sysc/utils/sc_hash.h" 38#include "sysc/utils/sc_pq.h" 39 40namespace sc_core { 41 42// forward declarations 43 44class sc_cor; 45class sc_cor_pkg; 46class sc_event; 47class sc_event_timed; 48class sc_export_registry; 49class sc_module; 50class sc_module_name; 51class sc_module_registry; 52class sc_name_gen; 53class sc_object; 54class sc_object_manager; 55class sc_phase_callback_registry; 56class sc_process_handle; 57class sc_port_registry; 58class sc_prim_channel_registry; 59class sc_process_table; 60class sc_signal_bool_deval; 61class sc_trace_file; 62class sc_runnable; 63class sc_process_host; 64class sc_method_process; 65class sc_cthread_process; 66class sc_thread_process; 67 68template< typename > class sc_plist; 69typedef sc_plist< sc_process_b* > sc_process_list; 70 71struct sc_curr_proc_info 72{ 73 sc_process_b* process_handle; 74 sc_curr_proc_kind kind; 75 sc_curr_proc_info() : process_handle( 0 ), kind( SC_NO_PROC_ ) {} 76}; 77 78typedef const sc_curr_proc_info* sc_curr_proc_handle; 79 80enum sc_stop_mode { // sc_stop modes: 81 SC_STOP_FINISH_DELTA, 82 SC_STOP_IMMEDIATE 83}; 84extern void sc_set_stop_mode( sc_stop_mode mode ); 85extern sc_stop_mode sc_get_stop_mode(); 86 87enum sc_starvation_policy 88{ 89 SC_EXIT_ON_STARVATION, 90 SC_RUN_TO_TIME 91}; 92extern void sc_start(); 93extern void sc_start( const sc_time& duration, 94 sc_starvation_policy p=SC_RUN_TO_TIME ); 95inline void sc_start( int duration, sc_time_unit unit, 96 sc_starvation_policy p=SC_RUN_TO_TIME ) 97{ 98 sc_start( sc_time((double)duration,unit), p ); 99} 100 101inline void sc_start( double duration, sc_time_unit unit, 102 sc_starvation_policy p=SC_RUN_TO_TIME ) 103{ 104 sc_start( sc_time(duration,unit), p ); 105} 106 107extern void sc_stop(); 108 109// friend function declarations 110 111sc_dt::uint64 sc_delta_count(); 112const std::vector<sc_event*>& sc_get_top_level_events( 113 const sc_simcontext* simc_p); 114const std::vector<sc_object*>& sc_get_top_level_objects( 115 const sc_simcontext* simc_p); 116bool sc_is_running( const sc_simcontext* simc_p ); 117void sc_pause(); 118bool sc_end_of_simulation_invoked(); 119void sc_start( const sc_time&, sc_starvation_policy ); 120bool sc_start_of_simulation_invoked(); 121void sc_set_time_resolution( double, sc_time_unit ); 122sc_time sc_get_time_resolution(); 123void sc_set_default_time_unit( double, sc_time_unit ); 124sc_time sc_get_default_time_unit(); 125bool sc_pending_activity_at_current_time( const sc_simcontext* ); 126bool sc_pending_activity_at_future_time( const sc_simcontext* ); 127sc_time sc_time_to_pending_activity( const sc_simcontext* ); 128 129struct sc_invoke_method; 130 131// ---------------------------------------------------------------------------- 132// CLASS : sc_simcontext 133// 134// The simulation context. 135// ---------------------------------------------------------------------------- 136 137class sc_simcontext 138{ 139 friend struct sc_invoke_method; 140 friend class sc_event; 141 friend class sc_module; 142 friend class sc_object; 143 friend class sc_time; 144 friend class sc_clock; 145 friend class sc_method_process; 146 friend class sc_phase_callback_registry; 147 friend class sc_process_b; 148 friend class sc_process_handle; 149 friend class sc_prim_channel; 150 friend class sc_cthread_process; 151 friend class sc_thread_process; 152 friend sc_dt::uint64 sc_delta_count(); 153 friend const std::vector<sc_event*>& sc_get_top_level_events( 154 const sc_simcontext* simc_p); 155 friend const std::vector<sc_object*>& sc_get_top_level_objects( 156 const sc_simcontext* simc_p); 157 friend bool sc_is_running( const sc_simcontext* simc_p ); 158 friend void sc_pause(); 159 friend bool sc_end_of_simulation_invoked(); 160 friend void sc_start( const sc_time&, sc_starvation_policy ); 161 friend bool sc_start_of_simulation_invoked(); 162 friend void sc_thread_cor_fn(void*); 163 friend sc_time sc_time_to_pending_activity( const sc_simcontext* ); 164 friend bool sc_pending_activity_at_current_time( const sc_simcontext* ); 165 friend bool sc_pending_activity_at_future_time( const sc_simcontext* ); 166 167 168 void init(); 169 void clean(); 170 171public: 172 173 sc_simcontext(); 174 ~sc_simcontext(); 175 176 void initialize( bool = false ); 177 void cycle( const sc_time& ); 178 void simulate( const sc_time& duration ); 179 void stop(); 180 void end(); 181 void reset(); 182 183 int sim_status() const; 184 bool elaboration_done() const; 185 186 std::vector<sc_thread_handle>& get_active_invokers(); 187 188 sc_object_manager* get_object_manager(); 189 190 inline sc_status get_status() const; 191 192 sc_object* active_object(); 193 194 void hierarchy_push( sc_module* ); 195 sc_module* hierarchy_pop(); 196 sc_module* hierarchy_curr() const; 197 sc_object* first_object(); 198 sc_object* next_object(); 199 sc_object* find_object( const char* name ); 200 201 sc_module_registry* get_module_registry(); 202 sc_port_registry* get_port_registry(); 203 sc_export_registry* get_export_registry(); 204 sc_prim_channel_registry* get_prim_channel_registry(); 205 206 // to generate unique names for objects in an MT-Safe way 207 const char* gen_unique_name( const char* basename_, 208 bool preserve_first = false 209 ); 210 211 // process creation 212 sc_process_handle create_cthread_process( 213 const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 214 sc_process_host* host_p, const sc_spawn_options* opt_p ); 215 216 sc_process_handle create_method_process( 217 const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 218 sc_process_host* host_p, const sc_spawn_options* opt_p ); 219 220 sc_process_handle create_thread_process( 221 const char* name_p, bool free_host, SC_ENTRY_FUNC method_p, 222 sc_process_host* host_p, const sc_spawn_options* opt_p ); 223 224 sc_curr_proc_handle get_curr_proc_info(); 225 sc_object* get_current_writer() const; 226 bool write_check() const; 227 void set_curr_proc( sc_process_b* ); 228 void reset_curr_proc(); 229 230 int next_proc_id(); 231 232 void add_trace_file( sc_trace_file* ); 233 void remove_trace_file( sc_trace_file* ); 234 235 friend void sc_set_time_resolution( double, sc_time_unit ); 236 friend sc_time sc_get_time_resolution(); 237 friend void sc_set_default_time_unit( double, sc_time_unit ); 238 friend sc_time sc_get_default_time_unit(); 239 240 const sc_time& max_time() const; 241 const sc_time& time_stamp() const; 242 243 sc_dt::uint64 change_stamp() const; 244 sc_dt::uint64 delta_count() const; 245 bool event_occurred( sc_dt::uint64 last_change_count ) const; 246 bool evaluation_phase() const; 247 bool is_running() const; 248 bool update_phase() const; 249 bool notify_phase() const; 250 bool get_error(); 251 void set_error( sc_report* ); 252 253 sc_cor_pkg* cor_pkg() 254 { return m_cor_pkg; } 255 sc_cor* next_cor(); 256 257 const ::std::vector<sc_object*>& get_child_objects() const; 258 259 void elaborate(); 260 void prepare_to_simulate(); 261 inline void initial_crunch( bool no_crunch ); 262 bool next_time( sc_time& t ) const; 263 bool pending_activity_at_current_time() const; 264 265private: 266 267 void add_child_event( sc_event* ); 268 void add_child_object( sc_object* ); 269 void remove_child_event( sc_event* ); 270 void remove_child_object( sc_object* ); 271 272 void crunch( bool once=false ); 273 274 int add_delta_event( sc_event* ); 275 void remove_delta_event( sc_event* ); 276 void add_timed_event( sc_event_timed* ); 277 278 void trace_cycle( bool delta_cycle ); 279 280 const ::std::vector<sc_event*>& get_child_events_internal() const; 281 const ::std::vector<sc_object*>& get_child_objects_internal() const; 282 283 void execute_method_next( sc_method_handle ); 284 void execute_thread_next( sc_thread_handle ); 285 286 sc_method_handle pop_runnable_method(); 287 sc_thread_handle pop_runnable_thread(); 288 289 void preempt_with( sc_method_handle ); 290 inline void preempt_with( sc_thread_handle ); 291 292 void push_runnable_method( sc_method_handle ); 293 void push_runnable_thread( sc_thread_handle ); 294 295 void push_runnable_method_front( sc_method_handle ); 296 void push_runnable_thread_front( sc_thread_handle ); 297 298 void remove_runnable_method( sc_method_handle ); 299 void remove_runnable_thread( sc_thread_handle ); 300 301 void requeue_current_process(); 302 void suspend_current_process(); 303 304 void do_sc_stop_action(); 305 void mark_to_collect_process( sc_process_b* zombie_p ); 306 307private: 308 309 enum execution_phases { 310 phase_initialize = 0, 311 phase_evaluate, 312 phase_update, 313 phase_notify 314 }; 315 sc_object_manager* m_object_manager; 316 317 sc_module_registry* m_module_registry; 318 sc_port_registry* m_port_registry; 319 sc_export_registry* m_export_registry; 320 sc_prim_channel_registry* m_prim_channel_registry; 321 sc_phase_callback_registry* m_phase_cb_registry; 322 323 sc_name_gen* m_name_gen; 324 325 sc_process_table* m_process_table; 326 sc_curr_proc_info m_curr_proc_info; 327 sc_object* m_current_writer; 328 bool m_write_check; 329 int m_next_proc_id; 330 331 std::vector<sc_thread_handle> m_active_invokers; 332 333 std::vector<sc_event*> m_child_events; 334 std::vector<sc_object*> m_child_objects; 335 336 std::vector<sc_event*> m_delta_events; 337 sc_ppq<sc_event_timed*>* m_timed_events; 338 339 std::vector<sc_trace_file*> m_trace_files; 340 bool m_something_to_trace; 341 342 sc_runnable* m_runnable; 343 sc_process_list* m_collectable; 344 345 sc_time_params* m_time_params; 346 sc_time m_curr_time; 347 mutable sc_time m_max_time; 348 349 sc_invoke_method* m_method_invoker_p; 350 sc_dt::uint64 m_change_stamp; // "time" change occurred. 351 sc_dt::uint64 m_delta_count; 352 bool m_forced_stop; 353 bool m_paused; 354 bool m_ready_to_simulate; 355 bool m_elaboration_done; 356 execution_phases m_execution_phase; 357 sc_report* m_error; 358 bool m_in_simulator_control; 359 bool m_end_of_simulation_called; 360 sc_status m_simulation_status; 361 bool m_start_of_simulation_called; 362 363 sc_cor_pkg* m_cor_pkg; // the simcontext's coroutine package 364 sc_cor* m_cor; // the simcontext's coroutine 365 366private: 367 368 // disabled 369 sc_simcontext( const sc_simcontext& ); 370 sc_simcontext& operator = ( const sc_simcontext& ); 371}; 372 373// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 374 375// Not MT safe. 376 377#if 1 378extern sc_simcontext* sc_curr_simcontext; 379extern sc_simcontext* sc_default_global_context; 380 381inline sc_simcontext* 382sc_get_curr_simcontext() 383{ 384 if( sc_curr_simcontext == 0 ) { 385 sc_default_global_context = new sc_simcontext; 386 sc_curr_simcontext = sc_default_global_context; 387 } 388 return sc_curr_simcontext; 389} 390#else 391 extern sc_simcontext* sc_get_curr_simcontext(); 392#endif // 0 393inline sc_status sc_get_status() 394{ 395 return sc_get_curr_simcontext()->get_status(); 396} 397 398 399// IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII 400 401inline 402bool 403sc_simcontext::elaboration_done() const 404{ 405 return m_elaboration_done; 406} 407 408 409inline sc_status sc_simcontext::get_status() const 410{ 411 return m_simulation_status != SC_RUNNING ? 412 m_simulation_status : 413 (m_in_simulator_control ? SC_RUNNING : SC_PAUSED); 414} 415 416inline 417int 418sc_simcontext::sim_status() const 419{ 420 if( m_error ) { 421 return SC_SIM_ERROR; 422 } 423 if( m_forced_stop ) { 424 return SC_SIM_USER_STOP; 425 } 426 return SC_SIM_OK; 427} 428 429 430inline 431sc_object_manager* 432sc_simcontext::get_object_manager() 433{ 434 return m_object_manager; 435} 436 437inline 438sc_module_registry* 439sc_simcontext::get_module_registry() 440{ 441 return m_module_registry; 442} 443 444inline 445sc_port_registry* 446sc_simcontext::get_port_registry() 447{ 448 return m_port_registry; 449} 450 451inline 452sc_export_registry* 453sc_simcontext::get_export_registry() 454{ 455 return m_export_registry; 456} 457 458inline 459sc_prim_channel_registry* 460sc_simcontext::get_prim_channel_registry() 461{ 462 return m_prim_channel_registry; 463} 464 465 466inline 467sc_curr_proc_handle 468sc_simcontext::get_curr_proc_info() 469{ 470 return &m_curr_proc_info; 471} 472 473 474inline 475int 476sc_simcontext::next_proc_id() 477{ 478 return ( ++ m_next_proc_id ); 479} 480 481 482inline 483const sc_time& 484sc_simcontext::max_time() const 485{ 486 if ( m_max_time == SC_ZERO_TIME ) 487 { 488 m_max_time = sc_time::from_value( ~sc_dt::UINT64_ZERO ); 489 } 490 return m_max_time; 491} 492 493inline 494sc_dt::uint64 495sc_simcontext::change_stamp() const 496{ 497 return m_change_stamp; 498} 499 500inline 501const sc_time& 502sc_simcontext::time_stamp() const 503{ 504 return m_curr_time; 505} 506 507 508inline 509bool 510sc_simcontext::event_occurred(sc_dt::uint64 last_change_stamp) const 511{ 512 return m_change_stamp == last_change_stamp; 513} 514 515inline 516bool 517sc_simcontext::evaluation_phase() const 518{ 519 return (m_execution_phase == phase_evaluate) && 520 m_ready_to_simulate; 521} 522 523inline 524bool 525sc_simcontext::update_phase() const 526{ 527 return m_execution_phase == phase_update; 528} 529 530inline 531bool 532sc_simcontext::notify_phase() const 533{ 534 return m_execution_phase == phase_notify; 535} 536 537inline 538void 539sc_simcontext::set_error( sc_report* err ) 540{ 541 delete m_error; 542 m_error = err; 543} 544 545 546inline 547bool 548sc_simcontext::get_error() 549{ 550 return m_error != NULL; 551} 552 553inline 554int 555sc_simcontext::add_delta_event( sc_event* e ) 556{ 557 m_delta_events.push_back( e ); 558 return ( m_delta_events.size() - 1 ); 559} 560 561inline 562void 563sc_simcontext::add_timed_event( sc_event_timed* et ) 564{ 565 m_timed_events->insert( et ); 566} 567 568inline sc_object* 569sc_simcontext::get_current_writer() const 570{ 571 return m_current_writer; 572} 573 574inline bool 575sc_simcontext::write_check() const 576{ 577 return m_write_check; 578} 579 580// ---------------------------------------------------------------------------- 581 582class sc_process_handle; 583sc_process_handle sc_get_current_process_handle(); 584 585// Get the current object hierarchy context 586// 587// Returns a pointer the the sc_object (module or process) that 588// would become the parent object of a newly created element 589// of the SystemC object hierarchy, or NULL. 590// 591inline sc_object* 592sc_get_current_object() 593{ 594 return sc_get_curr_simcontext()->active_object(); 595} 596 597inline 598sc_process_b* 599sc_get_current_process_b() 600{ 601 return sc_get_curr_simcontext()->get_curr_proc_info()->process_handle; 602} 603 604// THE FOLLOWING FUNCTION IS DEPRECATED IN 2.1 605extern sc_process_b* sc_get_curr_process_handle(); 606 607inline 608sc_curr_proc_kind 609sc_get_curr_process_kind() 610{ 611 return sc_get_curr_simcontext()->get_curr_proc_info()->kind; 612} 613 614 615inline int sc_get_simulator_status() 616{ 617 return sc_get_curr_simcontext()->sim_status(); 618} 619 620 621// Generates unique names within each module. 622extern 623const char* 624sc_gen_unique_name( const char* basename_, bool preserve_first = false ); 625 626 627// Set the random seed for controlled randomization -- not yet implemented 628extern 629void 630sc_set_random_seed( unsigned int seed_ ); 631 632 633extern void sc_initialize(); 634 635extern const sc_time& sc_max_time(); // Get maximum time value. 636extern const sc_time& sc_time_stamp(); // Current simulation time. 637extern double sc_simulation_time(); // Current time in default time units. 638 639inline 640const std::vector<sc_event*>& sc_get_top_level_events( 641 const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 642{ 643 return simc_p->m_child_events; 644} 645 646inline 647const std::vector<sc_object*>& sc_get_top_level_objects( 648 const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 649{ 650 return simc_p->m_child_objects; 651} 652 653extern sc_event* sc_find_event( const char* name ); 654 655extern sc_object* sc_find_object( const char* name ); 656 657inline 658sc_dt::uint64 sc_delta_count() 659{ 660 return sc_get_curr_simcontext()->m_delta_count; 661} 662 663inline 664bool sc_is_running( const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 665{ 666 return simc_p->m_ready_to_simulate; 667} 668 669bool sc_is_unwinding(); 670 671inline void sc_pause() 672{ 673 sc_get_curr_simcontext()->m_paused = true; 674} 675 676// Return indication if there are more processes to execute in this delta phase 677 678inline bool sc_pending_activity_at_current_time 679 ( const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 680{ 681 return simc_p->pending_activity_at_current_time(); 682} 683 684// Return indication if there are timed notifications in the future 685 686inline bool sc_pending_activity_at_future_time 687 ( const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 688{ 689 sc_time ignored; 690 return simc_p->next_time( ignored ); 691} 692 693// Return indication if there are processes to run, 694// or notifications in the future 695 696inline bool sc_pending_activity 697 ( const sc_simcontext* simc_p = sc_get_curr_simcontext() ) 698{ 699 return sc_pending_activity_at_current_time( simc_p ) 700 || sc_pending_activity_at_future_time( simc_p ); 701} 702 703sc_time 704sc_time_to_pending_activity 705 ( const sc_simcontext* simc_p = sc_get_curr_simcontext() ); 706 707 708inline 709bool 710sc_end_of_simulation_invoked() 711{ 712 return sc_get_curr_simcontext()->m_end_of_simulation_called; 713} 714 715inline bool sc_hierarchical_name_exists( const char* name ) 716{ 717 return sc_find_object(name) || sc_find_event(name); 718} 719 720inline 721bool 722sc_start_of_simulation_invoked() 723{ 724 return sc_get_curr_simcontext()->m_start_of_simulation_called; 725} 726 727// The following variable controls whether process control corners should 728// be considered errors or not. See sc_simcontext.cpp for details on what 729// happens if this value is set to true. 730 731extern bool sc_allow_process_control_corners; 732 733} // namespace sc_core 734 735/***************************************************************************** 736 737 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 738 changes you are making here. 739 740 Name, Affiliation, Date: Andy Goodrich, Forte Design Systems 20 May 2003 741 Description of Modification: - phase callbacks 742 - sc_stop mode 743 744 Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems, 745 25 August, 2003 746 Description of Modification: - support for dynamic process 747 - support for sc export registry 748 - new member methods elaborate(), 749 prepare_to_simulate(), and initial_crunch() 750 that are invoked by initialize() in that order 751 - add sc_get_last_created_process_handle() for 752 use before simulation starts 753 754 Name, Affiliation, Date: Bishnupriya Bhattacharya, Cadence Design Systems, 755 3 March, 2004 756 Description of Modification: add sc_get_curr_process_kind() 757 758 Name, Affiliation, Date: 759 Description of Modification: 760 761 *****************************************************************************/ 762// $Log: sc_simcontext.h,v $ 763// Revision 1.26 2011/09/05 21:20:22 acg 764// Andy Goodrich: result of automake invocation. 765// 766// Revision 1.25 2011/09/01 15:28:10 acg 767// Andy Goodrich: the aftermath of automake. 768// 769// Revision 1.24 2011/08/29 18:04:32 acg 770// Philipp A. Hartmann: miscellaneous clean ups. 771// 772// Revision 1.23 2011/08/26 20:46:10 acg 773// Andy Goodrich: moved the modification log to the end of the file to 774// eliminate source line number skew when check-ins are done. 775// 776// Revision 1.22 2011/08/24 22:05:51 acg 777// Torsten Maehne: initialization changes to remove warnings. 778// 779// Revision 1.21 2011/05/09 04:07:49 acg 780// Philipp A. Hartmann: 781// (1) Restore hierarchy in all phase callbacks. 782// (2) Ensure calls to before_end_of_elaboration. 783// 784// Revision 1.20 2011/04/08 18:26:07 acg 785// Andy Goodrich: added execute_method_next() to handle method dispatch 786// for asynchronous notifications that occur outside the evaluation phase. 787// 788// Revision 1.19 2011/04/05 20:50:57 acg 789// Andy Goodrich: 790// (1) changes to make sure that event(), posedge() and negedge() only 791// return true if the clock has not moved. 792// (2) fixes for method self-resumes. 793// (3) added SC_PRERELEASE_VERSION 794// (4) removed kernel events from the object hierarchy, added 795// sc_hierarchical_name_exists(). 796// 797// Revision 1.18 2011/03/20 13:43:23 acg 798// Andy Goodrich: added async_signal_is() plus suspend() as a corner case. 799// 800// Revision 1.17 2011/03/07 18:25:19 acg 801// Andy Goodrich: tightening of check for resume on a disabled process to 802// only produce an error if it is ready to run. 803// 804// Revision 1.16 2011/03/06 15:58:50 acg 805// Andy Goodrich: added escape to turn off process control corner case 806// checks. 807// 808// Revision 1.15 2011/03/05 04:45:16 acg 809// Andy Goodrich: moved active process calculation to the sc_simcontext class. 810// 811// Revision 1.14 2011/03/05 01:39:21 acg 812// Andy Goodrich: changes for named events. 813// 814// Revision 1.13 2011/02/18 20:27:14 acg 815// Andy Goodrich: Updated Copyrights. 816// 817// Revision 1.12 2011/02/13 21:47:38 acg 818// Andy Goodrich: update copyright notice. 819// 820// Revision 1.11 2011/02/13 21:34:35 acg 821// Andy Goodrich: added SC_UNITIALIZED enum value to process status so 822// its possible to detect throws before initialization. 823// 824// Revision 1.10 2011/02/11 13:25:24 acg 825// Andy Goodrich: Philipp A. Hartmann's changes: 826// (1) Removal of SC_CTHREAD method overloads. 827// (2) New exception processing code. 828// 829// Revision 1.9 2011/02/01 21:18:56 acg 830// Andy Goodrich: addition of new preempt_with() method used to immediately 831// throw exceptions from threads. 832// 833// Revision 1.8 2011/01/25 20:50:37 acg 834// Andy Goodrich: changes for IEEE 1666 2011. 835// 836// Revision 1.7 2011/01/19 23:21:50 acg 837// Andy Goodrich: changes for IEEE 1666 2011 838// 839// Revision 1.6 2011/01/18 20:10:45 acg 840// Andy Goodrich: changes for IEEE1666_2011 semantics. 841// 842// Revision 1.5 2010/07/22 20:02:33 acg 843// Andy Goodrich: bug fixes. 844// 845// Revision 1.4 2009/05/22 16:06:29 acg 846// Andy Goodrich: process control updates. 847// 848// Revision 1.3 2008/05/22 17:06:26 acg 849// Andy Goodrich: updated copyright notice to include 2008. 850// 851// Revision 1.2 2007/09/20 20:32:35 acg 852// Andy Goodrich: changes to the semantics of throw_it() to match the 853// specification. A call to throw_it() will immediately suspend the calling 854// thread until all the throwees have executed. At that point the calling 855// thread will be restarted before the execution of any other threads. 856// 857// Revision 1.1.1.1 2006/12/15 20:20:05 acg 858// SystemC 2.3 859// 860// Revision 1.13 2006/05/08 18:00:06 acg 861// Andy Goodrich: added David Long's forward declarations for friend 862// functions, methods, and operators to keep the Microsoft compiler happy. 863// 864// Revision 1.11 2006/04/11 23:13:21 acg 865// Andy Goodrich: Changes for reduced reset support that only includes 866// sc_cthread, but has preliminary hooks for expanding to method and thread 867// processes also. 868// 869// Revision 1.10 2006/03/21 00:00:34 acg 870// Andy Goodrich: changed name of sc_get_current_process_base() to be 871// sc_get_current_process_b() since its returning an sc_process_b instance. 872// 873// Revision 1.9 2006/01/26 21:04:54 acg 874// Andy Goodrich: deprecation message changes and additional messages. 875// 876// Revision 1.8 2006/01/24 20:49:05 acg 877// Andy Goodrich: changes to remove the use of deprecated features within the 878// simulator, and to issue warning messages when deprecated features are used. 879// 880// Revision 1.7 2006/01/19 00:29:52 acg 881// Andy Goodrich: Yet another implementation for signal write checking. This 882// one uses an environment variable SC_SIGNAL_WRITE_CHECK, that when set to 883// DISABLE will disable write checking on signals. 884// 885// Revision 1.6 2006/01/18 21:42:37 acg 886// Andy Goodrich: Changes for check writer support. 887// 888// Revision 1.5 2006/01/13 18:44:30 acg 889// Added $Log to record CVS changes into the source. 890// 891// Revision 1.4 2006/01/03 23:18:44 acg 892// Changed copyright to include 2006. 893// 894// Revision 1.3 2005/12/20 22:11:10 acg 895// Fixed $Log lines. 896// 897// Revision 1.2 2005/12/20 22:02:30 acg 898// Changed where delta cycles are incremented to match IEEE 1666. Added the 899// event_occurred() method to hide how delta cycle comparisions are done within 900// sc_simcontext. Changed the boolean update_phase to an enum that shows all 901// the phases. 902 903#endif 904