39a40
> #include "systemc/utils/report.hh"
50,102d50
< struct ReportCatInfo
< {
< explicit ReportCatInfo(sc_actions actions) :
< actions(actions), count(0), limit(-1)
< {}
< ReportCatInfo() : ReportCatInfo(SC_UNSPECIFIED) {}
<
< bool
< checkLimit(sc_actions &actions)
< {
< if (limit == 0 || count < limit)
< return false;
< if (limit != -1)
< actions |= SC_STOP;
< return true;
< }
<
< sc_actions actions;
< int count;
< int limit;
< };
<
< const char *severityNames[] = {
< [SC_INFO] = "Info",
< [SC_WARNING] = "Warning",
< [SC_ERROR] = "Error",
< [SC_FATAL] = "Fatal"
< };
<
< ReportCatInfo catForSeverity[SC_MAX_SEVERITY] =
< {
< [SC_INFO] = ReportCatInfo(SC_DEFAULT_INFO_ACTIONS),
< [SC_WARNING] = ReportCatInfo(SC_DEFAULT_WARNING_ACTIONS),
< [SC_ERROR] = ReportCatInfo(SC_DEFAULT_ERROR_ACTIONS),
< [SC_FATAL] = ReportCatInfo(SC_DEFAULT_FATAL_ACTIONS)
< };
<
< std::map<std::string, ReportCatInfo> catForMsgType;
< std::map<std::pair<std::string, sc_severity>, ReportCatInfo>
< catForSeverityAndMsgType;
<
< int verbosityLevel = SC_MEDIUM;
<
< sc_actions suppressedActions = SC_UNSPECIFIED;
< sc_actions forcedActions = SC_UNSPECIFIED;
< sc_actions catchActions = SC_DISPLAY;
<
< sc_report_handler_proc reportHandlerProc = &sc_report_handler::default_handler;
<
< sc_actions maxAction = SC_ABORT;
<
< std::unique_ptr<sc_report> globalReportCache;
<
117c65
< if (severity == SC_INFO && verbosity > verbosityLevel)
---
> if (severity == SC_INFO && verbosity > sc_gem5::reportVerbosityLevel)
120,123c68,69
< ReportCatInfo &sevInfo = catForSeverity[severity];
< ReportCatInfo &msgInfo = catForMsgType[msg_type];
< ReportCatInfo &sevMsgInfo = catForSeverityAndMsgType[
< std::make_pair(std::string(msg_type), severity)];
---
> sc_gem5::ReportSevInfo &sevInfo = sc_gem5::reportSevInfos[severity];
> sc_gem5::ReportMsgInfo &msgInfo = sc_gem5::reportMsgInfoMap[msg_type];
127c73
< sevMsgInfo.count++;
---
> msgInfo.sevCounts[severity]++;
130,131c76,77
< if (sevMsgInfo.actions != SC_UNSPECIFIED)
< actions = sevMsgInfo.actions;
---
> if (msgInfo.sevActions[severity] != SC_UNSPECIFIED)
> actions = msgInfo.sevActions[severity];
137,138c83,84
< actions &= ~suppressedActions;
< actions |= forcedActions;
---
> actions &= ~sc_gem5::reportSuppressedActions;
> actions |= sc_gem5::reportForcedActions;
140,141c86,87
< if (sevMsgInfo.checkLimit(actions) && msgInfo.checkLimit(actions))
< sevInfo.checkLimit(actions);
---
> msgInfo.checkLimits(severity, actions);
> sevInfo.checkLimit(actions);
152c98
< globalReportCache =
---
> sc_gem5::globalReportCache =
157c103
< reportHandlerProc(report, actions);
---
> sc_gem5::reportHandlerProc(report, actions);
171c117
< ReportCatInfo &info = catForSeverity[severity];
---
> sc_gem5::ReportSevInfo &info = sc_gem5::reportSevInfos[severity];
180c126
< ReportCatInfo &info = catForMsgType[msg_type];
---
> sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
190,193c136,138
< ReportCatInfo &info = catForSeverityAndMsgType[
< std::make_pair(std::string(msg_type), severity)];
< sc_actions previous = info.actions;
< info.actions = actions;
---
> sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
> sc_actions previous = info.sevActions[severity];
> info.sevActions[severity] = actions;
200c145
< ReportCatInfo &info = catForSeverity[severity];
---
> sc_gem5::ReportSevInfo &info = sc_gem5::reportSevInfos[severity];
209c154
< ReportCatInfo &info = catForMsgType[msg_type];
---
> sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
219,222c164,166
< ReportCatInfo &info = catForSeverityAndMsgType[
< std::make_pair(std::string(msg_type), severity)];
< int previous = info.limit;
< info.limit = limit;
---
> sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
> int previous = info.sevLimits[severity];
> info.sevLimits[severity] = limit;
229c173
< return catForSeverity[severity].count;
---
> return sc_gem5::reportSevInfos[severity].count;
235c179
< return catForMsgType[msg_type].count;
---
> return sc_gem5::reportMsgInfoMap[msg_type].count;
241,242c185
< return catForSeverityAndMsgType[
< std::make_pair(std::string(msg_type), severity)].count;
---
> return sc_gem5::reportMsgInfoMap[msg_type].sevCounts[severity];
248,249c191,192
< int previous = verbosityLevel;
< verbosityLevel = vl;
---
> int previous = sc_gem5::reportVerbosityLevel;
> sc_gem5::reportVerbosityLevel = vl;
256c199
< return verbosityLevel;
---
> return sc_gem5::reportVerbosityLevel;
263,264c206,207
< sc_actions previous = suppressedActions;
< suppressedActions = actions;
---
> sc_actions previous = sc_gem5::reportSuppressedActions;
> sc_gem5::reportSuppressedActions = actions;
277,278c220,221
< sc_actions previous = forcedActions;
< forcedActions = actions;
---
> sc_actions previous = sc_gem5::reportForcedActions;
> sc_gem5::reportForcedActions = actions;
292,293c235,236
< sc_actions previous = catchActions;
< catchActions = actions;
---
> sc_actions previous = sc_gem5::reportCatchActions;
> sc_gem5::reportCatchActions = actions;
300c243
< return catchActions;
---
> return sc_gem5::reportCatchActions;
307c250
< reportHandlerProc = proc;
---
> sc_gem5::reportHandlerProc = proc;
339a283
> static sc_actions maxAction = SC_ABORT;
344,349d287
< sc_report_handler_proc
< sc_report_handler::get_handler()
< {
< return reportHandlerProc;
< }
<
356c294
< return globalReportCache.get();
---
> return ::sc_gem5::globalReportCache.get();
366c304
< globalReportCache = nullptr;
---
> ::sc_gem5::globalReportCache = nullptr;
412c350
< const char *sevName = severityNames[report.get_severity()];
---
> const char *sevName = sc_gem5::reportSeverityNames[report.get_severity()];