Deleted Added
sdiff udiff text old ( 13054:bce8a8124325 ) new ( 13245:c666c5d4996b )
full compact
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 20 unchanged lines hidden (view full) ---

29
30#ifndef __SYSTEMC_EXT_CHANNEL_SC_IN_HH__
31#define __SYSTEMC_EXT_CHANNEL_SC_IN_HH__
32
33#include <string>
34
35#include "../core/sc_event.hh"
36#include "../core/sc_port.hh"
37#include "sc_signal_in_if.hh"
38#include "sc_signal_inout_if.hh"
39#include "warn_unimpl.hh"
40
41namespace sc_core
42{
43
44class sc_event;
45class sc_trace_file;
46
47template <class T>

--- 59 unchanged lines hidden (view full) ---

107 sc_port_base::bind(p);
108 }
109 void
110 operator () (sc_port<sc_signal_inout_if<T>, 1> &p)
111 {
112 bind(p);
113 }
114
115 virtual void end_of_elaboration() { /* Implementation defined. */ }
116
117 const T &read() const { return (*this)->read(); }
118 operator const T& () const { return (*this)->read(); }
119
120 const sc_event &default_event() const { return (*this)->default_event(); }
121 const sc_event &
122 value_changed_event() const
123 {
124 return (*this)->value_changed_event();
125 }
126 bool event() const { return (*this)->event(); }
127 sc_event_finder &value_changed() const { return _valueChangedFinder; }
128
129 virtual const char *kind() const { return "sc_in"; }
130
131 private:
132 mutable sc_event_finder_t<sc_signal_in_if<T> > _valueChangedFinder;
133
134 // Disabled
135 sc_in(const sc_in<T> &);
136 sc_in<T> &operator = (const sc_in<T> &);
137};
138
139template <class T>
140inline void
141sc_trace(sc_trace_file *, const sc_in<T> &, const std::string &)
142{
143 sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
144}
145
146template <>
147class sc_in<bool> : public sc_port<sc_signal_in_if<bool>, 1>
148{
149 public:
150 sc_in() : sc_port<sc_signal_in_if<bool>, 1>(),
151 _valueChangedFinder(*this,

--- 79 unchanged lines hidden (view full) ---

231 sc_port_base::bind(p);
232 }
233 void
234 operator () (sc_port<sc_signal_inout_if<bool>, 1> &p)
235 {
236 bind(p);
237 }
238
239 virtual void end_of_elaboration() { /* Implementation defined. */ }
240
241 const bool &read() const { return (*this)->read(); }
242 operator const bool& () const { return (*this)->read(); }
243
244 const sc_event &default_event() const { return (*this)->default_event(); }
245 const sc_event &
246 value_changed_event() const
247 {
248 return (*this)->value_changed_event();

--- 14 unchanged lines hidden (view full) ---

263 bool negedge() const { return (*this)->negedge(); }
264
265 sc_event_finder &value_changed() const { return _valueChangedFinder; }
266 sc_event_finder &pos() const { return _posFinder; }
267 sc_event_finder &neg() const { return _negFinder; }
268
269 virtual const char *kind() const { return "sc_in"; }
270
271 private:
272 mutable sc_event_finder_t<sc_signal_in_if<bool> > _valueChangedFinder;
273 mutable sc_event_finder_t<sc_signal_in_if<bool> > _posFinder;
274 mutable sc_event_finder_t<sc_signal_in_if<bool> > _negFinder;
275
276 // Disabled
277 sc_in(const sc_in<bool> &);
278 sc_in<bool> &operator = (const sc_in<bool> &);
279};
280
281template <>
282inline void
283sc_trace<bool>(sc_trace_file *, const sc_in<bool> &, const std::string &)
284{
285 sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
286}
287
288template <>
289class sc_in<sc_dt::sc_logic> :
290 public sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>
291{
292 public:
293 sc_in() : sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(),

--- 84 unchanged lines hidden (view full) ---

378 sc_port_base::bind(p);
379 }
380 void
381 operator () (sc_port<sc_signal_inout_if<sc_dt::sc_logic>, 1> &p)
382 {
383 bind(p);
384 }
385
386 virtual void end_of_elaboration() { /* Implementation defined. */ }
387
388 const sc_dt::sc_logic &read() const { return (*this)->read(); }
389 operator const sc_dt::sc_logic& () const { return (*this)->read(); }
390
391 const sc_event &default_event() const { return (*this)->default_event(); }
392 const sc_event &
393 value_changed_event() const
394 {
395 return (*this)->value_changed_event();

--- 6 unchanged lines hidden (view full) ---

402 bool negedge() const { return (*this)->negedge(); }
403
404 sc_event_finder &value_changed() const { return _valueChangedFinder; }
405 sc_event_finder &pos() const { return _posFinder; }
406 sc_event_finder &neg() const { return _negFinder; }
407
408 virtual const char *kind() const { return "sc_in"; }
409
410 private:
411 mutable sc_event_finder_t<sc_signal_in_if<sc_dt::sc_logic> >
412 _valueChangedFinder;
413 mutable sc_event_finder_t<sc_signal_in_if<sc_dt::sc_logic> > _posFinder;
414 mutable sc_event_finder_t<sc_signal_in_if<sc_dt::sc_logic> > _negFinder;
415
416 // Disabled
417 sc_in(const sc_in<sc_dt::sc_logic> &);
418 sc_in<sc_dt::sc_logic> &operator = (const sc_in<sc_dt::sc_logic> &);
419};
420
421template <>
422inline void
423sc_trace(
424 sc_trace_file *, const sc_in<sc_dt::sc_logic> &, const std::string &)
425{
426 sc_channel_warn_unimpl(__PRETTY_FUNCTION__);
427}
428
429} // namespace sc_core
430
431#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_HH__