SystemC  2.3.2
Accellera SystemC proof-of-concept library
sc_spawn_options.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_spawn_options.h -- Process spawning options specification.
23 */
36 #if !defined(sc_spawn_options_h_INCLUDED)
37 #define sc_spawn_options_h_INCLUDED
38 
39 #include <vector>
42 
43 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
44 #pragma warning(push)
45 #pragma warning(disable: 4251) // DLL import for std::vector
46 #endif
47 
48 namespace sc_core {
49 
50 class sc_event;
51 class sc_port_base;
52 class sc_interface;
53 class sc_event_finder;
54 class sc_process_b;
55 class sc_spawn_reset_base;
56 
57 
58 //=============================================================================
59 // CLASS sc_spawn_options
60 //
61 //=============================================================================
63  friend class sc_cthread_process;
64  friend class sc_method_process;
65  friend class sc_process_b;
66  friend class sc_thread_process;
67  public:
69  m_dont_initialize(false), m_resets(), m_sensitive_events(),
70  m_sensitive_event_finders(), m_sensitive_interfaces(),
71  m_sensitive_port_bases(), m_spawn_method(false), m_stack_size(0)
72  { }
73 
75 
76  void async_reset_signal_is( const sc_in<bool>&, bool level );
77  void async_reset_signal_is( const sc_inout<bool>&, bool level );
78  void async_reset_signal_is( const sc_out<bool>&, bool level );
79  void async_reset_signal_is( const sc_signal_in_if<bool>&, bool level );
80 
81  void reset_signal_is( const sc_in<bool>&, bool level );
82  void reset_signal_is( const sc_inout<bool>&, bool level );
83  void reset_signal_is( const sc_out<bool>&, bool level );
84  void reset_signal_is( const sc_signal_in_if<bool>&, bool level );
85 
86  void dont_initialize() { m_dont_initialize = true; }
87 
88  bool is_method() const { return m_spawn_method; }
89 
90  void set_stack_size(int stack_size) { m_stack_size = stack_size; }
91 
92  void set_sensitivity(const sc_event* event)
93  { m_sensitive_events.push_back(event); }
94 
95  void set_sensitivity(sc_port_base* port_base)
96  { m_sensitive_port_bases.push_back(port_base); }
97 
98  void set_sensitivity(sc_interface* interface_p)
99  { m_sensitive_interfaces.push_back(interface_p); }
100 
101  void set_sensitivity(sc_export_base* export_base)
102  { m_sensitive_interfaces.push_back(export_base->get_interface()); }
103 
104  void set_sensitivity(sc_event_finder* event_finder)
105  { m_sensitive_event_finders.push_back(event_finder); }
106 
107  void spawn_method() { m_spawn_method = true; }
108 
109  protected:
110  void specify_resets() const;
111 
112  private:
114  const sc_spawn_options& operator = ( const sc_spawn_options& );
115 
116  protected:
118  std::vector<sc_spawn_reset_base*> m_resets;
119  std::vector<const sc_event*> m_sensitive_events;
120  std::vector<sc_event_finder*> m_sensitive_event_finders;
121  std::vector<sc_interface*> m_sensitive_interfaces;
122  std::vector<sc_port_base*> m_sensitive_port_bases;
123  bool m_spawn_method; // Method not thread.
124  int m_stack_size; // Thread stack size.
125 };
126 
127 } // namespace sc_core
128 
129 #if defined(_MSC_VER) && !defined(SC_WIN_DLL_WARN)
130 #pragma warning(pop)
131 #endif
132 
133 // $Log: sc_spawn_options.h,v $
134 // Revision 1.11 2011/08/26 20:46:11 acg
135 // Andy Goodrich: moved the modification log to the end of the file to
136 // eliminate source line number skew when check-ins are done.
137 //
138 // Revision 1.10 2011/08/24 22:05:51 acg
139 // Torsten Maehne: initialization changes to remove warnings.
140 //
141 // Revision 1.9 2011/02/18 20:27:14 acg
142 // Andy Goodrich: Updated Copyrights.
143 //
144 // Revision 1.8 2011/02/13 21:47:38 acg
145 // Andy Goodrich: update copyright notice.
146 //
147 // Revision 1.7 2011/02/07 19:17:20 acg
148 // Andy Goodrich: changes for IEEE 1666 compatibility.
149 //
150 // Revision 1.6 2010/12/07 20:09:15 acg
151 // Andy Goodrich: replaced sc_signal signatures with sc_signal_in_if signatures for reset methods.
152 //
153 // Revision 1.5 2010/11/20 17:10:57 acg
154 // Andy Goodrich: reset processing changes for new IEEE 1666 standard.
155 //
156 // Revision 1.4 2009/05/22 16:06:29 acg
157 // Andy Goodrich: process control updates.
158 //
159 // Revision 1.3 2009/02/28 00:26:58 acg
160 // Andy Goodrich: changed boost name space to sc_boost to allow use with
161 // full boost library applications.
162 //
163 // Revision 1.2 2008/05/22 17:06:26 acg
164 // Andy Goodrich: updated copyright notice to include 2008.
165 //
166 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
167 // SystemC 2.3
168 //
169 // Revision 1.4 2006/04/20 17:08:17 acg
170 // Andy Goodrich: 3.0 style process changes.
171 //
172 // Revision 1.3 2006/01/13 18:44:30 acg
173 // Added $Log to record CVS changes into the source.
174 
175 #endif // !defined(sc_spawn_options_h_INCLUDED)
std::vector< sc_port_base * > m_sensitive_port_bases
Specialization of sc_signal_in_if<T> for type bool.
operand is not sc_logic object already exists internal maximum number of processes per module module construction not properly hierarchical name as shown may be incorrect due to previous errors incorrect use of sc_module_name set time resolution failed default time unit changed to time resolution immediate notification is not allowed during update phase or elaboration use reset_signal_is()" ) SC_DEFINE_MESSAGE(SC_ID_DONT_INITIALIZE_
Specialization of sc_inout<T> for type bool.
void set_sensitivity(sc_export_base *export_base)
virtual sc_interface * get_interface()=0
Event finder base class.
Abstract base class for class sc_port_b.
Definition: sc_port.h:81
The event class.
Definition: sc_event.h:256
std::vector< sc_event_finder * > m_sensitive_event_finders
void set_stack_size(int stack_size)
class SC_API sc_event
Definition: sc_interface.h:40
Abstract base class of all interface classes.
Definition: sc_interface.h:51
std::vector< sc_interface * > m_sensitive_interfaces
Base classes of all export classes.
Specialization of sc_in<T> for type bool.
class SC_API sc_port_base
Definition: sc_interface.h:41
std::vector< const sc_event * > m_sensitive_events
void set_sensitivity(sc_event_finder *event_finder)
The sc_signal<T> port classes.
void set_sensitivity(sc_interface *interface_p)
void set_sensitivity(const sc_event *event)
sc_process_b sc_process_b
Definition: sc_process.h:458
std::vector< sc_spawn_reset_base * > m_resets
void set_sensitivity(sc_port_base *port_base)
#define SC_API
Definition: sc_cmnhdr.h:168