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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-06-13 18:46:06 -07:00
parent a51eb91659
commit a7c7b93971
2 changed files with 85 additions and 0 deletions

View File

@@ -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 <class T>
void
sc_trace(sc_trace_file *, const sc_signal_in_if<T> &, const std::string &)

View File

@@ -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<long> &,
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