gem5  v20.1.0.0
report.cc
Go to the documentation of this file.
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
9  * notice, this list of conditions and the following disclaimer in the
10  * documentation and/or other materials provided with the distribution;
11  * neither the name of the copyright holders nor the names of its
12  * contributors may be used to endorse or promote products derived from
13  * this software without specific prior written permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #include "systemc/utils/report.hh"
29 
30 namespace sc_gem5
31 {
32 
33 const char *reportSeverityNames[] = {
34  [sc_core::SC_INFO] = "Info",
35  [sc_core::SC_WARNING] = "Warning",
36  [sc_core::SC_ERROR] = "Error",
37  [sc_core::SC_FATAL] = "Fatal"
38 };
39 
41 {
46 };
47 
48 std::map<std::string, ReportMsgInfo> &
50 {
51  static std::map<std::string, ReportMsgInfo> m;
52  return m;
53 }
54 
55 std::map<int, std::string> &
57 {
58  static std::map<int, std::string> m;
59  return m;
60 }
61 
63 
67 
70 
71 std::unique_ptr<sc_core::sc_report> globalReportCache;
72 
74 
76  std::initializer_list<std::pair<int, const char *>> msgs)
77 {
78  for (auto &p: msgs)
79  sc_core::sc_report::register_id(p.first, p.second);
80 }
81 
82 } // namespace sc_gem5
sc_core::SC_INFO
@ SC_INFO
Definition: sc_report.hh:41
sc_core::SC_DEFAULT_ERROR_ACTIONS
@ SC_DEFAULT_ERROR_ACTIONS
Definition: sc_report_handler.hh:58
sc_gem5::DefaultReportMessages::DefaultReportMessages
DefaultReportMessages(std::initializer_list< std::pair< int, const char * >>)
Definition: report.cc:75
sc_core::sc_actions
unsigned sc_actions
Definition: sc_report_handler.hh:39
sc_gem5::ReportSevInfo
Definition: report.hh:74
sc_core::SC_WARNING
@ SC_WARNING
Definition: sc_report.hh:42
sc_gem5::reportSeverityNames
const char * reportSeverityNames[]
Definition: report.cc:33
sc_core::SC_UNSPECIFIED
@ SC_UNSPECIFIED
Definition: sc_report_handler.hh:43
report.hh
sc_gem5::reportVerbosityLevel
int reportVerbosityLevel
Definition: report.cc:62
sc_core::SC_MAX_SEVERITY
@ SC_MAX_SEVERITY
Definition: sc_report.hh:45
sc_core::sc_report_handler::default_handler
static void default_handler(const sc_report &, const sc_actions &)
Definition: sc_report_handler.cc:278
sc_gem5::reportSevInfos
ReportSevInfo reportSevInfos[sc_core::SC_MAX_SEVERITY]
Definition: report.cc:40
sc_gem5::reportHandlerProc
sc_core::sc_report_handler_proc reportHandlerProc
Definition: report.cc:68
sc_gem5::globalReportCache
std::unique_ptr< sc_core::sc_report > globalReportCache
Definition: report.cc:71
sc_core::SC_DEFAULT_INFO_ACTIONS
@ SC_DEFAULT_INFO_ACTIONS
Definition: sc_report_handler.hh:56
sc_gem5::reportMsgInfoMap
std::map< std::string, ReportMsgInfo > & reportMsgInfoMap()
Definition: report.cc:49
std::pair
STL pair class.
Definition: stl.hh:58
sc_core::sc_report::register_id
static void register_id(int id, const char *msg)
Definition: sc_report.cc:118
sc_core::SC_DISPLAY
@ SC_DISPLAY
Definition: sc_report_handler.hh:47
sc_gem5::reportWarningsAsErrors
bool reportWarningsAsErrors
Definition: report.cc:73
sc_gem5::reportForcedActions
sc_core::sc_actions reportForcedActions
Definition: report.cc:65
sc_core::SC_DEFAULT_FATAL_ACTIONS
@ SC_DEFAULT_FATAL_ACTIONS
Definition: sc_report_handler.hh:59
sc_core::sc_report_handler_proc
void(* sc_report_handler_proc)(const sc_report &, const sc_actions &)
Definition: sc_report_handler.hh:62
sc_core::SC_MEDIUM
@ SC_MEDIUM
Definition: sc_report.hh:52
sc_gem5::reportIdToMsgMap
std::map< int, std::string > & reportIdToMsgMap()
Definition: report.cc:56
sc_core::SC_FATAL
@ SC_FATAL
Definition: sc_report.hh:44
sc_gem5::reportSuppressedActions
sc_core::sc_actions reportSuppressedActions
Definition: report.cc:64
sc_gem5
Definition: sc_clock.cc:42
sc_gem5::reportCatchActions
sc_core::sc_actions reportCatchActions
Definition: report.cc:66
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
sc_core::SC_ERROR
@ SC_ERROR
Definition: sc_report.hh:43
sc_core::SC_DEFAULT_WARNING_ACTIONS
@ SC_DEFAULT_WARNING_ACTIONS
Definition: sc_report_handler.hh:57
ArmISA::m
Bitfield< 0 > m
Definition: miscregs_types.hh:389

Generated on Wed Sep 30 2020 14:02:18 for gem5 by doxygen 1.8.17