Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/11182
Change subject: systemc: Add some non-standard sc_trace variants.
......................................................................
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
---
M src/systemc/ext/utils/sc_trace_file.hh
M src/systemc/utils/sc_trace_file.cc
2 files changed, 85 insertions(+), 0 deletions(-)
diff --git a/src/systemc/ext/utils/sc_trace_file.hh
b/src/systemc/ext/utils/sc_trace_file.hh
index ec4fd4d..9e9e75b 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 *,
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 *,
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 &)
diff --git a/src/systemc/utils/sc_trace_file.cc
b/src/systemc/utils/sc_trace_file.cc
index badc691..933d730 100644
--- a/src/systemc/utils/sc_trace_file.cc
+++ b/src/systemc/utils/sc_trace_file.cc
@@ -221,6 +221,60 @@
}
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)
{
warn("%s not implemented.\n", __PRETTY_FUNCTION__);
@@ -322,4 +376,11 @@
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
--
To view, visit https://gem5-review.googlesource.com/11182
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I26fd06d90ae6bf5fc5aed24bc2ac826ad69eee31
Gerrit-Change-Number: 11182
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabebl...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev