From a7c7b939713b62043646c6b9b9254faa8e8b98ce Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 13 Jun 2018 18:46:06 -0700 Subject: systemc: Add some non-standard sc_trace variants. These overloads of sc_trace take the unsigned version of some primitive types. The compiler thought it was ambiguous how to convert an unsigned integer value into a signed one since there were several different functions which took signed integer parameters of various sizes. These versions of sc_trace aren't in the standard, but they are in the Accellera implementation and do fix building of the regression tests. Change-Id: I26fd06d90ae6bf5fc5aed24bc2ac826ad69eee31 Reviewed-on: https://gem5-review.googlesource.com/11182 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/ext/utils/sc_trace_file.hh | 24 +++++++++++++ src/systemc/utils/sc_trace_file.cc | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/src/systemc/ext/utils/sc_trace_file.hh b/src/systemc/ext/utils/sc_trace_file.hh index ec4fd4d6a..9e9e75b35 100644 --- a/src/systemc/ext/utils/sc_trace_file.hh +++ b/src/systemc/ext/utils/sc_trace_file.hh @@ -107,6 +107,26 @@ void sc_trace(sc_trace_file *, const sc_dt::sc_fxnum_fast &, void sc_trace(sc_trace_file *, const sc_dt::sc_fxnum_fast *, 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))); +void sc_trace(sc_trace_file *, const unsigned char *, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned short &, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned short *, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned int &, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned int *, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned long &, + const std::string &, int width=(8 * sizeof(char))); +void sc_trace(sc_trace_file *, const unsigned long *, + 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 char *, @@ -132,6 +152,10 @@ void sc_trace(sc_trace_file *, const sc_dt::uint64 &, void sc_trace(sc_trace_file *, const sc_dt::uint64 *, const std::string &, int width=(8 * sizeof(char))); +// Nonstandard function for enums +void sc_trace(sc_trace_file *, const unsigned int &, + const std::string &, const char **enum_literals); + template void sc_trace(sc_trace_file *, const sc_signal_in_if &, const std::string &) diff --git a/src/systemc/utils/sc_trace_file.cc b/src/systemc/utils/sc_trace_file.cc index 3b09d951d..66f7fef06 100644 --- a/src/systemc/utils/sc_trace_file.cc +++ b/src/systemc/utils/sc_trace_file.cc @@ -220,6 +220,60 @@ sc_trace(sc_trace_file *, const sc_dt::sc_fxnum_fast *, const std::string &) warn("%s not implemented.\n", __PRETTY_FUNCTION__); } +void +sc_trace(sc_trace_file *, const unsigned char &, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned char *, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned short &, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned short *, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned int &, const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned int *, const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned long &, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + +void +sc_trace(sc_trace_file *, const unsigned long *, + const std::string &, int width) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + void sc_trace(sc_trace_file *, const char &, const std::string &, int width) { @@ -322,4 +376,11 @@ sc_trace(sc_trace_file *, const sc_signal_in_if &, warn("%s not implemented.\n", __PRETTY_FUNCTION__); } +void +sc_trace(sc_trace_file *, const unsigned int &, + const std::string &, const char **enum_literals) +{ + warn("%s not implemented.\n", __PRETTY_FUNCTION__); +} + } // namespace sc_core -- cgit v1.2.3