summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-07 00:34:35 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 01:08:32 +0000
commit208704b23a9f95f80fb49b3bfce4bccffd128060 (patch)
tree59a036faf9a5ac71f94908f6f3a0a62e3bf9c3a4
parent7911f271e852cc54a9591fce582bc8f4eb427a5e (diff)
downloadgem5-208704b23a9f95f80fb49b3bfce4bccffd128060.tar.xz
systemc: Add a mechanism for pre-registering message type ids.
These ids are the ones the Accellera implementation/tests use. Some of the tests expect them to be available and usable. Change-Id: I4e4dc3470c28d4113330a44ccd06ffe7724e75b1 Reviewed-on: https://gem5-review.googlesource.com/c/13322 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/utils/report.cc7
-rw-r--r--src/systemc/utils/report.hh8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/systemc/utils/report.cc b/src/systemc/utils/report.cc
index 9c26edea3..755542fd6 100644
--- a/src/systemc/utils/report.cc
+++ b/src/systemc/utils/report.cc
@@ -63,4 +63,11 @@ std::unique_ptr<sc_core::sc_report> globalReportCache;
bool reportWarningsAsErrors = false;
+DefaultReportMessages::DefaultReportMessages(
+ std::initializer_list<std::pair<int, const char *>> msgs)
+{
+ for (auto &p: msgs)
+ sc_core::sc_report::register_id(p.first, p.second);
+}
+
} // namespace sc_gem5
diff --git a/src/systemc/utils/report.hh b/src/systemc/utils/report.hh
index e0b2e2598..ddbf62fa5 100644
--- a/src/systemc/utils/report.hh
+++ b/src/systemc/utils/report.hh
@@ -30,9 +30,11 @@
#ifndef __SYSTEMC_UTILS_REPORT_HH__
#define __SYSTEMC_UTILS_REPORT_HH__
+#include <initializer_list>
#include <map>
#include <memory>
#include <string>
+#include <utility>
#include "systemc/ext/utils/sc_report.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
@@ -106,6 +108,12 @@ extern std::unique_ptr<sc_core::sc_report> globalReportCache;
extern bool reportWarningsAsErrors;
+struct DefaultReportMessages
+{
+ public:
+ DefaultReportMessages(std::initializer_list<std::pair<int, const char *>>);
+};
+
} // namespace sc_gem5
#endif // __SYSTEMC_UTILS_REPORT_HH__