summaryrefslogtreecommitdiff
path: root/src/systemc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-09-19 16:18:16 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:23:56 +0000
commitdfd2e7681e3bf87997ee65a5bc4fbd88cbb19935 (patch)
tree9f69d25481e004b2cbf8574e15ae52c5292ae6aa /src/systemc
parentc288af7a2689d23eeb906e340a0255f9a51a30de (diff)
downloadgem5-dfd2e7681e3bf87997ee65a5bc4fbd88cbb19935.tar.xz
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<T> 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 <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc')
-rw-r--r--src/systemc/ext/utils/sc_trace_file.hh41
1 files changed, 21 insertions, 20 deletions
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 <class T>
void
-sc_trace(sc_trace_file *, const sc_signal_in_if<T> &, const std::string &)
+sc_trace(sc_trace_file *tf, const sc_signal_in_if<T> &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<char> &,