SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_cthread_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_cthread_process.h -- Clocked thread 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_cthread_process_h_INCLUDED)
30 #define sc_cthread_process_h_INCLUDED
31 
33 
34 namespace sc_core {
35 
36 // friend function declarations:
37 
38 void halt( sc_simcontext* );
39 void wait( int, sc_simcontext* );
40 
41 
42 //==============================================================================
43 // sc_cthread_process -
44 //
45 //==============================================================================
47 
48  friend class sc_module;
49  friend class sc_process_handle;
50  friend class sc_process_table;
51  friend class sc_thread_process;
52  friend class sc_simcontext;
53 
54  friend void sc_cthread_cor_fn( void* );
55 
56  friend void halt( sc_simcontext* );
57  friend void wait( int, sc_simcontext* );
58 
59  public:
60  sc_cthread_process( const char* name_p, bool free_host,
61  SC_ENTRY_FUNC method_p, sc_process_host* host_p,
62  const sc_spawn_options* opt_p );
63 
64  virtual void dont_initialize( bool dont );
65  virtual const char* kind() const
66  { return "sc_cthread_process"; }
67 
68 private:
69 
70  sc_cthread_process( const char* nm,
71  SC_ENTRY_FUNC fn,
72  sc_process_host* host );
73 
74  // may not be deleted manually (called from sc_process_b)
75  virtual ~sc_cthread_process();
76 
77  bool eval_watchlist();
78  bool eval_watchlist_curr_level();
79 
80  void wait_halt();
81 
82 };
83 
84 //------------------------------------------------------------------------------
85 //"sc_cthread_process::wait_halt"
86 //
87 //------------------------------------------------------------------------------
88 inline void sc_cthread_process::wait_halt()
89 {
90  m_wait_cycle_n = 0;
91  suspend_me();
92  throw sc_halt();
93 }
94 
95 } // namespace sc_core
96 
97 // $Log: sc_cthread_process.h,v $
98 // Revision 1.8 2011/08/26 20:46:09 acg
99 // Andy Goodrich: moved the modification log to the end of the file to
100 // eliminate source line number skew when check-ins are done.
101 //
102 // Revision 1.7 2011/02/18 20:27:14 acg
103 // Andy Goodrich: Updated Copyrights.
104 //
105 // Revision 1.6 2011/02/13 21:47:37 acg
106 // Andy Goodrich: update copyright notice.
107 //
108 // Revision 1.5 2011/02/11 13:25:24 acg
109 // Andy Goodrich: Philipp A. Hartmann's changes:
110 // (1) Removal of SC_CTHREAD method overloads.
111 // (2) New exception processing code.
112 //
113 // Revision 1.4 2011/02/01 21:01:41 acg
114 // Andy Goodrich: removed throw_reset() as it is now handled by the parent
115 // method sc_thread_process::throw_reset().
116 //
117 // Revision 1.3 2011/01/18 20:10:44 acg
118 // Andy Goodrich: changes for IEEE1666_2011 semantics.
119 //
120 // Revision 1.2 2008/05/22 17:06:25 acg
121 // Andy Goodrich: updated copyright notice to include 2008.
122 //
123 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
124 // SystemC 2.3
125 //
126 // Revision 1.6 2006/05/08 17:57:13 acg
127 // Andy Goodrich: Added David Long's forward declarations for friend functions
128 // to keep the Microsoft C++ compiler happy.
129 //
130 // Revision 1.5 2006/04/20 17:08:16 acg
131 // Andy Goodrich: 3.0 style process changes.
132 //
133 // Revision 1.4 2006/04/11 23:13:20 acg
134 // Andy Goodrich: Changes for reduced reset support that only includes
135 // sc_cthread, but has preliminary hooks for expanding to method and thread
136 // processes also.
137 //
138 // Revision 1.3 2006/01/13 18:44:29 acg
139 // Added $Log to record CVS changes into the source.
140 //
141 
142 #endif // !defined(sc_cthread_process_h_INCLUDED)
void wait(int, sc_simcontext *)
void halt(sc_simcontext *)
void(sc_process_host::* SC_ENTRY_FUNC)()
Definition: sc_process.h:142
friend void sc_cthread_cor_fn(void *)
sc_cthread_process(const char *name_p, bool free_host, SC_ENTRY_FUNC method_p, sc_process_host *host_p, const sc_spawn_options *opt_p)
friend void halt(sc_simcontext *)
friend void wait(int, sc_simcontext *)
virtual const char * kind() const
bool dont_initialize() const
Definition: sc_process.h:337