SystemC  Recoding Infrastructure for SystemC v0.6.2 derived from Accellera SystemC 2.3.1
Accellera SystemC proof-of-concept library
sc_method_process.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 distributed 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_method_process.h -- Thread process declarations
21 
22  Original Author: Andy Goodrich, Forte Design Systems, 4 August 2005
23 
24 
25  CHANGE LOG AT THE END OF THE FILE
26  *****************************************************************************/
27 
28 
29 #if !defined(sc_method_process_h_INCLUDED)
30 #define sc_method_process_h_INCLUDED
31 
33 #include "sysc/kernel/sc_process.h"
34 #include "sysc/kernel/sc_cor.h"
35 #include "sysc/kernel/sc_event.h"
36 #include "sysc/kernel/sc_except.h"
37 #include "sysc/kernel/sc_reset.h"
38 
39 // DEBUGGING MACROS:
40 //
41 // DEBUG_MSG(NAME,P,MSG)
42 // MSG = message to print
43 // NAME = name that must match the process for the message to print, or
44 // null if the message should be printed unconditionally.
45 // P = pointer to process message is for, or NULL in which case the
46 // message will not print.
47 #if 0
48 # define DEBUG_NAME ""
49 # define DEBUG_MSG(NAME,P,MSG) \
50  { \
51  if ( P && ( (strlen(NAME)==0) || !strcmp(NAME,P->name())) ) \
52  std::cout << "**** " << sc_time_stamp() << " (" \
53  << sc_get_current_process_name() << "): " << MSG \
54  << " - " << P->name() << std::endl; \
55  }
56 #else
57 # define DEBUG_MSG(NAME,P,MSG)
58 #endif
59 
60 // 02/22/2016 ZC: to enable verbose display or not
61 #ifndef _SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR
62 #define _SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR "SYSC_PRINT_VERBOSE_MESSAGE"
63 #endif
64 namespace sc_core {
65 
66 // forward references:
67 class sc_event_and_list;
68 class sc_event_or_list;
69 class sc_reset;
70 void sc_method_cor_fn( void* );
71 void sc_set_stack_size( sc_method_handle, std::size_t );
72 class sc_event;
73 class sc_join;
74 class sc_module;
75 class sc_process_handle;
76 class sc_process_table;
77 class sc_simcontext;
78 class sc_runnable;
79 
80 class Invoker; //DM 05/16/2019
81 
82 sc_cor* get_cor_pointer( sc_process_b* process_p );
83 void sc_set_stack_size( sc_method_handle thread_h, std::size_t size );
84 
85 //DM 05/24/2019
86 void next_trigger( sc_simcontext* );
87 void next_trigger( const sc_event&, sc_simcontext* );
88 void next_trigger( const sc_event_or_list&, sc_simcontext* );
89 void next_trigger( const sc_event_and_list&, sc_simcontext* );
90 void next_trigger( const sc_time&, sc_simcontext* );
91 void next_trigger( const sc_time&, const sc_event&, sc_simcontext* );
92 void next_trigger( const sc_time&, const sc_event_or_list&, sc_simcontext* );
93 void next_trigger( const sc_time&, const sc_event_and_list&, sc_simcontext* );
94 
95 
96 
97 /**************************************************************************/
103  friend void sc_method_cor_fn( void* );
104  friend void sc_set_stack_size( sc_method_handle, std::size_t );
105  friend class sc_event;
106  friend class sc_join;
107  friend class sc_module;
108 
109  // 04/07/2015 GL: a new sc_channel class is derived from sc_module
110  friend class sc_channel;
111 
112  friend class sc_process_b;
113  friend class sc_process_handle;
114  friend class sc_process_table;
115  friend class sc_simcontext;
116  friend class sc_runnable;
117  friend sc_cor* get_cor_pointer( sc_process_b* process_p );
118 
119  friend class Invoker; //DM 05/16/2019
120 //DM 05/28/2019 removed seg id argument in next_trigger()
121  friend void next_trigger( sc_simcontext* );
122  friend void next_trigger( const sc_event&,
123  sc_simcontext* );
124  friend void next_trigger( const sc_event_or_list&,
125  sc_simcontext* );
126  friend void next_trigger( const sc_event_and_list&,
127  sc_simcontext* );
128  friend void next_trigger( const sc_time&,
129  sc_simcontext* );
130  friend void next_trigger( const sc_time&, const sc_event&,
131  sc_simcontext* );
132  friend void next_trigger( const sc_time&, const sc_event_or_list&,
133  sc_simcontext* );
134  friend void next_trigger( const sc_time&, const sc_event_and_list&,
135  sc_simcontext* );
136 
137 
138 
139  public:
140 
143  sc_method_process( const char* name_p, bool free_host,
144  SC_ENTRY_FUNC method_p, sc_process_host* host_p,
145  const sc_spawn_options* opt_p );
146 
147  virtual const char* kind() const
148  { return "sc_method_process"; }
149 
150  void aux_boundary();
151  protected:
152  // may not be deleted manually (called from sc_process_b)
153  virtual ~sc_method_process();
154 
155  virtual void disable_process(
157  virtual void enable_process(
159  virtual void kill_process(
163  virtual void prepare_for_simulation();
168  // 08/14/2015 GL: modified for the OoO simulation
169  void clear_trigger( );
170 
175  // 08/14/2015 GL: modified for the OoO simulation
176  void next_trigger( const sc_event& );
177 
182  // 08/14/2015 GL: modified for the OoO simulation
183  void next_trigger( const sc_event_or_list& );
184 
189  // 08/14/2015 GL: modified for the OoO simulation
190  void next_trigger( const sc_event_and_list& );
191 
196  // 08/14/2015 GL: modified for the OoO simulation
197  void next_trigger( const sc_time& );
198 
203  // 08/14/2015 GL: modified for the OoO simulation
204  void next_trigger( const sc_time&, const sc_event& );
205 
210  // 08/14/2015 GL: modified for the OoO simulation
211  void next_trigger( const sc_time&, const sc_event_or_list& );
212 
217  // 08/14/2015 GL: modified for the OoO simulation
218  void next_trigger( const sc_time&, const sc_event_and_list& );
219 
220 
221 
222 
223  virtual void resume_process(
225  void set_next_exist( sc_method_handle next_p );
226  void set_next_runnable( sc_method_handle next_p );
227 
228  void set_stack_size( std::size_t size );
229 
230  virtual void suspend_process(
232  virtual void throw_reset( bool async );
233  virtual void throw_user( const sc_throw_it_helper& helper,
235 
236  bool trigger_dynamic( sc_event*, bool& );
237  bool deliver_event_at_time( sc_event* e, sc_timestamp e_delivery_time );
238 
243  // 08/14/2015 GL: add a new parameter to update the local time stamp
244  //inline void trigger_static();
245  inline void trigger_static( sc_event* );
246 
247  protected:
248  void add_monitor( sc_process_monitor* monitor_p );
249  void remove_monitor( sc_process_monitor* monitor_p);
250  void signal_monitors( int type = 0 );
251 
252  protected:
253  sc_cor* m_cor_p; // Thread's coroutine.
254  std::vector<sc_process_monitor*> m_monitor_q; // Thread monitors.
255  std::size_t m_stack_size; // Thread stack size.
256  int m_wait_cycle_n; // # of waits to be done.
257 
258  private: // disabled
260  const sc_method_process& operator = ( const sc_method_process& );
261 
262  //DM 07/28/2019 experiment
263  std::unordered_set<sc_method_process*> dependent_methods;
264  std::vector<sc_method_process*> m_contingent_methods;
265  std::unordered_set<sc_thread_process*> m_contingent_threads;
266 
267  std::unordered_set<sc_thread_process*> dependent_threads;
268 
269  std::unordered_set<sc_method_process*> combined_data_conflict_methods;
270  std::unordered_set<sc_thread_process*> combined_data_conflict_threads;
271 
272 };
273 
274 //------------------------------------------------------------------------------
275 //"sc_method_process::set_stack_size"
276 //
277 //------------------------------------------------------------------------------
278 inline void sc_method_process::set_stack_size( std::size_t size )
279 {
280  assert( size );
281  m_stack_size = size;
282 }
283 
284 //------------------------------------------------------------------------------
285 //"sc_method_process::next_trigger"
286 //
287 // Notes:
288 // (1) The correct order to lock and unlock channel locks (to avoid deadlocks
289 // and races) for SystemC functions without context switch:
290 //
291 // outer_channel.lock_and_push
292 // [outer channel work]
293 // inner_channel.lock_and_push
294 // [inner channel work]
295 // +------------------------------NEXT_TRIGGER------------------------------+
296 // | +------------------------Simulation Kernel------------------------+ |
297 // | | acquire kernel lock | |
298 // | | [kernel work] | |
299 // | | release kernel lock | |
300 // | +-----------------------------------------------------------------+ |
301 // +------------------------------------------------------------------------+
302 // [inner channel work]
303 // inner_channel.pop_and_unlock
304 // [outer channel work]
305 // outer_channel.pop_and_unlock
306 //
307 // (2) For more information, please refer to sc_thread_process.h: 272
308 //
309 // (02/20/2015 GL)
310 //------------------------------------------------------------------------------
311 inline
312 void
314 {
315  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
316  sc_kernel_lock lock;
317 
318 #ifdef SC_LOCK_CHECK
319  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
320 #endif /* SC_LOCK_CHECK */
321  clear_trigger( );
322  e.add_dynamic( this );
323  m_event_p = &e;
325  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
326 }
327 
328 inline
329 void
331 {
332  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
333  sc_kernel_lock lock;
334 
335 #ifdef SC_LOCK_CHECK
336  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
337 #endif /* SC_LOCK_CHECK */
338  clear_trigger( );
339  el.add_dynamic( this );
340  m_event_list_p = &el;
342  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
343 }
344 
345 inline
346 void
348 {
349  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
350  sc_kernel_lock lock;
351 
352 #ifdef SC_LOCK_CHECK
353  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
354 #endif /* SC_LOCK_CHECK */
355  clear_trigger( );
356  el.add_dynamic( this );
357  m_event_list_p = &el;
358  m_event_count = el.size();
360  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
361 }
362 
363 inline
364 void
366 {
367  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
368  sc_kernel_lock lock;
369 
370 #ifdef SC_LOCK_CHECK
371  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
372 #endif /* SC_LOCK_CHECK */
373  clear_trigger( );
374  m_timeout_event_p->notify_internal( t );
375  m_timeout_event_p->add_dynamic( this );
377  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
378 }
379 
380 inline
381 void
383 {
384  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
385  sc_kernel_lock lock;
386 
387 #ifdef SC_LOCK_CHECK
388  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
389 #endif /* SC_LOCK_CHECK */
390  clear_trigger( );
391  m_timeout_event_p->notify_internal( t );
392  m_timeout_event_p->add_dynamic( this );
393  e.add_dynamic( this );
394  m_event_p = &e;
396  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
397 }
398 
399 inline
400 void
402 {
403  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
404  sc_kernel_lock lock;
405 
406 #ifdef SC_LOCK_CHECK
407  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
408 #endif /* SC_LOCK_CHECK */
409  clear_trigger( );
410  m_timeout_event_p->notify_internal( t );
411  m_timeout_event_p->add_dynamic( this );
412  el.add_dynamic( this );
413  m_event_list_p = &el;
415  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
416 }
417 
418 inline
419 void
421 {
422  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
423  sc_kernel_lock lock;
424 
425 #ifdef SC_LOCK_CHECK
426  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
427 #endif /* SC_LOCK_CHECK */
428  clear_trigger( );
429  m_timeout_event_p->notify_internal( t );
430  m_timeout_event_p->add_dynamic( this );
431  el.add_dynamic( this );
432  m_event_list_p = &el;
433  m_event_count = el.size();
435  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
436 }
437 
438 inline
439 void
441 {
442 
443 
444 
445 
446  if( m_unwinding )
447  SC_REPORT_ERROR( SC_ID_WAIT_DURING_UNWINDING_, name() );
448 
449  {
450  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
451  sc_kernel_lock lock;
452 
453 #ifdef SC_LOCK_CHECK
454  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
455 #endif /* SC_LOCK_CHECK */
456 
457  // 08/14/2015 GL: set the new segment ID of this thread
458  set_segment_id( -2 );
459 
460  unlock_all_channels(); // 02/16/2015 GL: release all the channel locks
461 
462 
463  //ZC 9:06 2017/3/14
464  // if(getenv(_SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR))
465  // printf("\n%s is calling wait for nothing\n",this->name());
466 
467 
469  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
470  }
471 #ifdef SC_LOCK_CHECK
472  assert( sc_get_curr_simcontext()->is_not_owner() );
473 #endif /* SC_LOCK_CHECK */
474  lock_all_channels(); // 02/16/2015 GL: acquire all the channel locks
475 
476 
477 
478 }
479 
480 //------------------------------------------------------------------------------
481 //"sc_method_process::miscellaneous support"
482 //
483 //------------------------------------------------------------------------------
484 inline
486 {
487  m_monitor_q.push_back(monitor_p);
488 }
489 
490 
491 inline
493 {
494  int mon_n = m_monitor_q.size();
495 
496  for ( int mon_i = 0; mon_i < mon_n; mon_i++ )
497  {
498  if ( m_monitor_q[mon_i] == monitor_p )
499  {
500  m_monitor_q[mon_i] = m_monitor_q[mon_n-1];
501  m_monitor_q.resize(mon_n-1);
502  }
503  }
504 }
505 
506 inline
508 {
509  m_exist_p = next_p;
510 }
511 
512 inline
514 {
515  return (sc_method_handle)m_exist_p;
516 }
517 
518 inline
520 {
521  m_runnable_p = next_p;
522 }
523 
524 inline
526 {
528 }
529 
530 //------------------------------------------------------------------------------
531 //"sc_method_process::trigger_static"
532 //
533 // This inline method adds the current thread to the queue of runnable
534 // processes, if required. This is the case if the following criteria
535 // are met:
536 // (1) The process is in a runnable state.
537 // (2) The process is not already on the run queue.
538 // (3) The process is expecting a static trigger,
539 // dynamic event waits take priority.
540 // (4) The process' static wait count is zero.
541 //
542 // If the triggering process is the same process, the trigger is
543 // ignored as well, unless SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS
544 // is defined.
545 //------------------------------------------------------------------------------
546 inline
547 void
548 // 08/14/2015 GL: add a new parameter to update the local time stamp
549 //sc_method_process::trigger_static()
551 {
552  // 05/05/2015 GL: we may or may not have acquired the kernel lock upon here
553  // 1) this function is invoked in sc_simcontext::prepare_to_simulate(),
554  // where the kernel lock is not acquired as it is in the initialization
555  // phase
556  // 2) this function is also invoked in sc_event::notify(), where the kernel
557  // lock is acquired
558 
559  // No need to try queueing this thread if one of the following is true:
560  // (a) its disabled
561  // (b) its already queued for execution
562  // (c) its waiting on a dynamic event
563  // (d) its wait count is not satisfied
564 
565  if ( (m_state & ps_bit_disabled) || is_runnable() ||
567  return;
568 
569 #if ! defined( SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS )
570  if( SC_UNLIKELY_( sc_get_current_process_b() == this ) )
571  {
573  return;
574  }
575 #endif // SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS
576 
577  if ( m_wait_cycle_n > 0 )
578  {
579  --m_wait_cycle_n;
580  return;
581  }
582 
583  // If we get here then the thread is has satisfied its wait criteria, if
584  // its suspended mark its state as ready to run. If its not suspended then
585  // push it onto the runnable queue.
586 
587  if ( m_state & ps_bit_suspended )
588  {
590  }
591  else
592  {
593  // 12/22/2016 GL: store the current time before updating
594  sc_time curr_time = m_timestamp.get_time_count();
595 
596  // 08/14/2015 GL: update the local time stamp of this thread process
598  switch( e->m_notify_type )
599  {
600  case sc_event::DELTA: // delta notification
601  if ( ts > m_timestamp ) {
603  ts.get_delta_count() + 1 ) );
604  } else {
607  + 1 ) );
608  }
609  break;
610  case sc_event::TIMED: // timed notification
611  set_timestamp( ts );
612  break;
613  case sc_event::NONE:
614  assert( 0 ); // wrong type
615  }
616 
617  simcontext()->push_runnable_method(this);
618 
619  // 12/22/2016 GL: update m_oldest_time in sc_simcontext if necessary
620  simcontext()->update_oldest_time( curr_time );
621  }
622 }
623 
624 #undef DEBUG_MSG
625 #undef DEBUG_NAME
626 
627 } // namespace sc_core
628 
629 // $Log: sc_method_process.h,v $
630 // Revision 1.30 2011/08/26 20:46:11 acg
631 // Andy Goodrich: moved the modification log to the end of the file to
632 // eliminate source line number skew when check-ins are done.
633 //
634 // Revision 1.29 2011/08/24 23:36:12 acg
635 // Andy Goodrich: removed break statements that can never be reached and
636 // which causes warnings in the Greenhills C++ compiler.
637 //
638 // Revision 1.28 2011/04/14 22:34:27 acg
639 // Andy Goodrich: removed dead code.
640 //
641 // Revision 1.27 2011/04/13 05:02:18 acg
642 // Andy Goodrich: added missing check to the wake up code in suspend_me()
643 // so that we just return if the call to suspend_me() was issued from a
644 // stack unwinding.
645 //
646 // Revision 1.26 2011/04/13 02:44:26 acg
647 // Andy Goodrich: added m_unwinding flag in place of THROW_NOW because the
648 // throw status will be set back to THROW_*_RESET if reset is active and
649 // the check for an unwind being complete was expecting THROW_NONE as the
650 // clearing of THROW_NOW.
651 //
652 // Revision 1.25 2011/04/11 22:05:14 acg
653 // Andy Goodrich: use the DEBUG_NAME macro in DEBUG_MSG invocations.
654 //
655 // Revision 1.24 2011/04/10 22:12:32 acg
656 // Andy Goodrich: adding debugging macros.
657 //
658 // Revision 1.23 2011/04/08 22:41:28 acg
659 // Andy Goodrich: added comment pointing to the description of the reset
660 // mechanism in sc_reset.cpp.
661 //
662 // Revision 1.22 2011/04/08 18:27:33 acg
663 // Andy Goodrich: added check to make sure we don't schedule a running process
664 // because of it issues a notify() it is sensitive to.
665 //
666 // Revision 1.21 2011/04/05 06:22:38 acg
667 // Andy Goodrich: expanded comment for trigger_static() initial vetting.
668 //
669 // Revision 1.20 2011/04/01 21:24:57 acg
670 // Andy Goodrich: removed unused code.
671 //
672 // Revision 1.19 2011/02/19 08:30:53 acg
673 // Andy Goodrich: Moved process queueing into trigger_static from
674 // sc_event::notify.
675 //
676 // Revision 1.18 2011/02/18 20:27:14 acg
677 // Andy Goodrich: Updated Copyrights.
678 //
679 // Revision 1.17 2011/02/17 19:55:58 acg
680 // Andy Goodrich:
681 // (1) Changed signature of trigger_dynamic() back to a bool.
682 // (2) Simplified process control usage.
683 // (3) Changed trigger_static() to recognize process controls and to
684 // do the down-count on wait(N), allowing the elimination of
685 // ready_to_run().
686 //
687 // Revision 1.16 2011/02/16 22:37:31 acg
688 // Andy Goodrich: clean up to remove need for ps_disable_pending.
689 //
690 // Revision 1.15 2011/02/13 21:47:38 acg
691 // Andy Goodrich: update copyright notice.
692 //
693 // Revision 1.14 2011/02/13 21:35:54 acg
694 // Andy Goodrich: added error for performing a wait() during unwinding.
695 //
696 // Revision 1.13 2011/02/11 13:25:24 acg
697 // Andy Goodrich: Philipp A. Hartmann's changes:
698 // (1) Removal of SC_CTHREAD method overloads.
699 // (2) New exception processing code.
700 //
701 // Revision 1.12 2011/02/01 23:01:53 acg
702 // Andy Goodrich: removed dead code.
703 //
704 // Revision 1.11 2011/02/01 21:18:01 acg
705 // Andy Goodrich:
706 // (1) Changes in throw processing for new process control rules.
707 // (2) Support of new process_state enum values.
708 //
709 // Revision 1.10 2011/01/25 20:50:37 acg
710 // Andy Goodrich: changes for IEEE 1666 2011.
711 //
712 // Revision 1.9 2011/01/19 23:21:50 acg
713 // Andy Goodrich: changes for IEEE 1666 2011
714 //
715 // Revision 1.8 2011/01/18 20:10:45 acg
716 // Andy Goodrich: changes for IEEE1666_2011 semantics.
717 //
718 // Revision 1.7 2011/01/06 17:59:58 acg
719 // Andy Goodrich: removed debugging output.
720 //
721 // Revision 1.6 2010/07/22 20:02:33 acg
722 // Andy Goodrich: bug fixes.
723 //
724 // Revision 1.5 2009/07/28 01:10:53 acg
725 // Andy Goodrich: updates for 2.3 release candidate.
726 //
727 // Revision 1.4 2009/05/22 16:06:29 acg
728 // Andy Goodrich: process control updates.
729 //
730 // Revision 1.3 2009/03/12 22:59:58 acg
731 // Andy Goodrich: updates for 2.4 stuff.
732 //
733 // Revision 1.2 2008/05/22 17:06:06 acg
734 // Andy Goodrich: formatting and comments.
735 //
736 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
737 // SystemC 2.3
738 //
739 // Revision 1.7 2006/05/08 17:57:13 acg
740 // Andy Goodrich: Added David Long's forward declarations for friend functions
741 // to keep the Microsoft C++ compiler happy.
742 //
743 // Revision 1.6 2006/04/20 17:08:17 acg
744 // Andy Goodrich: 3.0 style process changes.
745 //
746 // Revision 1.5 2006/04/11 23:13:21 acg
747 // Andy Goodrich: Changes for reduced reset support that only includes
748 // sc_cthread, but has preliminary hooks for expanding to method and thread
749 // processes also.
750 //
751 // Revision 1.4 2006/01/24 20:49:05 acg
752 // Andy Goodrich: changes to remove the use of deprecated features within the
753 // simulator, and to issue warning messages when deprecated features are used.
754 //
755 // Revision 1.3 2006/01/13 18:44:30 acg
756 // Added $Log to record CVS changes into the source.
757 
758 #endif // !defined(sc_method_process_h_INCLUDED)
virtual void disable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
friend sc_cor * get_cor_pointer(sc_process_b *process_p)
void report_immediate_self_notification() const
sc_process_b * sc_get_current_process_b()
virtual void enable_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
OR list of events.
Definition: sc_event.h:228
A scoped mutex for the kernel lock.
void set_next_runnable(sc_method_handle next_p)
#define SC_REPORT_ERROR(msg_type, msg)
Definition: sc_report.h:213
sc_process_b sc_process_b
Definition: sc_process.h:977
A time stamp combining timed cycles and delta cycles.
Definition: sc_process.h:434
const sc_time & get_time_count() const
Get the value of timed cycles.
void oooschedule(sc_cor *cor)
Scheduling function in the OoO simulation.
sc_descendant_inclusion_info
Definition: sc_process.h:136
This class provides access to an sc_process_b object instance in a manner which allows some persisten...
void trigger_static(sc_event *)
A new parameter is added to update the local time stamp in the thread process.
void(sc_process_host::* SC_ENTRY_FUNC)()
Definition: sc_process.h:212
friend void sc_set_stack_size(sc_method_handle, std::size_t)
AND list of events.
Definition: sc_event.h:193
virtual void suspend_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
#define SC_UNLIKELY_(x)
Definition: sc_cmnhdr.h:85
sc_event * m_timeout_event_p
Definition: sc_process.h:924
sc_method_handle next_exist()
sc_cor * get_cor_pointer(sc_process_b *process_p)
Coroutine abstract base class.
Definition: sc_cor.h:57
const char * name() const
Definition: sc_object.h:71
bool deliver_event_at_time(sc_event *e, sc_timestamp e_delivery_time)
sc_simcontext * simcontext() const
Definition: sc_object.h:85
class sc_method_process * sc_method_handle
Definition: sc_process.h:120
const sc_event * m_event_p
Definition: sc_process.h:898
int size() const
Definition: sc_event.h:643
virtual void resume_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
void add_dynamic(sc_method_handle) const
User initiated dynamic process support.
Definition: sc_process.h:558
std::vector< sc_process_monitor * > m_monitor_q
friend void next_trigger(sc_simcontext *)
A new parameter segment ID is added for the out-of-order simulation.
virtual void throw_user(const sc_throw_it_helper &helper, sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
void add_monitor(sc_process_monitor *monitor_p)
Class that manages the ready-to-run queues.
Definition: sc_runnable.h:42
virtual void kill_process(sc_descendant_inclusion_info descendants=SC_NO_DESCENDANTS)
trigger_t m_trigger_type
Definition: sc_process.h:925
void lock_all_channels(void)
Acquire all the channel locks.
sc_process_b * m_exist_p
Definition: sc_process.h:902
const sc_timestamp & get_notify_timestamp() const
GET the notification time stamp.
void set_stack_size(std::size_t size)
The event class.
Definition: sc_event.h:260
void sc_method_cor_fn(void *)
The simulation context.
void clear_trigger()
A new parameter segment ID is added for the out-of-order simulation.
Base class for all structural entities.
Definition: sc_module.h:83
void unlock_all_channels(void)
Release all the channel locks.
sc_method_handle next_runnable()
sc_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)
sc_timestamp m_timestamp
The local time stamp of this process.
Definition: sc_process.h:944
Base class for all hierarchical channels.
Definition: sc_module.h:712
void signal_monitors(int type=0)
virtual const char * kind() const
bool trigger_dynamic(sc_event *, bool &)
sc_simcontext * sc_get_curr_simcontext()
void set_timestamp(const sc_timestamp &ts)
Get the local time stamp of this process.
void sc_set_stack_size(sc_method_handle, std::size_t)
This is the base class for objects which may have processes defined for their methods (e...
Definition: sc_process.h:149
void next_trigger(sc_simcontext *)
A new parameter segment ID is added for the out-of-order simulation.
virtual void throw_reset(bool async)
void set_next_exist(sc_method_handle next_p)
sc_process_b * m_runnable_p
Definition: sc_process.h:914
void remove_monitor(sc_process_monitor *monitor_p)
value_type get_delta_count() const
Get the value of delta cycles.
friend void sc_method_cor_fn(void *)
bool is_runnable() const
Definition: sc_process.h:1047
void set_segment_id(int id)
Get the current segment ID of this process.
virtual void prepare_for_simulation()
const sc_event_list * m_event_list_p
Definition: sc_process.h:901