SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_spawn_options.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_spawn_options.h -- Process spawning options specification.
21 
22  Original Authors: Andy Goodrich, Forte Design Systems, 17 June 2003
23  Stuart Swan, Cadence,
24  Bishnupriya Bhattacharya, Cadence Design Systems,
25  25 August, 2003
26 
27  CHANGE LOG AT THE END OF THE FILE
28  *****************************************************************************/
29 
30 #if !defined(sc_spawn_options_h_INCLUDED)
31 #define sc_spawn_options_h_INCLUDED
32 
33 #include <vector>
36 
37 namespace sc_core {
38 
39 class sc_event;
40 class sc_port_base;
41 class sc_interface;
42 class sc_event_finder;
43 class sc_process_b;
44 class sc_spawn_reset_base;
45 
46 //=============================================================================
47 // CLASS sc_spawn_options
48 //
49 //=============================================================================
51  friend class sc_cthread_process;
52  friend class sc_method_process;
53  friend class sc_process_b;
54  friend class sc_thread_process;
55  public:
60  { }
61 
63 
64  void async_reset_signal_is( const sc_in<bool>&, bool level );
65  void async_reset_signal_is( const sc_inout<bool>&, bool level );
66  void async_reset_signal_is( const sc_out<bool>&, bool level );
67  void async_reset_signal_is( const sc_signal_in_if<bool>&, bool level );
68 
69  void reset_signal_is( const sc_in<bool>&, bool level );
70  void reset_signal_is( const sc_inout<bool>&, bool level );
71  void reset_signal_is( const sc_out<bool>&, bool level );
72  void reset_signal_is( const sc_signal_in_if<bool>&, bool level );
73 
75 
76  bool is_method() const { return m_spawn_method; }
77 
78  void set_stack_size(int stack_size) { m_stack_size = stack_size; }
79 
80  void set_sensitivity(const sc_event* event)
81  { m_sensitive_events.push_back(event); }
82 
83  void set_sensitivity(sc_port_base* port_base)
84  { m_sensitive_port_bases.push_back(port_base); }
85 
86  void set_sensitivity(sc_interface* interface_p)
87  { m_sensitive_interfaces.push_back(interface_p); }
88 
89  void set_sensitivity(sc_export_base* export_base)
90  { m_sensitive_interfaces.push_back(export_base->get_interface()); }
91 
92  void set_sensitivity(sc_event_finder* event_finder)
93  { m_sensitive_event_finders.push_back(event_finder); }
94 
95  void spawn_method() { m_spawn_method = true; }
96 
97  protected:
98  void specify_resets() const;
99 
100  private:
102  const sc_spawn_options& operator = ( const sc_spawn_options& );
103 
104  protected:
106  std::vector<sc_spawn_reset_base*> m_resets;
107  std::vector<const sc_event*> m_sensitive_events;
108  std::vector<sc_event_finder*> m_sensitive_event_finders;
109  std::vector<sc_interface*> m_sensitive_interfaces;
110  std::vector<sc_port_base*> m_sensitive_port_bases;
111  bool m_spawn_method; // Method not thread.
112  int m_stack_size; // Thread stack size.
113 };
114 
115 } // namespace sc_core
116 
117 // $Log: sc_spawn_options.h,v $
118 // Revision 1.11 2011/08/26 20:46:11 acg
119 // Andy Goodrich: moved the modification log to the end of the file to
120 // eliminate source line number skew when check-ins are done.
121 //
122 // Revision 1.10 2011/08/24 22:05:51 acg
123 // Torsten Maehne: initialization changes to remove warnings.
124 //
125 // Revision 1.9 2011/02/18 20:27:14 acg
126 // Andy Goodrich: Updated Copyrights.
127 //
128 // Revision 1.8 2011/02/13 21:47:38 acg
129 // Andy Goodrich: update copyright notice.
130 //
131 // Revision 1.7 2011/02/07 19:17:20 acg
132 // Andy Goodrich: changes for IEEE 1666 compatibility.
133 //
134 // Revision 1.6 2010/12/07 20:09:15 acg
135 // Andy Goodrich: replaced sc_signal signatures with sc_signal_in_if signatures for reset methods.
136 //
137 // Revision 1.5 2010/11/20 17:10:57 acg
138 // Andy Goodrich: reset processing changes for new IEEE 1666 standard.
139 //
140 // Revision 1.4 2009/05/22 16:06:29 acg
141 // Andy Goodrich: process control updates.
142 //
143 // Revision 1.3 2009/02/28 00:26:58 acg
144 // Andy Goodrich: changed boost name space to sc_boost to allow use with
145 // full boost library applications.
146 //
147 // Revision 1.2 2008/05/22 17:06:26 acg
148 // Andy Goodrich: updated copyright notice to include 2008.
149 //
150 // Revision 1.1.1.1 2006/12/15 20:20:05 acg
151 // SystemC 2.3
152 //
153 // Revision 1.4 2006/04/20 17:08:17 acg
154 // Andy Goodrich: 3.0 style process changes.
155 //
156 // Revision 1.3 2006/01/13 18:44:30 acg
157 // Added $Log to record CVS changes into the source.
158 
159 #endif // !defined(sc_spawn_options_h_INCLUDED)
void specify_resets() const
void set_sensitivity(const sc_event *event)
void set_stack_size(int stack_size)
std::vector< sc_event_finder * > m_sensitive_event_finders
sc_process_b sc_process_b
Definition: sc_process.h:447
virtual sc_interface * get_interface()=0
void set_sensitivity(sc_event_finder *event_finder)
void set_sensitivity(sc_export_base *export_base)
void set_sensitivity(sc_interface *interface_p)
std::vector< const sc_event * > m_sensitive_events
void reset_signal_is(const sc_in< bool > &, bool level)
std::vector< sc_interface * > m_sensitive_interfaces
std::vector< sc_port_base * > m_sensitive_port_bases
void set_sensitivity(sc_port_base *port_base)
std::vector< sc_spawn_reset_base * > m_resets
void async_reset_signal_is(const sc_in< bool > &, bool level)