sc_report.cc (13314:d1f53683ab94) sc_report.cc (13322:7391057615bd)
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

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

25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Gabe Black
28 */
29
30#include <cstring>
31
32#include "base/logging.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

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

25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * Authors: Gabe Black
28 */
29
30#include <cstring>
31
32#include "base/logging.hh"
33#include "systemc/ext/utils/messages.hh"
33#include "systemc/ext/utils/sc_report.hh"
34#include "systemc/ext/utils/sc_report_handler.hh"
35#include "systemc/utils/report.hh"
36
37namespace sc_core
38{
39
40sc_report::sc_report(sc_severity _severity, const char *msg_type,

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

114{
115 sc_gem5::reportWarningsAsErrors = val;
116}
117
118void
119sc_report::register_id(int id, const char *msg)
120{
121 if (id < 0) {
34#include "systemc/ext/utils/sc_report.hh"
35#include "systemc/ext/utils/sc_report_handler.hh"
36#include "systemc/utils/report.hh"
37
38namespace sc_core
39{
40
41sc_report::sc_report(sc_severity _severity, const char *msg_type,

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

115{
116 sc_gem5::reportWarningsAsErrors = val;
117}
118
119void
120sc_report::register_id(int id, const char *msg)
121{
122 if (id < 0) {
122 SC_REPORT_ERROR("(E800) register_id failed", "invalid report id");
123 SC_REPORT_ERROR(SC_ID_REGISTER_ID_FAILED_, "invalid report id");
123 return;
124 }
125 if (!msg) {
124 return;
125 }
126 if (!msg) {
126 SC_REPORT_ERROR("(E800) register_id failed", "invalid report message");
127 SC_REPORT_ERROR(SC_ID_REGISTER_ID_FAILED_, "invalid report message");
127 return;
128 }
129 auto p = sc_gem5::reportIdToMsgMap.insert(
130 std::pair<int, std::string>(id, msg));
131 if (!p.second) {
128 return;
129 }
130 auto p = sc_gem5::reportIdToMsgMap.insert(
131 std::pair<int, std::string>(id, msg));
132 if (!p.second) {
132 SC_REPORT_ERROR("(E800) register_id failed",
133 "report id already exists");
133 SC_REPORT_ERROR(SC_ID_REGISTER_ID_FAILED_, "report id already exists");
134 } else {
135 sc_gem5::reportMsgInfoMap[msg].id = id;
136 }
137}
138
139void
140sc_report::suppress_id(int id, bool suppress)
141{

--- 44 unchanged lines hidden ---
134 } else {
135 sc_gem5::reportMsgInfoMap[msg].id = id;
136 }
137}
138
139void
140sc_report::suppress_id(int id, bool suppress)
141{

--- 44 unchanged lines hidden ---