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