From: Gabe Black Date: Wed, 19 Sep 2018 23:18:16 +0000 (-0700) Subject: systemc: Fix the default width values for the various sc_trace-s. X-Git-Tag: v19.0.0.0~1578 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dfd2e7681e3bf87997ee65a5bc4fbd88cbb19935;p=gem5.git systemc: Fix the default width values for the various sc_trace-s. These were all set to 8 * sizeof(char) instead of using the size of the actual data type being traced. Also add a very simple implementation to the generic sc_signal_in_if sc_trace which just delegates to the sc_trace of the underlying type T. Change-Id: I129df46ef9d49705dc3dac76e30c0a3652c981eb Reviewed-on: https://gem5-review.googlesource.com/c/12818 Reviewed-by: Gabe Black Maintainer: Gabe Black --- diff --git a/src/systemc/ext/utils/sc_trace_file.hh b/src/systemc/ext/utils/sc_trace_file.hh index db50e3967..0b4b0d02b 100644 --- a/src/systemc/ext/utils/sc_trace_file.hh +++ b/src/systemc/ext/utils/sc_trace_file.hh @@ -122,46 +122,46 @@ void sc_trace(sc_trace_file *, const sc_time *, const std::string &); // Nonstandard - unsigned versions necessary to avoid ambiguous overload // resolution. void sc_trace(sc_trace_file *, const unsigned char &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned char))); void sc_trace(sc_trace_file *, const unsigned char *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned char))); void sc_trace(sc_trace_file *, const unsigned short &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned short))); void sc_trace(sc_trace_file *, const unsigned short *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned short))); void sc_trace(sc_trace_file *, const unsigned int &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned int))); void sc_trace(sc_trace_file *, const unsigned int *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned int))); void sc_trace(sc_trace_file *, const unsigned long &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned long))); void sc_trace(sc_trace_file *, const unsigned long *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(unsigned long))); void sc_trace(sc_trace_file *, const char &, const std::string &, int width=(8 * sizeof(char))); void sc_trace(sc_trace_file *, const char *, const std::string &, int width=(8 * sizeof(char))); void sc_trace(sc_trace_file *, const short &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(short))); void sc_trace(sc_trace_file *, const short *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(short))); void sc_trace(sc_trace_file *, const int &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(int))); void sc_trace(sc_trace_file *, const int *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(int))); void sc_trace(sc_trace_file *, const long &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(long))); void sc_trace(sc_trace_file *, const long *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(long))); void sc_trace(sc_trace_file *, const sc_dt::int64 &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(sc_dt::int64))); void sc_trace(sc_trace_file *, const sc_dt::int64 *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(sc_dt::int64))); void sc_trace(sc_trace_file *, const sc_dt::uint64 &, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(sc_dt::uint64))); void sc_trace(sc_trace_file *, const sc_dt::uint64 *, - const std::string &, int width=(8 * sizeof(char))); + const std::string &, int width=(8 * sizeof(sc_dt::uint64))); // Nonstandard function for enums void sc_trace(sc_trace_file *, const unsigned int &, @@ -172,9 +172,10 @@ void sc_trace_delta_cycles(sc_trace_file *, bool on=true); template void -sc_trace(sc_trace_file *, const sc_signal_in_if &, const std::string &) +sc_trace(sc_trace_file *tf, const sc_signal_in_if &iface, + const std::string &name) { - sc_utils_warn_unimpl(__PRETTY_FUNCTION__); + sc_trace(tf, iface.read(), name); } void sc_trace(sc_trace_file *, const sc_signal_in_if &,