SystemC  2.3.1
Accellera SystemC proof-of-concept library
sc_signal_resolved_ports.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_signal_resolved_ports.h -- The sc_signal_resolved port classes.
21 
22  Original Author: Martin Janssen, Synopsys, Inc., 2001-08-20
23 
24  CHANGE LOG IS AT THE END OF THE FILE
25  *****************************************************************************/
26 
27 #ifndef SC_SIGNAL_RESOLVED_PORTS_H
28 #define SC_SIGNAL_RESOLVED_PORTS_H
29 
30 
33 
34 namespace sc_core {
35 
36 // ----------------------------------------------------------------------------
37 // CLASS : sc_in_resolved
38 //
39 // The sc_signal_resolved input port class.
40 // ----------------------------------------------------------------------------
41 
43  : public sc_in<sc_dt::sc_logic>
44 {
45 public:
46 
47  // typedefs
48 
50 
53 
57 
58 public:
59 
60  // constructors
61 
63  : base_type()
64  {}
65 
66  explicit sc_in_resolved( const char* name_ )
67  : base_type( name_ )
68  {}
69 
70  explicit sc_in_resolved( const in_if_type& interface_ )
71  : base_type( interface_ )
72  {}
73 
74  sc_in_resolved( const char* name_, const in_if_type& interface_ )
75  : base_type( name_, interface_ )
76  {}
77 
78  explicit sc_in_resolved( in_port_type& parent_ )
79  : base_type( parent_ )
80  {}
81 
82  sc_in_resolved( const char* name_, in_port_type& parent_ )
83  : base_type( name_, parent_ )
84  {}
85 
86  explicit sc_in_resolved( inout_port_type& parent_ )
87  : base_type( parent_ )
88  {}
89 
90  sc_in_resolved( const char* name_, inout_port_type& parent_ )
91  : base_type( name_, parent_ )
92  {}
93 
95  : base_type( parent_ )
96  {}
97 
98  sc_in_resolved( const char* name_, this_type& parent_ )
99  : base_type( name_, parent_ )
100  {}
101 
102 
103  // destructor (does nothing)
104 
105  virtual ~sc_in_resolved()
106  {}
107 
108 
109  // called when elaboration is done
110  /* WHEN DEFINING THIS METHOD IN A DERIVED CLASS, */
111  /* MAKE SURE THAT THIS METHOD IS CALLED AS WELL. */
112 
113  virtual void end_of_elaboration();
114 
115  virtual const char* kind() const
116  { return "sc_in_resolved"; }
117 
118 private:
119 
120  // disabled
121  sc_in_resolved( const this_type& );
122  this_type& operator = ( const this_type& );
123 };
124 
125 
126 // ----------------------------------------------------------------------------
127 // CLASS : sc_inout_resolved
128 //
129 // The sc_signal_resolved input/output port class.
130 // ----------------------------------------------------------------------------
131 
133  : public sc_inout<sc_dt::sc_logic>
134 {
135 public:
136 
137  // typedefs
138 
140 
143 
148 
149 public:
150 
151  // constructors
152 
154  : base_type()
155  {}
156 
157  explicit sc_inout_resolved( const char* name_ )
158  : base_type( name_ )
159  {}
160 
161  explicit sc_inout_resolved( inout_if_type& interface_ )
162  : base_type( interface_ )
163  {}
164 
165  sc_inout_resolved( const char* name_, inout_if_type& interface_ )
166  : base_type( name_, interface_ )
167  {}
168 
169  explicit sc_inout_resolved( inout_port_type& parent_ )
170  : base_type( parent_ )
171  {}
172 
173  sc_inout_resolved( const char* name_, inout_port_type& parent_ )
174  : base_type( name_, parent_ )
175  {}
176 
178  : base_type( parent_ )
179  {}
180 
181  sc_inout_resolved( const char* name_, this_type& parent_ )
182  : base_type( name_, parent_ )
183  {}
184 
185 
186  // destructor (does nothing)
187 
189  {}
190 
191 
192  // write the new value
193 
194  this_type& operator = ( const data_type& value_ )
195  { (*this)->write( value_ ); return *this; }
196 
197  this_type& operator = ( const in_if_type& interface_ )
198  { (*this)->write( interface_.read() ); return *this; }
199 
201  { (*this)->write( port_->read() ); return *this; }
202 
204  { (*this)->write( port_->read() ); return *this; }
205 
206  this_type& operator = ( const this_type& port_ )
207  { (*this)->write( port_->read() ); return *this; }
208 
209 
210  // called when elaboration is done
211  /* WHEN DEFINING THIS METHOD IN A DERIVED CLASS, */
212  /* MAKE SURE THAT THIS METHOD IS CALLED AS WELL. */
213 
214  virtual void end_of_elaboration();
215 
216  virtual const char* kind() const
217  { return "sc_inout_resolved"; }
218 
219 private:
220 
221  // disabled
222  sc_inout_resolved( const this_type& );
223 };
224 
225 
226 // ----------------------------------------------------------------------------
227 // CLASS : sc_out_resolved
228 //
229 // The sc_signal_resolved output port class.
230 // ----------------------------------------------------------------------------
231 
232 // sc_out_resolved can also read from its port, hence no difference with
233 // sc_inout_resolved. For debugging reasons, a class is provided instead
234 // of a typedef.
235 
237  : public sc_inout_resolved
238 {
239 public:
240 
241  // typedefs
242 
245 
247 
252 
253 public:
254 
255  // constructors
256 
258  : base_type()
259  {}
260 
261  explicit sc_out_resolved( const char* name_ )
262  : base_type( name_ )
263  {}
264 
265  explicit sc_out_resolved( inout_if_type& interface_ )
266  : base_type( interface_ )
267  {}
268 
269  sc_out_resolved( const char* name_, inout_if_type& interface_ )
270  : base_type( name_, interface_ )
271  {}
272 
273  explicit sc_out_resolved( inout_port_type& parent_ )
274  : base_type( parent_ )
275  {}
276 
277  sc_out_resolved( const char* name_, inout_port_type& parent_ )
278  : base_type( name_, parent_ )
279  {}
280 
282  : base_type( parent_ )
283  {}
284 
285  sc_out_resolved( const char* name_, this_type& parent_ )
286  : base_type( name_, parent_ )
287  {}
288 
289 
290  // destructor (does nothing)
291 
293  {}
294 
295 
296  // write the new value
297 
298  this_type& operator = ( const data_type& value_ )
299  { (*this)->write( value_ ); return *this; }
300 
301  this_type& operator = ( const in_if_type& interface_ )
302  { (*this)->write( interface_.read() ); return *this; }
303 
305  { (*this)->write( port_->read() ); return *this; }
306 
308  { (*this)->write( port_->read() ); return *this; }
309 
310  this_type& operator = ( const this_type& port_ )
311  { (*this)->write( port_->read() ); return *this; }
312 
313  virtual const char* kind() const
314  { return "sc_out_resolved"; }
315 
316 private:
317 
318  // disabled
319  sc_out_resolved( const this_type& );
320 };
321 
322 } // namespace sc_core
323 
324 //$Log: sc_signal_resolved_ports.h,v $
325 //Revision 1.3 2011/08/26 20:45:44 acg
326 // Andy Goodrich: moved the modification log to the end of the file to
327 // eliminate source line number skew when check-ins are done.
328 //
329 //Revision 1.2 2011/02/18 20:23:45 acg
330 // Andy Goodrich: Copyright update.
331 //
332 //Revision 1.1.1.1 2006/12/15 20:20:04 acg
333 //SystemC 2.3
334 //
335 //Revision 1.2 2006/01/03 23:18:26 acg
336 //Changed copyright to include 2006.
337 //
338 //Revision 1.1.1.1 2005/12/19 23:16:43 acg
339 //First check in of SystemC 2.1 into its own archive.
340 //
341 //Revision 1.9 2005/06/10 22:43:55 acg
342 //Added CVS change log annotation.
343 //
344 
345 #endif
346 
347 // Taf!
virtual const char * kind() const
sc_inout_resolved(const char *name_, this_type &parent_)
base_type::inout_port_type inout_port_type
sc_port< in_if_type, 1, SC_ONE_OR_MORE_BOUND > in_port_type
sc_out_resolved(const char *name_, inout_port_type &parent_)
sc_out_resolved(const char *name_, this_type &parent_)
virtual void end_of_elaboration()
sc_in_resolved(this_type &parent_)
sc_out_resolved(inout_if_type &interface_)
virtual const char * kind() const
base_type::inout_port_type inout_port_type
virtual void end_of_elaboration()
base_type::in_if_type in_if_type
base_type::inout_port_type inout_port_type
base_type::in_if_type in_if_type
this_type & operator=(const data_type &value_)
base_type::in_port_type in_port_type
sc_in_resolved(const char *name_, const in_if_type &interface_)
sc_in_resolved(const in_if_type &interface_)
sc_inout_resolved(inout_if_type &interface_)
base_type::in_port_type in_port_type
sc_in_resolved(inout_port_type &parent_)
sc_signal_in_if< data_type > in_if_type
virtual const T & read() const =0
this_type & operator=(const data_type &value_)
base_type::in_port_type in_port_type
sc_in_resolved(const char *name_, this_type &parent_)
base_type::inout_if_type inout_if_type
sc_port< inout_if_type, 1, SC_ONE_OR_MORE_BOUND > inout_port_type
sc_inout_resolved(const char *name_, inout_port_type &parent_)
sc_inout_resolved(inout_port_type &parent_)
sc_out_resolved(inout_port_type &parent_)
base_type in_port_type
virtual const char * kind() const
base_type inout_port_type
void write(const data_type &value_)
sc_in_resolved(const char *name_, in_port_type &parent_)
sc_in_resolved(in_port_type &parent_)
sc_inout_resolved(const char *name_, inout_if_type &interface_)
sc_in_resolved(const char *name_, inout_port_type &parent_)
sc_out_resolved(const char *name_, inout_if_type &interface_)
base_type::inout_if_type inout_if_type