summaryrefslogtreecommitdiff
path: root/src/systemc/utils
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-07 05:23:49 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 01:12:58 +0000
commite07f7efb75f0f7322d752608eb1cb1e1145b4a98 (patch)
treec70d86ba3130636fd8c6ff3c0d159727b81932c8 /src/systemc/utils
parent3420f0e223888bf70cd502efb5a534e651891b5c (diff)
downloadgem5-e07f7efb75f0f7322d752608eb1cb1e1145b4a98.tar.xz
systemc: Switch to using predefined messages for channels.
Create and use predefined messages for channels which match the ones Accellera uses. Change-Id: I179214838bbd83604e50225926cdc6b5b1b16923 Reviewed-on: https://gem5-review.googlesource.com/c/13330 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/utils')
-rw-r--r--src/systemc/utils/sc_report_handler.cc22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/systemc/utils/sc_report_handler.cc b/src/systemc/utils/sc_report_handler.cc
index 1b725cc0f..a2b915ed1 100644
--- a/src/systemc/utils/sc_report_handler.cc
+++ b/src/systemc/utils/sc_report_handler.cc
@@ -36,6 +36,7 @@
#include "systemc/core/process.hh"
#include "systemc/core/scheduler.hh"
#include "systemc/ext/core/sc_main.hh"
+#include "systemc/ext/utils/messages.hh"
#include "systemc/ext/utils/sc_report_handler.hh"
#include "systemc/utils/report.hh"
@@ -62,6 +63,9 @@ sc_report_handler::report(sc_severity severity, const char *msg_type,
const char *msg, int verbosity, const char *file,
int line)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
if (severity == SC_INFO && verbosity > sc_gem5::reportVerbosityLevel)
return;
@@ -127,6 +131,9 @@ sc_report_handler::set_actions(sc_severity severity, sc_actions actions)
sc_actions
sc_report_handler::set_actions(const char *msg_type, sc_actions actions)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
sc_actions previous = info.actions;
info.actions = actions;
@@ -137,6 +144,9 @@ sc_actions
sc_report_handler::set_actions(
const char *msg_type, sc_severity severity, sc_actions actions)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
sc_actions previous = info.sevActions[severity];
info.sevActions[severity] = actions;
@@ -155,6 +165,9 @@ sc_report_handler::stop_after(sc_severity severity, int limit)
int
sc_report_handler::stop_after(const char *msg_type, int limit)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
int previous = info.limit;
info.limit = limit;
@@ -165,6 +178,9 @@ int
sc_report_handler::stop_after(
const char *msg_type, sc_severity severity, int limit)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
int previous = info.sevLimits[severity];
info.sevLimits[severity] = limit;
@@ -180,12 +196,18 @@ sc_report_handler::get_count(sc_severity severity)
int
sc_report_handler::get_count(const char *msg_type)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
return sc_gem5::reportMsgInfoMap[msg_type].count;
}
int
sc_report_handler::get_count(const char *msg_type, sc_severity severity)
{
+ if (!msg_type)
+ msg_type = SC_ID_UNKNOWN_ERROR_;
+
return sc_gem5::reportMsgInfoMap[msg_type].sevCounts[severity];
}