systemc: Make suppress_id work like the test expects.
authorGabe Black <gabeblack@google.com>
Sun, 7 Oct 2018 03:21:31 +0000 (20:21 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 16 Oct 2018 01:07:23 +0000 (01:07 +0000)
This is in contrast to how Accellera actually implements it, implying
they would fail their own test.

The specific difference is that suppress_id should only suppress
SC_INFO and SC_WARNING, not all severity levels like the Accellera
implementation will do.

Change-Id: I34f0d2d5912548963433a785cfa6ef88ad818042
Reviewed-on: https://gem5-review.googlesource.com/c/13320
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/utils/sc_report.cc

index 83e066269de086c941976f7af5b53679a715f595..e76dfcb6d8bdaceca4eec4e80a79e7713201f3f3 100644 (file)
@@ -102,7 +102,11 @@ sc_report::is_suppressed(int id)
     if (it == sc_gem5::reportIdToMsgMap.end())
         return false;
 
-    return sc_gem5::reportMsgInfoMap[it->second].actions == SC_DO_NOTHING;
+    auto &msgInfo = sc_gem5::reportMsgInfoMap[it->second];
+
+    return (msgInfo.actions == SC_DO_NOTHING ||
+            (msgInfo.sevActions[SC_INFO] == SC_DO_NOTHING &&
+             msgInfo.sevActions[SC_WARNING] == SC_DO_NOTHING));
 }
 
 void
@@ -139,10 +143,17 @@ sc_report::suppress_id(int id, bool suppress)
     if (it == sc_gem5::reportIdToMsgMap.end())
         return;
 
-    if (suppress)
-        sc_gem5::reportMsgInfoMap[it->second].actions = SC_DO_NOTHING;
-    else
-        sc_gem5::reportMsgInfoMap[it->second].actions = SC_UNSPECIFIED;
+    if (suppress) {
+        sc_gem5::reportMsgInfoMap[it->second].
+            sevActions[SC_INFO] = SC_DO_NOTHING;
+        sc_gem5::reportMsgInfoMap[it->second].
+            sevActions[SC_WARNING] = SC_DO_NOTHING;
+    } else {
+        sc_gem5::reportMsgInfoMap[it->second].
+            sevActions[SC_INFO] = SC_UNSPECIFIED;
+        sc_gem5::reportMsgInfoMap[it->second].
+            sevActions[SC_WARNING] = SC_UNSPECIFIED;
+    }
 }
 
 void