sc_in.hh (13245:c666c5d4996b) | sc_in.hh (13269:8807a4b970d4) |
---|---|
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" | 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" |
|
36#include "../core/sc_port.hh" 37#include "../utils/sc_trace_file.hh" 38#include "sc_signal_in_if.hh" 39#include "sc_signal_inout_if.hh" 40 41namespace sc_core 42{ 43 --- 106 unchanged lines hidden (view full) --- 150 sc_in(const sc_in<T> &); 151 sc_in<T> &operator = (const sc_in<T> &); 152}; 153 154template <class T> 155inline void 156sc_trace(sc_trace_file *tf, const sc_in<T> &i, const std::string &name) 157{ | 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) |
161 i.add_trace(tf, name); | 160 i.add_trace(tf, name); |
161 else 162 sc_trace(tf, i->read(), name); |
|
162} 163 164template <> 165class sc_in<bool> : public sc_port<sc_signal_in_if<bool>, 1> 166{ 167 public: 168 sc_in() : sc_port<sc_signal_in_if<bool>, 1>(), 169 _valueChangedFinder(*this, --- 141 unchanged lines hidden (view full) --- 311 sc_in<bool> &operator = (const sc_in<bool> &); 312}; 313 314template <> 315inline void 316sc_trace<bool>(sc_trace_file *tf, const sc_in<bool> &i, 317 const std::string &name) 318{ | 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) |
322 i.add_trace(tf, name); | 321 i.add_trace(tf, name); |
322 else 323 sc_trace(tf, i->read(), name); |
|
323} 324 325template <> 326class sc_in<sc_dt::sc_logic> : 327 public sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1> 328{ 329 public: 330 sc_in() : sc_port<sc_signal_in_if<sc_dt::sc_logic>, 1>(), --- 139 unchanged lines hidden (view full) --- 470 sc_in<sc_dt::sc_logic> &operator = (const sc_in<sc_dt::sc_logic> &); 471}; 472 473template <> 474inline void 475sc_trace<sc_dt::sc_logic>(sc_trace_file *tf, const sc_in<sc_dt::sc_logic> &i, 476 const std::string &name) 477{ | 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) |
481 i.add_trace(tf, name); | 480 i.add_trace(tf, name); |
481 else 482 sc_trace(tf, i->read(), name); |
|
482} 483 484} // namespace sc_core 485 486#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_HH__ | 483} 484 485} // namespace sc_core 486 487#endif //__SYSTEMC_EXT_CHANNEL_SC_IN_HH__ |