summaryrefslogtreecommitdiff
path: root/src/systemc/ext/channel/sc_in.hh
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-30 22:40:28 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:40:46 +0000
commite5a994140a1f0fcd08ba6ddad7d11d6daa3d07a0 (patch)
tree68a5f2ec0b8831ca1dd63e697cce2ed551999d55 /src/systemc/ext/channel/sc_in.hh
parent163eb3c56b115e649c72fceff89c8370b6e7306f (diff)
downloadgem5-e5a994140a1f0fcd08ba6ddad7d11d6daa3d07a0.tar.xz
systemc: Use the stage of simulation and not port size in add_trace.
The assumption was that a port wouldn't have any interfaces until after elaboration, and that if it would be traced, it would have interfaces. Checking if the simulation has started (and hence elaboration has finished) is a more accurate and direct way to check the same thing. Change-Id: I7fe9ecea469997d1a257dd3e4a0db31889aff722 Reviewed-on: https://gem5-review.googlesource.com/c/13195 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/channel/sc_in.hh')
-rw-r--r--src/systemc/ext/channel/sc_in.hh19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/systemc/ext/channel/sc_in.hh b/src/systemc/ext/channel/sc_in.hh
index a76840161..3fea8a803 100644
--- a/src/systemc/ext/channel/sc_in.hh
+++ b/src/systemc/ext/channel/sc_in.hh
@@ -33,6 +33,7 @@
#include <string>
#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 <class T>
inline void
sc_trace(sc_trace_file *tf, const sc_in<T> &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<bool>(sc_trace_file *tf, const sc_in<bool> &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_dt::sc_logic>(sc_trace_file *tf, const sc_in<sc_dt::sc_logic> &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