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