Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/13322

Change subject: systemc: Add a mechanism for pre-registering message type ids.
......................................................................

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
---
M src/systemc/utils/report.cc
M src/systemc/utils/report.hh
2 files changed, 15 insertions(+), 0 deletions(-)



diff --git a/src/systemc/utils/report.cc b/src/systemc/utils/report.cc
index 9c26ede..755542f 100644
--- a/src/systemc/utils/report.cc
+++ b/src/systemc/utils/report.cc
@@ -63,4 +63,11 @@

 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 e0b2e25..ddbf62f 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 bool reportWarningsAsErrors;

+struct DefaultReportMessages
+{
+  public:
+ DefaultReportMessages(std::initializer_list<std::pair<int, const char *>>);
+};
+
 } // namespace sc_gem5

 #endif // __SYSTEMC_UTILS_REPORT_HH__

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13322
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: I4e4dc3470c28d4113330a44ccd06ffe7724e75b1
Gerrit-Change-Number: 13322
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to