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

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

28 */
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_main.hh"
37#include "../core/sc_port.hh"
38#include "../utils/sc_trace_file.hh"
39#include "sc_signal_in_if.hh"
40#include "sc_signal_inout_if.hh"
41
42namespace sc_core
43{
44

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

151 sc_in(const sc_in<T> &);
152 sc_in<T> &operator = (const sc_in<T> &);
153};
154
155template <class T>
156inline void
157sc_trace(sc_trace_file *tf, const sc_in<T> &i, const std::string &name)
158{
158 if (i.size())
159 sc_trace(tf, i->read(), name);
160 else
159 if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION)
160 i.add_trace(tf, name);
161 else
162 sc_trace(tf, i->read(), name);
163}
164
165template <>
166class sc_in<bool> : public sc_port<sc_signal_in_if<bool>, 1>
167{
168 public:
169 sc_in() : sc_port<sc_signal_in_if<bool>, 1>(),
170 _valueChangedFinder(*this,

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

312 sc_in<bool> &operator = (const sc_in<bool> &);
313};
314
315template <>
316inline void
317sc_trace<bool>(sc_trace_file *tf, const sc_in<bool> &i,
318 const std::string &name)
319{
319 if (i.size())
320 sc_trace(tf, i->read(), name);
321 else
320 if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION)
321 i.add_trace(tf, name);
322 else
323 sc_trace(tf, i->read(), name);
324}
325
326template <>
327class sc_in<sc_dt::sc_logic> :
328 public sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>
329{
330 public:
331 sc_in() : sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(),

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

471 sc_in<sc_dt::sc_logic> &operator = (const sc_in<sc_dt::sc_logic> &);
472};
473
474template <>
475inline void
476sc_trace<sc_dt::sc_logic>(sc_trace_file *tf, const sc_in<sc_dt::sc_logic> &i,
477 const std::string &name)
478{
478 if (i.size())
479 sc_trace(tf, i->read(), name);
480 else
479 if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION)
480 i.add_trace(tf, name);
481 else
482 sc_trace(tf, i->read(), name);
483}
484
485} // namespace sc_core
486
487#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_HH__