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" |
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) { |
123 SC_REPORT_ERROR(SC_ID_REGISTER_ID_FAILED_, "invalid report id"); |
124 return; 125 } 126 if (!msg) { |
127 SC_REPORT_ERROR(SC_ID_REGISTER_ID_FAILED_, "invalid report message"); |
128 return; 129 } 130 auto p = sc_gem5::reportIdToMsgMap.insert( 131 std::pair<int, std::string>(id, msg)); 132 if (!p.second) { |
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 --- |