diff --git a/src/systemc/ext/channel/sc_in.hh b/src/systemc/ext/channel/sc_in.hh index a76840161e..3fea8a8034 100644 --- a/src/systemc/ext/channel/sc_in.hh +++ b/src/systemc/ext/channel/sc_in.hh @@ -33,6 +33,7 @@ #include #include "../core/sc_event.hh" +#include "../core/sc_main.hh" #include "../core/sc_port.hh" #include "../utils/sc_trace_file.hh" #include "sc_signal_in_if.hh" @@ -155,10 +156,10 @@ template inline void sc_trace(sc_trace_file *tf, const sc_in &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } template <> @@ -316,10 +317,10 @@ inline void sc_trace(sc_trace_file *tf, const sc_in &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } template <> @@ -475,10 +476,10 @@ inline void sc_trace(sc_trace_file *tf, const sc_in &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } } // namespace sc_core diff --git a/src/systemc/ext/channel/sc_inout.hh b/src/systemc/ext/channel/sc_inout.hh index 7f19443d5e..2973a5414f 100644 --- a/src/systemc/ext/channel/sc_inout.hh +++ b/src/systemc/ext/channel/sc_inout.hh @@ -33,6 +33,7 @@ #include #include "../core/sc_event.hh" +#include "../core/sc_main.hh" #include "../core/sc_port.hh" #include "../dt/bit/sc_logic.hh" #include "../utils/sc_trace_file.hh" @@ -184,10 +185,10 @@ template inline void sc_trace(sc_trace_file *tf, const sc_inout &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } template <> @@ -357,10 +358,10 @@ template <> inline void sc_trace( sc_trace_file *tf, const sc_inout &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } template <> @@ -549,10 +550,10 @@ inline void sc_trace(sc_trace_file *tf, const sc_inout &i, const std::string &name) { - if (i.size()) - sc_trace(tf, i->read(), name); - else + if (::sc_core::sc_get_status() < ::sc_core::SC_START_OF_SIMULATION) i.add_trace(tf, name); + else + sc_trace(tf, i->read(), name); } } // namespace sc_core