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