SystemC  Recoding Infrastructure for SystemC v0.6.0 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  void 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 };
263 
264 //------------------------------------------------------------------------------
265 //"sc_method_process::set_stack_size"
266 //
267 //------------------------------------------------------------------------------
268 inline void sc_method_process::set_stack_size( std::size_t size )
269 {
270  assert( size );
271  m_stack_size = size;
272 }
273 
274 //------------------------------------------------------------------------------
275 //"sc_method_process::next_trigger"
276 //
277 // Notes:
278 // (1) The correct order to lock and unlock channel locks (to avoid deadlocks
279 // and races) for SystemC functions without context switch:
280 //
281 // outer_channel.lock_and_push
282 // [outer channel work]
283 // inner_channel.lock_and_push
284 // [inner channel work]
285 // +------------------------------NEXT_TRIGGER------------------------------+
286 // | +------------------------Simulation Kernel------------------------+ |
287 // | | acquire kernel lock | |
288 // | | [kernel work] | |
289 // | | release kernel lock | |
290 // | +-----------------------------------------------------------------+ |
291 // +------------------------------------------------------------------------+
292 // [inner channel work]
293 // inner_channel.pop_and_unlock
294 // [outer channel work]
295 // outer_channel.pop_and_unlock
296 //
297 // (2) For more information, please refer to sc_thread_process.h: 272
298 //
299 // (02/20/2015 GL)
300 //------------------------------------------------------------------------------
301 inline
302 void
304 {
305  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
306  sc_kernel_lock lock;
307 
308 #ifdef SC_LOCK_CHECK
309  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
310 #endif /* SC_LOCK_CHECK */
311  clear_trigger( );
312  e.add_dynamic( this );
313  m_event_p = &e;
315  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
316 }
317 
318 inline
319 void
321 {
322  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
323  sc_kernel_lock lock;
324 
325 #ifdef SC_LOCK_CHECK
326  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
327 #endif /* SC_LOCK_CHECK */
328  clear_trigger( );
329  el.add_dynamic( this );
330  m_event_list_p = &el;
332  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
333 }
334 
335 inline
336 void
338 {
339  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
340  sc_kernel_lock lock;
341 
342 #ifdef SC_LOCK_CHECK
343  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
344 #endif /* SC_LOCK_CHECK */
345  clear_trigger( );
346  el.add_dynamic( this );
347  m_event_list_p = &el;
348  m_event_count = el.size();
350  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
351 }
352 
353 inline
354 void
356 {
357  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
358  sc_kernel_lock lock;
359 
360 #ifdef SC_LOCK_CHECK
361  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
362 #endif /* SC_LOCK_CHECK */
363  clear_trigger( );
364  m_timeout_event_p->notify_internal( t );
365  m_timeout_event_p->add_dynamic( this );
367  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
368 }
369 
370 inline
371 void
373 {
374  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
375  sc_kernel_lock lock;
376 
377 #ifdef SC_LOCK_CHECK
378  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
379 #endif /* SC_LOCK_CHECK */
380  clear_trigger( );
381  m_timeout_event_p->notify_internal( t );
382  m_timeout_event_p->add_dynamic( this );
383  e.add_dynamic( this );
384  m_event_p = &e;
386  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
387 }
388 
389 inline
390 void
392 {
393  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
394  sc_kernel_lock lock;
395 
396 #ifdef SC_LOCK_CHECK
397  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
398 #endif /* SC_LOCK_CHECK */
399  clear_trigger( );
400  m_timeout_event_p->notify_internal( t );
401  m_timeout_event_p->add_dynamic( this );
402  el.add_dynamic( this );
403  m_event_list_p = &el;
405  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
406 }
407 
408 inline
409 void
411 {
412  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
413  sc_kernel_lock lock;
414 
415 #ifdef SC_LOCK_CHECK
416  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
417 #endif /* SC_LOCK_CHECK */
418  clear_trigger( );
419  m_timeout_event_p->notify_internal( t );
420  m_timeout_event_p->add_dynamic( this );
421  el.add_dynamic( this );
422  m_event_list_p = &el;
423  m_event_count = el.size();
425  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
426 }
427 
428 inline
429 void
431 {
432 
433 
434 
435 
436  if( m_unwinding )
437  SC_REPORT_ERROR( SC_ID_WAIT_DURING_UNWINDING_, name() );
438 
439  {
440  // 05/25/2015 GL: sc_kernel_lock constructor acquires the kernel lock
441  sc_kernel_lock lock;
442 
443 #ifdef SC_LOCK_CHECK
444  assert( sc_get_curr_simcontext()->is_locked_and_owner() );
445 #endif /* SC_LOCK_CHECK */
446 
447  // 08/14/2015 GL: set the new segment ID of this thread
448  set_segment_id( -2 );
449 
450  unlock_all_channels(); // 02/16/2015 GL: release all the channel locks
451 
452 
453  //ZC 9:06 2017/3/14
454  // if(getenv(_SYSC_PRINT_VERBOSE_MESSAGE_ENV_VAR))
455  // printf("\n%s is calling wait for nothing\n",this->name());
456 
457 
459  // 05/25/2015 GL: sc_kernel_lock destructor releases the kernel lock
460  }
461 #ifdef SC_LOCK_CHECK
462  assert( sc_get_curr_simcontext()->is_not_owner() );
463 #endif /* SC_LOCK_CHECK */
464  lock_all_channels(); // 02/16/2015 GL: acquire all the channel locks
465 
466 
467 
468 }
469 
470 //------------------------------------------------------------------------------
471 //"sc_method_process::miscellaneous support"
472 //
473 //------------------------------------------------------------------------------
474 inline
476 {
477  m_monitor_q.push_back(monitor_p);
478 }
479 
480 
481 inline
483 {
484  int mon_n = m_monitor_q.size();
485 
486  for ( int mon_i = 0; mon_i < mon_n; mon_i++ )
487  {
488  if ( m_monitor_q[mon_i] == monitor_p )
489  {
490  m_monitor_q[mon_i] = m_monitor_q[mon_n-1];
491  m_monitor_q.resize(mon_n-1);
492  }
493  }
494 }
495 
496 inline
498 {
499  m_exist_p = next_p;
500 }
501 
502 inline
504 {
505  return (sc_method_handle)m_exist_p;
506 }
507 
508 inline
510 {
511  m_runnable_p = next_p;
512 }
513 
514 inline
516 {
518 }
519 
520 //------------------------------------------------------------------------------
521 //"sc_method_process::trigger_static"
522 //
523 // This inline method adds the current thread to the queue of runnable
524 // processes, if required. This is the case if the following criteria
525 // are met:
526 // (1) The process is in a runnable state.
527 // (2) The process is not already on the run queue.
528 // (3) The process is expecting a static trigger,
529 // dynamic event waits take priority.
530 // (4) The process' static wait count is zero.
531 //
532 // If the triggering process is the same process, the trigger is
533 // ignored as well, unless SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS
534 // is defined.
535 //------------------------------------------------------------------------------
536 inline
537 void
538 // 08/14/2015 GL: add a new parameter to update the local time stamp
539 //sc_method_process::trigger_static()
541 {
542  // 05/05/2015 GL: we may or may not have acquired the kernel lock upon here
543  // 1) this function is invoked in sc_simcontext::prepare_to_simulate(),
544  // where the kernel lock is not acquired as it is in the initialization
545  // phase
546  // 2) this function is also invoked in sc_event::notify(), where the kernel
547  // lock is acquired
548 
549  // No need to try queueing this thread if one of the following is true:
550  // (a) its disabled
551  // (b) its already queued for execution
552  // (c) its waiting on a dynamic event
553  // (d) its wait count is not satisfied
554 
555  if ( (m_state & ps_bit_disabled) || is_runnable() ||
557  return;
558 
559 #if ! defined( SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS )
560  if( SC_UNLIKELY_( sc_get_current_process_b() == this ) )
561  {
563  return;
564  }
565 #endif // SC_ENABLE_IMMEDIATE_SELF_NOTIFICATIONS
566 
567  if ( m_wait_cycle_n > 0 )
568  {
569  --m_wait_cycle_n;
570  return;
571  }
572 
573  // If we get here then the thread is has satisfied its wait criteria, if
574  // its suspended mark its state as ready to run. If its not suspended then
575  // push it onto the runnable queue.
576 
577  if ( m_state & ps_bit_suspended )
578  {
580  }
581  else
582  {
583  // 12/22/2016 GL: store the current time before updating
584  sc_time curr_time = m_timestamp.get_time_count();
585 
586  // 08/14/2015 GL: update the local time stamp of this thread process
588  switch( e->m_notify_type )
589  {
590  case sc_event::DELTA: // delta notification
591  if ( ts > m_timestamp ) {
593  ts.get_delta_count() + 1 ) );
594  } else {
597  + 1 ) );
598  }
599  break;
600  case sc_event::TIMED: // timed notification
601  set_timestamp( ts );
602  break;
603  case sc_event::NONE:
604  assert( 0 ); // wrong type
605  }
606 
607  simcontext()->push_runnable_method(this);
608 
609  // 12/22/2016 GL: update m_oldest_time in sc_simcontext if necessary
610  simcontext()->update_oldest_time( curr_time );
611  }
612 }
613 
614 #undef DEBUG_MSG
615 #undef DEBUG_NAME
616 
617 } // namespace sc_core
618 
619 // $Log: sc_method_process.h,v $
620 // Revision 1.30 2011/08/26 20:46:11 acg
621 // Andy Goodrich: moved the modification log to the end of the file to
622 // eliminate source line number skew when check-ins are done.
623 //
624 // Revision 1.29 2011/08/24 23:36:12 acg
625 // Andy Goodrich: removed break statements that can never be reached and
626 // which causes warnings in the Greenhills C++ compiler.
627 //
628 // Revision 1.28 2011/04/14 22:34:27 acg
629 // Andy Goodrich: removed dead code.
630 //
631 // Revision 1.27 2011/04/13 05:02:18 acg
632 // Andy Goodrich: added missing check to the wake up code in suspend_me()
633 // so that we just return if the call to suspend_me() was issued from a
634 // stack unwinding.
635 //
636 // Revision 1.26 2011/04/13 02:44:26 acg
637 // Andy Goodrich: added m_unwinding flag in place of THROW_NOW because the
638 // throw status will be set back to THROW_*_RESET if reset is active and
639 // the check for an unwind being complete was expecting THROW_NONE as the
640 // clearing of THROW_NOW.
641 //
642 // Revision 1.25 2011/04/11 22:05:14 acg
643 // Andy Goodrich: use the DEBUG_NAME macro in DEBUG_MSG invocations.
644 //
645 // Revision 1.24 2011/04/10 22:12:32 acg
646 // Andy Goodrich: adding debugging macros.
647 //
648 // Revision 1.23 2011/04/08 22:41:28 acg
649 // Andy Goodrich: added comment pointing to the description of the reset
650 // mechanism in sc_reset.cpp.
651 //
652 // Revision 1.22 2011/04/08 18:27:33 acg
653 // Andy Goodrich: added check to make sure we don't schedule a running process
654 // because of it issues a notify() it is sensitive to.
655 //
656 // Revision 1.21 2011/04/05 06:22:38 acg
657 // Andy Goodrich: expanded comment for trigger_static() initial vetting.
658 //
659 // Revision 1.20 2011/04/01 21:24:57 acg
660 // Andy Goodrich: removed unused code.
661 //
662 // Revision 1.19 2011/02/19 08:30:53 acg
663 // Andy Goodrich: Moved process queueing into trigger_static from
664 // sc_event::notify.
665 //
666 // Revision 1.18 2011/02/18 20:27:14 acg
667 // Andy Goodrich: Updated Copyrights.
668 //
669 // Revision 1.17 2011/02/17 19:55:58 acg
670 // Andy Goodrich:
671 // (1) Changed signature of trigger_dynamic() back to a bool.
672 // (2) Simplified process control usage.
673 // (3) Changed trigger_static() to recognize process controls and to
674 // do the down-count on wait(N), allowing the elimination of
675 // ready_to_run().
676 //
677 // Revision 1.16 2011/02/16 22:37:31 acg
678 // Andy Goodrich: clean up to remove need for ps_disable_pending.
679 //
680 // Revision 1.15 2011/02/13 21:47:38 acg
681 // Andy Goodrich: update copyright notice.
682 //
683 // Revision 1.14 2011/02/13 21:35:54 acg
684 // Andy Goodrich: added error for performing a wait() during unwinding.
685 //
686 // Revision 1.13 2011/02/11 13:25:24 acg
687 // Andy Goodrich: Philipp A. Hartmann's changes:
688 // (1) Removal of SC_CTHREAD method overloads.
689 // (2) New exception processing code.
690 //
691 // Revision 1.12 2011/02/01 23:01:53 acg
692 // Andy Goodrich: removed dead code.
693 //
694 // Revision 1.11 2011/02/01 21:18:01 acg
695 // Andy Goodrich:
696 // (1) Changes in throw processing for new process control rules.
697 // (2) Support of new process_state enum values.
698 //
699 // Revision 1.10 2011/01/25 20:50:37 acg
700 // Andy Goodrich: changes for IEEE 1666 2011.
701 //
702 // Revision 1.9 2011/01/19 23:21:50 acg
703 // Andy Goodrich: changes for IEEE 1666 2011
704 //
705 // Revision 1.8 2011/01/18 20:10:45 acg
706 // Andy Goodrich: changes for IEEE1666_2011 semantics.
707 //
708 // Revision 1.7 2011/01/06 17:59:58 acg
709 // Andy Goodrich: removed debugging output.
710 //
711 // Revision 1.6 2010/07/22 20:02:33 acg
712 // Andy Goodrich: bug fixes.
713 //
714 // Revision 1.5 2009/07/28 01:10:53 acg
715 // Andy Goodrich: updates for 2.3 release candidate.
716 //
717 // Revision 1.4 2009/05/22 16:06:29 acg
718 // Andy Goodrich: process control updates.
719 //
720 // Revision 1.3 2009/03/12 22:59:58 acg
721 // Andy Goodrich: updates for 2.4 stuff.
722 //
723 // Revision 1.2 2008/05/22 17:06:06 acg
724 // Andy Goodrich: formatting and comments.
725 //
726 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
727 // SystemC 2.3
728 //
729 // Revision 1.7 2006/05/08 17:57:13 acg
730 // Andy Goodrich: Added David Long's forward declarations for friend functions
731 // to keep the Microsoft C++ compiler happy.
732 //
733 // Revision 1.6 2006/04/20 17:08:17 acg
734 // Andy Goodrich: 3.0 style process changes.
735 //
736 // Revision 1.5 2006/04/11 23:13:21 acg
737 // Andy Goodrich: Changes for reduced reset support that only includes
738 // sc_cthread, but has preliminary hooks for expanding to method and thread
739 // processes also.
740 //
741 // Revision 1.4 2006/01/24 20:49:05 acg
742 // Andy Goodrich: changes to remove the use of deprecated features within the
743 // simulator, and to issue warning messages when deprecated features are used.
744 //
745 // Revision 1.3 2006/01/13 18:44:30 acg
746 // Added $Log to record CVS changes into the source.
747 
748 #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:964
A time stamp combining timed cycles and delta cycles.
Definition: sc_process.h:433
const sc_time & get_time_count() const
Get the value of timed cycles.
void oooschedule(sc_cor *cor)
Scheduling function in the OoO simulation.
void deliver_event_at_time(sc_event *e, sc_timestamp e_delivery_time)
sc_descendant_inclusion_info
Definition: sc_process.h:135
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:211
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:921
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
sc_simcontext * simcontext() const
Definition: sc_object.h:85
class sc_method_process * sc_method_handle
Definition: sc_process.h:119
const sc_event * m_event_p
Definition: sc_process.h:895
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:555
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:922
void lock_all_channels(void)
Acquire all the channel locks.
sc_process_b * m_exist_p
Definition: sc_process.h:899
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:941
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:148
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:911
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:1034
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:898