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