sc_report_handler.cc (13322:7391057615bd) sc_report_handler.cc (13324:c8b709468e61)
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 22 unchanged lines hidden (view full) ---

31#include <map>
32#include <sstream>
33#include <string>
34
35#include "base/logging.hh"
36#include "systemc/core/process.hh"
37#include "systemc/core/scheduler.hh"
38#include "systemc/ext/core/sc_main.hh"
1/*
2 * Copyright 2018 Google, Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met: redistributions of source code must retain the above copyright
7 * notice, this list of conditions and the following disclaimer;
8 * redistributions in binary form must reproduce the above copyright

--- 22 unchanged lines hidden (view full) ---

31#include <map>
32#include <sstream>
33#include <string>
34
35#include "base/logging.hh"
36#include "systemc/core/process.hh"
37#include "systemc/core/scheduler.hh"
38#include "systemc/ext/core/sc_main.hh"
39#include "systemc/ext/utils/messages.hh"
39#include "systemc/ext/utils/sc_report_handler.hh"
40#include "systemc/utils/report.hh"
41
42namespace sc_core
43{
44
45namespace
46{

--- 10 unchanged lines hidden (view full) ---

57 report(severity, msg_type, msg, SC_MEDIUM, file, line);
58}
59
60void
61sc_report_handler::report(sc_severity severity, const char *msg_type,
62 const char *msg, int verbosity, const char *file,
63 int line)
64{
40#include "systemc/ext/utils/sc_report_handler.hh"
41#include "systemc/utils/report.hh"
42
43namespace sc_core
44{
45
46namespace
47{

--- 10 unchanged lines hidden (view full) ---

58 report(severity, msg_type, msg, SC_MEDIUM, file, line);
59}
60
61void
62sc_report_handler::report(sc_severity severity, const char *msg_type,
63 const char *msg, int verbosity, const char *file,
64 int line)
65{
66 if (!msg_type)
67 msg_type = SC_ID_UNKNOWN_ERROR_;
68
65 if (severity == SC_INFO && verbosity > sc_gem5::reportVerbosityLevel)
66 return;
67
68 sc_gem5::ReportSevInfo &sevInfo = sc_gem5::reportSevInfos[severity];
69 sc_gem5::ReportMsgInfo &msgInfo = sc_gem5::reportMsgInfoMap[msg_type];
70
71 sevInfo.count++;
72 msgInfo.count++;

--- 49 unchanged lines hidden (view full) ---

122 sc_actions previous = info.actions;
123 info.actions = actions;
124 return previous;
125}
126
127sc_actions
128sc_report_handler::set_actions(const char *msg_type, sc_actions actions)
129{
69 if (severity == SC_INFO && verbosity > sc_gem5::reportVerbosityLevel)
70 return;
71
72 sc_gem5::ReportSevInfo &sevInfo = sc_gem5::reportSevInfos[severity];
73 sc_gem5::ReportMsgInfo &msgInfo = sc_gem5::reportMsgInfoMap[msg_type];
74
75 sevInfo.count++;
76 msgInfo.count++;

--- 49 unchanged lines hidden (view full) ---

126 sc_actions previous = info.actions;
127 info.actions = actions;
128 return previous;
129}
130
131sc_actions
132sc_report_handler::set_actions(const char *msg_type, sc_actions actions)
133{
134 if (!msg_type)
135 msg_type = SC_ID_UNKNOWN_ERROR_;
136
130 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
131 sc_actions previous = info.actions;
132 info.actions = actions;
133 return previous;
134}
135
136sc_actions
137sc_report_handler::set_actions(
138 const char *msg_type, sc_severity severity, sc_actions actions)
139{
137 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
138 sc_actions previous = info.actions;
139 info.actions = actions;
140 return previous;
141}
142
143sc_actions
144sc_report_handler::set_actions(
145 const char *msg_type, sc_severity severity, sc_actions actions)
146{
147 if (!msg_type)
148 msg_type = SC_ID_UNKNOWN_ERROR_;
149
140 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
141 sc_actions previous = info.sevActions[severity];
142 info.sevActions[severity] = actions;
143 return previous;
144}
145
146int
147sc_report_handler::stop_after(sc_severity severity, int limit)
148{
149 sc_gem5::ReportSevInfo &info = sc_gem5::reportSevInfos[severity];
150 int previous = info.limit;
151 info.limit = limit;
152 return previous;
153}
154
155int
156sc_report_handler::stop_after(const char *msg_type, int limit)
157{
150 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
151 sc_actions previous = info.sevActions[severity];
152 info.sevActions[severity] = actions;
153 return previous;
154}
155
156int
157sc_report_handler::stop_after(sc_severity severity, int limit)
158{
159 sc_gem5::ReportSevInfo &info = sc_gem5::reportSevInfos[severity];
160 int previous = info.limit;
161 info.limit = limit;
162 return previous;
163}
164
165int
166sc_report_handler::stop_after(const char *msg_type, int limit)
167{
168 if (!msg_type)
169 msg_type = SC_ID_UNKNOWN_ERROR_;
170
158 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
159 int previous = info.limit;
160 info.limit = limit;
161 return previous;
162}
163
164int
165sc_report_handler::stop_after(
166 const char *msg_type, sc_severity severity, int limit)
167{
171 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
172 int previous = info.limit;
173 info.limit = limit;
174 return previous;
175}
176
177int
178sc_report_handler::stop_after(
179 const char *msg_type, sc_severity severity, int limit)
180{
181 if (!msg_type)
182 msg_type = SC_ID_UNKNOWN_ERROR_;
183
168 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
169 int previous = info.sevLimits[severity];
170 info.sevLimits[severity] = limit;
171 return previous;
172}
173
174int
175sc_report_handler::get_count(sc_severity severity)
176{
177 return sc_gem5::reportSevInfos[severity].count;
178}
179
180int
181sc_report_handler::get_count(const char *msg_type)
182{
184 sc_gem5::ReportMsgInfo &info = sc_gem5::reportMsgInfoMap[msg_type];
185 int previous = info.sevLimits[severity];
186 info.sevLimits[severity] = limit;
187 return previous;
188}
189
190int
191sc_report_handler::get_count(sc_severity severity)
192{
193 return sc_gem5::reportSevInfos[severity].count;
194}
195
196int
197sc_report_handler::get_count(const char *msg_type)
198{
199 if (!msg_type)
200 msg_type = SC_ID_UNKNOWN_ERROR_;
201
183 return sc_gem5::reportMsgInfoMap[msg_type].count;
184}
185
186int
187sc_report_handler::get_count(const char *msg_type, sc_severity severity)
188{
202 return sc_gem5::reportMsgInfoMap[msg_type].count;
203}
204
205int
206sc_report_handler::get_count(const char *msg_type, sc_severity severity)
207{
208 if (!msg_type)
209 msg_type = SC_ID_UNKNOWN_ERROR_;
210
189 return sc_gem5::reportMsgInfoMap[msg_type].sevCounts[severity];
190}
191
192int
193sc_report_handler::set_verbosity_level(int vl)
194{
195 int previous = sc_gem5::reportVerbosityLevel;
196 sc_gem5::reportVerbosityLevel = vl;

--- 197 unchanged lines hidden ---
211 return sc_gem5::reportMsgInfoMap[msg_type].sevCounts[severity];
212}
213
214int
215sc_report_handler::set_verbosity_level(int vl)
216{
217 int previous = sc_gem5::reportVerbosityLevel;
218 sc_gem5::reportVerbosityLevel = vl;

--- 197 unchanged lines hidden ---