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_process.h -- Process base class support. 23 24 Original Author: Andy Goodrich, Forte Design Systems, 04 August 2005 25 26 27 CHANGE LOG AT THE END OF THE FILE 28 *****************************************************************************/ 29 30 31#if !defined(sc_process_h_INCLUDED) 32#define sc_process_h_INCLUDED 33 34#include <cassert> 35#include "sysc/utils/sc_iostream.h" 36#include "sysc/kernel/sc_constants.h" 37#include "sysc/kernel/sc_object.h" 38#include "sysc/kernel/sc_kernel_ids.h" 39#include "sysc/communication/sc_export.h" 40 41namespace sc_core { 42 43// Forward declarations: 44class sc_process_handle; 45class sc_thread_process; 46class sc_reset; 47 48const char* sc_gen_unique_name( const char*, bool preserve_first ); 49sc_process_handle sc_get_current_process_handle(); 50void sc_thread_cor_fn( void* arg ); 51bool timed_out( sc_simcontext* ); 52 53extern bool sc_allow_process_control_corners; // see sc_simcontext.cpp. 54 55 56// Process handles as forward references: 57 58typedef class sc_cthread_process* sc_cthread_handle; 59typedef class sc_method_process* sc_method_handle; 60typedef class sc_thread_process* sc_thread_handle; 61 62 63// Standard process types: 64 65enum sc_curr_proc_kind 66{ 67 SC_NO_PROC_, 68 SC_METHOD_PROC_, 69 SC_THREAD_PROC_, 70 SC_CTHREAD_PROC_ 71}; 72 73// Descendant information for process hierarchy operations: 74 75enum sc_descendant_inclusion_info { 76 SC_NO_DESCENDANTS=0, 77 SC_INCLUDE_DESCENDANTS, 78 SC_INVALID_DESCENDANTS 79}; 80 81//============================================================================== 82// CLASS sc_process_host 83// 84// This is the base class for objects which may have processes defined for 85// their methods (e.g., sc_module) 86//============================================================================== 87 88class sc_process_host 89{ 90 public: 91 sc_process_host() {} 92 virtual ~sc_process_host() { } // Needed for cast check for sc_module. 93 void defunct() {} 94}; 95 96 97//============================================================================== 98// CLASS sc_process_monitor 99// 100// This class provides a way of monitoring a process' status (e.g., waiting 101// for a thread to complete its execution.) This class is intended to be a base 102// class for classes which need to monitor a process or processes (e.g., 103// sc_join.) Its methods should be overloaded where notifications are desired. 104//============================================================================== 105 106class sc_process_monitor { 107 public: 108 enum { 109 spm_exit = 0 110 }; 111 virtual ~sc_process_monitor() {} 112 virtual void signal(sc_thread_handle thread_p, int type); 113}; 114inline void sc_process_monitor::signal(sc_thread_handle , int ) {} 115 116//------------------------------------------------------------------------------ 117// PROCESS INVOCATION METHOD OR FUNCTION: 118// 119// Define SC_USE_MEMBER_FUNC_PTR if we want to use member function pointers 120// to implement process dispatch. Otherwise, we'll use a hack that involves 121// creating a templated invocation object which will invoke the member 122// function. This should not be necessary, but some compilers (e.g., VC++) 123// do not allow the conversion from `void (callback_tag::*)()' to 124// `void (sc_process_host::*)()'. This is supposed to be OK as long as the 125// dynamic type is correct. C++ Standard 5.4 "Explicit type conversion", 126// clause 7: a pointer to member of derived class type may be explicitly 127// converted to a pointer to member of an unambiguous non-virtual base class 128// type. 129//----------------------------------------------------------------------------- 130 131#if defined(_MSC_VER) 132#if ( _MSC_VER > 1200 ) 133# define SC_USE_MEMBER_FUNC_PTR 134#endif 135#else 136# define SC_USE_MEMBER_FUNC_PTR 137#endif 138 139 140// COMPILER DOES SUPPORT CAST TO void (sc_process_host::*)() from (T::*)(): 141 142#if defined(SC_USE_MEMBER_FUNC_PTR) 143 144 typedef void (sc_process_host::*SC_ENTRY_FUNC)(); 145# define SC_DECL_HELPER_STRUCT(callback_tag, func) /*EMPTY*/ 146# define SC_MAKE_FUNC_PTR(callback_tag, func) \ 147 static_cast<sc_core::SC_ENTRY_FUNC>(&callback_tag::func) 148 149 150// COMPILER NOT DOES SUPPORT CAST TO void (sc_process_host::*)() from (T::*)(): 151 152#else // !defined(SC_USE_MEMBER_FUNC_PTR) 153 class sc_process_call_base { 154 public: 155 inline sc_process_call_base() 156 { 157 } 158 159 virtual ~sc_process_call_base() 160 { 161 } 162 163 virtual void invoke(sc_process_host* host_p) 164 { 165 } 166 }; 167 extern sc_process_call_base sc_process_defunct; 168 169 template<class T> 170 class sc_process_call : public sc_process_call_base { 171 public: 172 sc_process_call( void (T::*method_p)() ) : 173 sc_process_call_base() 174 { 175 m_method_p = method_p; 176 } 177 178 virtual ~sc_process_call() 179 { 180 } 181 182 virtual void invoke(sc_process_host* host_p) 183 { 184 (((T*)host_p)->*m_method_p)(); 185 } 186 187 protected: 188 void (T::*m_method_p)(); // Method implementing the process. 189 }; 190 191 typedef sc_process_call_base* SC_ENTRY_FUNC; 192# define SC_DECL_HELPER_STRUCT(callback_tag, func) /*EMPTY*/ 193# define SC_MAKE_FUNC_PTR(callback_tag, func) \ 194 (::sc_core::SC_ENTRY_FUNC) (new \ 195 ::sc_core::sc_process_call<callback_tag>(&callback_tag::func)) 196 197#endif // !defined(SC_USE_MEMBER_FUNC_PTR) 198 199 200extern void sc_set_stack_size( sc_thread_handle, std::size_t ); 201 202class sc_event; 203class sc_event_list; 204class sc_name_gen; 205class sc_spawn_options; 206class sc_unwind_exception; 207 208//============================================================================== 209// CLASS sc_throw_it<EXCEPT> - ARBITRARY EXCEPTION CLASS 210// 211// This class serves as a way of throwing an execption for an aribtrary type 212// without knowing what that type is. A true virtual method in the base 213// class is used to actually throw the execption. A pointer to the base 214// class is used internally removing the necessity of knowing what the type 215// of EXCEPT is for code internal to the library. 216// 217// Note the clone() true virtual method. This is used to allow instances 218// of the sc_throw_it<EXCEPT> class to be easily garbage collected. Since 219// an exception may be propogated to more than one process knowing when 220// to garbage collect is non-trivial. So when a call is made to 221// sc_process_handle::throw_it() an instance of sc_throw_it<EXCEPT> is 222// allocated on the stack. For each process throwing the exception a copy is 223// made via clone(). That allows those objects to be deleted by the individual 224// processes when they are no longer needed (in this implementation of SystemC 225// that deletion will occur each time a new exception is thrown ( see 226// sc_thread_process::suspend_me() ). 227//============================================================================== 228class sc_throw_it_helper { 229 public: 230 virtual sc_throw_it_helper* clone() const = 0; 231 virtual void throw_it() = 0; 232 sc_throw_it_helper() {} 233 virtual ~sc_throw_it_helper() {} 234}; 235 236template<typename EXCEPT> 237class sc_throw_it : public sc_throw_it_helper 238{ 239 typedef sc_throw_it<EXCEPT> this_type; 240 public: 241 sc_throw_it( const EXCEPT& value ) : m_value(value) { } 242 virtual ~sc_throw_it() {} 243 virtual inline this_type* clone() const { return new this_type(m_value); } 244 virtual inline void throw_it() { throw m_value; } 245 protected: 246 EXCEPT m_value; // value to be thrown. 247}; 248 249//============================================================================== 250// CLASS sc_process_b - USER INITIATED DYNAMIC PROCESS SUPPORT: 251// 252// This class implements the base class for a threaded process_base process 253// whose semantics are provided by the true virtual method semantics(). 254// Classes derived from this one will provide a version of semantics which 255// implements the desired semantics. See the sc_spawn_xxx classes below. 256// 257// Notes: 258// (1) Object instances of this class maintain a reference count of 259// outstanding handles. When the handle count goes to zero the 260// object will be deleted. 261// (2) Descriptions of the methods and operators in this class appear with 262// their implementations. 263// (3) The m_sticky_reset field is used to handle synchronous resets that 264// are enabled via the sc_process_handle::sync_reset_on() method. These 265// resets are not generated by a signal, but rather are modal by 266// method call: sync_reset_on - sync_reset_off. 267// 268//============================================================================== 269class sc_process_b : public sc_object { 270 friend class sc_simcontext; // Allow static processes to have base. 271 friend class sc_cthread_process; // Child can access parent. 272 friend class sc_method_process; // Child can access parent. 273 friend class sc_process_handle; // Allow handles to modify ref. count. 274 friend class sc_thread_process; // Child can access parent. 275 276 friend class sc_object; 277 friend class sc_port_base; 278 friend class sc_runnable; 279 friend class sc_sensitive; 280 friend class sc_sensitive_pos; 281 friend class sc_sensitive_neg; 282 friend class sc_module; 283 friend class sc_report_handler; 284 friend class sc_reset; 285 friend class sc_reset_finder; 286 friend class sc_unwind_exception; 287 288 friend const char* sc_gen_unique_name( const char*, bool preserve_first ); 289 friend sc_process_handle sc_get_current_process_handle(); 290 friend void sc_thread_cor_fn( void* arg ); 291 friend bool timed_out( sc_simcontext* ); 292 293 public: 294 enum process_throw_type { 295 THROW_NONE = 0, 296 THROW_KILL, 297 THROW_USER, 298 THROW_ASYNC_RESET, 299 THROW_SYNC_RESET 300 }; 301 302 enum process_state { 303 ps_bit_disabled = 1, // process is disabled. 304 ps_bit_ready_to_run = 2, // process is ready to run. 305 ps_bit_suspended = 4, // process is suspended. 306 ps_bit_zombie = 8, // process is a zombie. 307 ps_normal = 0 // must be zero. 308 }; 309 310 enum reset_type { // types for sc_process_b::reset_process() 311 reset_asynchronous = 0, // asynchronous reset. 312 reset_synchronous_off, // turn off synchronous reset sticky bit. 313 reset_synchronous_on // turn on synchronous reset sticky bit. 314 }; 315 316 enum trigger_t 317 { 318 STATIC, 319 EVENT, 320 OR_LIST, 321 AND_LIST, 322 TIMEOUT, 323 EVENT_TIMEOUT, 324 OR_LIST_TIMEOUT, 325 AND_LIST_TIMEOUT 326 }; 327 328 public: 329 sc_process_b( const char* name_p, bool is_thread, bool free_host, 330 SC_ENTRY_FUNC method_p, sc_process_host* host_p, 331 const sc_spawn_options* opt_p ); 332 333 protected: 334 // may not be deleted manually (called from destroy_process()) 335 virtual ~sc_process_b(); 336 337 public: 338 inline int current_state() { return m_state; } 339 bool dont_initialize() const { return m_dont_init; } 340 virtual void dont_initialize( bool dont ); 341 std::string dump_state() const; 342 const ::std::vector<sc_object*>& get_child_objects() const; 343 inline sc_curr_proc_kind proc_kind() const; 344 sc_event& reset_event(); 345 sc_event& terminated_event(); 346 347 public: 348 static inline sc_process_handle last_created_process_handle(); 349 350 protected: 351 virtual void add_child_object( sc_object* ); 352 void add_static_event( const sc_event& ); 353 bool dynamic() const { return m_dynamic_proc; } 354 const char* gen_unique_name( const char* basename_, bool preserve_first ); 355 inline sc_report* get_last_report() { return m_last_report_p; } 356 inline bool is_disabled() const; 357 inline bool is_runnable() const; 358 static inline sc_process_b* last_created_process_base(); 359 virtual bool remove_child_object( sc_object* ); 360 void remove_dynamic_events( bool skip_timeout = false ); 361 void remove_static_events(); 362 inline void set_last_report( sc_report* last_p ) 363 { 364 delete m_last_report_p; 365 m_last_report_p = last_p; 366 } 367 inline bool timed_out() const; 368 void report_error( const char* msgid, const char* msg = "" ) const; 369 void report_immediate_self_notification() const; 370 371 protected: // process control methods: 372 virtual void disable_process( 373 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 374 void disconnect_process(); 375 virtual void enable_process( 376 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 377 inline void initially_in_reset( bool async ); 378 inline bool is_unwinding() const; 379 inline bool start_unwinding(); 380 inline bool clear_unwinding(); 381 virtual void kill_process( 382 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 383 void reset_changed( bool async, bool asserted ); 384 void reset_process( reset_type rt, 385 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ); 386 virtual void resume_process( 387 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 388 virtual void suspend_process( 389 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 390 virtual void throw_user( const sc_throw_it_helper& helper, 391 sc_descendant_inclusion_info descendants = SC_NO_DESCENDANTS ) = 0; 392 virtual void throw_reset( bool async ) = 0; 393 virtual bool terminated() const; 394 void trigger_reset_event(); 395 396 private: 397 void delete_process(); 398 inline void reference_decrement(); 399 inline void reference_increment(); 400 401 protected: 402 inline void semantics(); 403 404 // debugging stuff: 405 406 public: 407 const char* file; 408 int lineno; 409 int proc_id; 410 411 protected: 412 int m_active_areset_n; // number of aresets active. 413 int m_active_reset_n; // number of resets active. 414 bool m_dont_init; // true: no initialize call. 415 bool m_dynamic_proc; // true: after elaboration. 416 const sc_event* m_event_p; // Dynamic event waiting on. 417 int m_event_count; // number of events. 418 const sc_event_list* m_event_list_p; // event list waiting on. 419 sc_process_b* m_exist_p; // process existence link. 420 bool m_free_host; // free sc_semantic_host_p. 421 bool m_has_reset_signal; // has reset_signal_is. 422 bool m_has_stack; // true is stack present. 423 bool m_is_thread; // true if this is thread. 424 sc_report* m_last_report_p; // last report this process. 425 sc_name_gen* m_name_gen_p; // subprocess name generator 426 sc_curr_proc_kind m_process_kind; // type of process. 427 int m_references_n; // outstanding handles. 428 std::vector<sc_reset*> m_resets; // resets for process. 429 sc_event* m_reset_event_p; // reset event. 430 sc_event* m_resume_event_p; // resume event. 431 sc_process_b* m_runnable_p; // sc_runnable link 432 sc_process_host* m_semantics_host_p; // host for semantics. 433 SC_ENTRY_FUNC m_semantics_method_p; // method for semantics. 434 int m_state; // process state. 435 std::vector<const sc_event*> m_static_events; // static events waiting on. 436 bool m_sticky_reset; // see note 3 above. 437 sc_event* m_term_event_p; // terminated event. 438 sc_throw_it_helper* m_throw_helper_p; // what to throw. 439 process_throw_type m_throw_status; // exception throwing status 440 bool m_timed_out; // true if we timed out. 441 sc_event* m_timeout_event_p; // timeout event. 442 trigger_t m_trigger_type; // type of trigger using. 443 bool m_unwinding; // true if unwinding stack. 444 445 protected: 446 static sc_process_b* m_last_created_process_p; // Last process created. 447}; 448 449typedef sc_process_b sc_process_b; // For compatibility. 450 451 452//------------------------------------------------------------------------------ 453//"sc_process_b::XXXX_child_YYYYY" 454// 455// These methods provide child object support. 456//------------------------------------------------------------------------------ 457inline void 458sc_process_b::add_child_object( sc_object* object_p ) 459{ 460 sc_object::add_child_object( object_p ); 461 reference_increment(); 462} 463 464inline bool 465sc_process_b::remove_child_object( sc_object* object_p ) 466{ 467 if ( sc_object::remove_child_object( object_p ) ) { 468 reference_decrement(); 469 return true; 470 } 471 else 472 { 473 return false; 474 } 475} 476 477inline const ::std::vector<sc_object*>& 478sc_process_b::get_child_objects() const 479{ 480 return m_child_objects; 481} 482 483 484//------------------------------------------------------------------------------ 485//"sc_process_b::initially_in_reset" 486// 487// This inline method is a callback to indicate that a reset is active at 488// start up. This is because the signal will have been initialized before 489// a reset linkage for it is set up, so we won't get a reset_changed() 490// callback. 491// async = true if this an asynchronous reset. 492//------------------------------------------------------------------------------ 493inline void sc_process_b::initially_in_reset( bool async ) 494{ 495 if ( async ) 496 m_active_areset_n++; 497 else 498 m_active_reset_n++; 499} 500 501//------------------------------------------------------------------------------ 502//"sc_process_b::is_disabled" 503// 504// This method returns true if this process is disabled. 505//------------------------------------------------------------------------------ 506inline bool sc_process_b::is_disabled() const 507{ 508 return (m_state & ps_bit_disabled) ? true : false; 509} 510 511//------------------------------------------------------------------------------ 512//"sc_process_b::is_runnable" 513// 514// This method returns true if this process is runnable. That is indicated 515// by a non-zero m_runnable_p field. 516//------------------------------------------------------------------------------ 517inline bool sc_process_b::is_runnable() const 518{ 519 return m_runnable_p != 0; 520} 521 522//------------------------------------------------------------------------------ 523//"sc_process_b::is_unwinding" 524// 525// This method returns true if this process is unwinding from a kill or reset. 526//------------------------------------------------------------------------------ 527inline bool sc_process_b::is_unwinding() const 528{ 529 return m_unwinding; 530} 531 532//------------------------------------------------------------------------------ 533//"sc_process_b::start_unwinding" 534// 535// This method flags that this object instance should start unwinding if the 536// current throw status requires an unwind. 537// 538// Result is true if the flag is set, false if the flag is already set. 539//------------------------------------------------------------------------------ 540inline bool sc_process_b::start_unwinding() 541{ 542 if ( !m_unwinding ) 543 { 544 switch( m_throw_status ) 545 { 546 case THROW_KILL: 547 case THROW_ASYNC_RESET: 548 case THROW_SYNC_RESET: 549 m_unwinding = true; 550 return true; 551 case THROW_USER: 552 default: 553 break; 554 } 555 } 556 return false; 557} 558 559//------------------------------------------------------------------------------ 560//"sc_process_b::clear_unwinding" 561// 562// This method clears this object instance's throw status and always returns 563// true. 564//------------------------------------------------------------------------------ 565inline bool sc_process_b::clear_unwinding() 566{ 567 m_unwinding = false; 568 return true; 569} 570 571 572//------------------------------------------------------------------------------ 573//"sc_process_b::last_created_process_base" 574// 575// This virtual method returns the sc_process_b pointer for the last 576// created process. It is only used internally by the simulator. 577//------------------------------------------------------------------------------ 578inline sc_process_b* sc_process_b::last_created_process_base() 579{ 580 return m_last_created_process_p; 581} 582 583 584 585//------------------------------------------------------------------------------ 586//"sc_process_b::proc_kind" 587// 588// This method returns the kind of this process. 589//------------------------------------------------------------------------------ 590inline sc_curr_proc_kind sc_process_b::proc_kind() const 591{ 592 return m_process_kind; 593} 594 595 596//------------------------------------------------------------------------------ 597//"sc_process_b::reference_decrement" 598// 599// This inline method decrements the number of outstanding references to this 600// object instance. If the number of references goes to zero, this object 601// can be deleted in "sc_process_b::delete_process()". 602//------------------------------------------------------------------------------ 603inline void sc_process_b::reference_decrement() 604{ 605 m_references_n--; 606 if ( m_references_n == 0 ) delete_process(); 607} 608 609 610//------------------------------------------------------------------------------ 611//"sc_process_b::reference_increment" 612// 613// This inline method increments the number of outstanding references to this 614// object instance. 615//------------------------------------------------------------------------------ 616inline void sc_process_b::reference_increment() 617{ 618 assert(m_references_n != 0); 619 m_references_n++; 620} 621 622//------------------------------------------------------------------------------ 623//"sc_process_b::semantics" 624// 625// This inline method invokes the semantics for this object instance. 626// We check to see if we are initially in reset and then invoke the 627// process semantics. 628// 629// Notes: 630// (1) For a description of the process reset mechanism see the top of 631// the file sc_reset.cpp. 632//------------------------------------------------------------------------------ 633struct scoped_flag 634{ 635 scoped_flag( bool& b ) : ref(b){ ref = true; } 636 ~scoped_flag() { ref = false; } 637 bool& ref; 638}; 639inline void sc_process_b::semantics() 640{ 641 642 // within this function, the process has a stack associated 643 644 scoped_flag scoped_stack_flag( m_has_stack ); 645 646 assert( m_process_kind != SC_NO_PROC_ ); 647 648 // Determine the reset status of this object instance and potentially 649 // trigger its notify event: 650 651 // See if we need to trigger the notify event: 652 653 if ( m_reset_event_p && 654 ( (m_throw_status == THROW_SYNC_RESET) || 655 (m_throw_status == THROW_ASYNC_RESET) ) 656 ) { 657 trigger_reset_event(); 658 } 659 660 // Set the new reset status of this object based on the reset counts: 661 662 m_throw_status = m_active_areset_n ? THROW_ASYNC_RESET : 663 ( m_active_reset_n ? THROW_SYNC_RESET : THROW_NONE); 664 665 // Dispatch the actual semantics for the process: 666 667# ifndef SC_USE_MEMBER_FUNC_PTR 668 m_semantics_method_p->invoke( m_semantics_host_p ); 669# else 670 (m_semantics_host_p->*m_semantics_method_p)(); 671# endif 672} 673 674 675//------------------------------------------------------------------------------ 676//"sc_process_b::terminated" 677// 678// This inline method returns true if this object has terminated. 679//------------------------------------------------------------------------------ 680inline bool sc_process_b::terminated() const 681{ 682 return (m_state & ps_bit_zombie) != 0; 683} 684 685 686//------------------------------------------------------------------------------ 687//"sc_process_b::timed_out" 688// 689// This inline method returns true if this object instance timed out. 690//------------------------------------------------------------------------------ 691inline bool sc_process_b::timed_out() const 692{ 693 return m_timed_out; 694} 695 696} // namespace sc_core 697 698/***************************************************************************** 699 700 MODIFICATION LOG - modifiers, enter your name, affiliation, date and 701 changes you are making here. 702 703 Name, Affiliation, Date: Andy Goodrich, Forte Design Systems, 12 Aug 05 704 Description of Modification: This is the rewrite of process support. It 705 contains some code from the original 706 sc_process.h by Stan Liao, and the now-defunct 707 sc_process_b.h by Stan Liao and Martin 708 Janssen, all of Synopsys, Inc., It also contains 709 code from the original sc_process_b.h by 710 Andy Goodrich of Forte Design Systems and 711 Bishnupriya Bhattacharya of Cadence Design 712 Systems. 713 714 Name, Affiliation, Date: 715 Description of Modification: 716 717 *****************************************************************************/ 718 719// $Log: sc_process.h,v $ 720// Revision 1.36 2011/08/26 22:44:30 acg 721// Torsten Maehne: eliminate unused argument warning. 722// 723// Revision 1.35 2011/08/26 20:46:10 acg 724// Andy Goodrich: moved the modification log to the end of the file to 725// eliminate source line number skew when check-ins are done. 726// 727// Revision 1.34 2011/08/24 22:05:51 acg 728// Torsten Maehne: initialization changes to remove warnings. 729// 730// Revision 1.33 2011/08/15 16:43:24 acg 731// Torsten Maehne: changes to remove unused argument warnings. 732// 733// Revision 1.32 2011/07/24 11:20:03 acg 734// Philipp A. Hartmann: process control error message improvements: 735// (1) Downgrade error to warning for re-kills of processes. 736// (2) Add process name to process messages. 737// (3) drop some superfluous colons in messages. 738// 739// Revision 1.31 2011/04/13 02:44:26 acg 740// Andy Goodrich: added m_unwinding flag in place of THROW_NOW because the 741// throw status will be set back to THROW_*_RESET if reset is active and 742// the check for an unwind being complete was expecting THROW_NONE as the 743// clearing of THROW_NOW. 744// 745// Revision 1.30 2011/04/11 22:07:27 acg 746// Andy Goodrich: check for reset event notification before resetting the 747// throw_status value. 748// 749// Revision 1.29 2011/04/10 22:17:36 acg 750// Andy Goodrich: added trigger_reset_event() to allow sc_process.h to 751// contain the run_process() inline method. sc_process.h cannot have 752// sc_simcontext information because of recursive includes. 753// 754// Revision 1.28 2011/04/08 22:34:06 acg 755// Andy Goodrich: moved the semantics() method to this file and made it 756// an inline method. Added reset processing to the semantics() method. 757// 758// Revision 1.27 2011/04/08 18:24:48 acg 759// Andy Goodrich: moved reset_changed() to .cpp since it needs visibility 760// to sc_simcontext. 761// 762// Revision 1.26 2011/04/01 21:24:57 acg 763// Andy Goodrich: removed unused code. 764// 765// Revision 1.25 2011/03/28 13:02:51 acg 766// Andy Goodrich: Changes for disable() interactions. 767// 768// Revision 1.24 2011/03/20 13:43:23 acg 769// Andy Goodrich: added async_signal_is() plus suspend() as a corner case. 770// 771// Revision 1.23 2011/03/12 21:07:51 acg 772// Andy Goodrich: changes to kernel generated event support. 773// 774// Revision 1.22 2011/03/08 20:49:31 acg 775// Andy Goodrich: implement coarse checking for synchronous reset - suspend 776// interaction. 777// 778// Revision 1.21 2011/03/07 17:38:43 acg 779// Andy Goodrich: tightening up of checks for undefined interaction between 780// synchronous reset and suspend. 781// 782// Revision 1.20 2011/03/06 19:57:11 acg 783// Andy Goodrich: refinements for the illegal suspend - synchronous reset 784// interaction. 785// 786// Revision 1.19 2011/03/05 19:44:20 acg 787// Andy Goodrich: changes for object and event naming and structures. 788// 789// Revision 1.18 2011/02/19 08:30:53 acg 790// Andy Goodrich: Moved process queueing into trigger_static from 791// sc_event::notify. 792// 793// Revision 1.17 2011/02/18 20:27:14 acg 794// Andy Goodrich: Updated Copyrights. 795// 796// Revision 1.16 2011/02/18 20:10:44 acg 797// Philipp A. Hartmann: force return expression to be a bool to keep MSVC 798// happy. 799// 800// Revision 1.15 2011/02/17 19:52:45 acg 801// Andy Goodrich: 802// (1) Simplified process control usage. 803// (2) Changed dump_status() to dump_state() with new signature. 804// 805// Revision 1.14 2011/02/16 22:37:30 acg 806// Andy Goodrich: clean up to remove need for ps_disable_pending. 807// 808// Revision 1.13 2011/02/13 21:47:37 acg 809// Andy Goodrich: update copyright notice. 810// 811// Revision 1.12 2011/02/13 21:41:34 acg 812// Andy Goodrich: get the log messages for the previous check in correct. 813// 814// Revision 1.11 2011/02/13 21:32:24 acg 815// Andy Goodrich: moved sc_process_b::reset_process() implementation 816// from header to cpp file . Added dump_status() to print out the status of a 817// process. 818// 819// Revision 1.10 2011/02/11 13:25:24 acg 820// Andy Goodrich: Philipp A. Hartmann's changes: 821// (1) Removal of SC_CTHREAD method overloads. 822// (2) New exception processing code. 823// 824// Revision 1.9 2011/02/04 15:27:36 acg 825// Andy Goodrich: changes for suspend-resume semantics. 826// 827// Revision 1.8 2011/02/01 21:06:12 acg 828// Andy Goodrich: new layout for the process_state enum. 829// 830// Revision 1.7 2011/01/25 20:50:37 acg 831// Andy Goodrich: changes for IEEE 1666 2011. 832// 833// Revision 1.6 2011/01/19 23:21:50 acg 834// Andy Goodrich: changes for IEEE 1666 2011 835// 836// Revision 1.5 2011/01/18 20:10:45 acg 837// Andy Goodrich: changes for IEEE1666_2011 semantics. 838// 839// Revision 1.4 2010/07/22 20:02:33 acg 840// Andy Goodrich: bug fixes. 841// 842// Revision 1.3 2009/05/22 16:06:29 acg 843// Andy Goodrich: process control updates. 844// 845// Revision 1.2 2008/05/22 17:06:26 acg 846// Andy Goodrich: updated copyright notice to include 2008. 847// 848// Revision 1.1.1.1 2006/12/15 20:20:05 acg 849// SystemC 2.3 850// 851// Revision 1.11 2006/05/08 17:58:10 acg 852// Andy Goodrich: added David Long's forward declarations for friend 853// functions, methods, and operators to keep the Microsoft compiler happy. 854// 855// Revision 1.10 2006/04/28 23:29:01 acg 856// Andy Goodrich: added an sc_core:: prefix to SC_FUNC_PTR in the 857// SC_MAKE_FUNC_PTR macro to allow its transpareuse outside of the sc_core 858// namespace. 859// 860// Revision 1.9 2006/04/28 21:52:57 acg 861// Andy Goodrich: changed SC_MAKE_FUNC_PTR to use a static cast to address 862// and AIX issue wrt sc_module's inherited classes. 863// 864// Revision 1.8 2006/04/20 17:08:17 acg 865// Andy Goodrich: 3.0 style process changes. 866// 867// Revision 1.7 2006/04/11 23:13:21 acg 868// Andy Goodrich: Changes for reduced reset support that only includes 869// sc_cthread, but has preliminary hooks for expanding to method and thread 870// processes also. 871// 872// Revision 1.6 2006/03/13 20:26:50 acg 873// Andy Goodrich: Addition of forward class declarations, e.g., 874// sc_reset, to keep gcc 4.x happy. 875// 876// Revision 1.5 2006/01/31 20:09:10 acg 877// Andy Goodrich: added explaination of static vs dynamic waits to 878// sc_process_b::trigger_static. 879// 880// Revision 1.4 2006/01/24 20:49:05 acg 881// Andy Goodrich: changes to remove the use of deprecated features within the 882// simulator, and to issue warning messages when deprecated features are used. 883// 884// Revision 1.3 2006/01/13 18:44:30 acg 885// Added $Log to record CVS changes into the source. 886 887#endif // !defined(sc_process_h_INCLUDED) 888