gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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  * Authors: Gabe Black
28  */
29 
30 #include "systemc/utils/report.hh"
31 
32 namespace sc_gem5
33 {
34 
35 const char *reportSeverityNames[] = {
36  [sc_core::SC_INFO] = "Info",
37  [sc_core::SC_WARNING] = "Warning",
38  [sc_core::SC_ERROR] = "Error",
39  [sc_core::SC_FATAL] = "Fatal"
40 };
41 
43 {
48 };
49 
50 std::map<std::string, ReportMsgInfo> &
52 {
53  static std::map<std::string, ReportMsgInfo> m;
54  return m;
55 }
56 
57 std::map<int, std::string> &
59 {
60  static std::map<int, std::string> m;
61  return m;
62 }
63 
65 
69 
72 
73 std::unique_ptr<sc_core::sc_report> globalReportCache;
74 
76 
78  std::initializer_list<std::pair<int, const char *>> msgs)
79 {
80  for (auto &p: msgs)
81  sc_core::sc_report::register_id(p.first, p.second);
82 }
83 
84 } // namespace sc_gem5
unsigned sc_actions
std::map< std::string, ReportMsgInfo > & reportMsgInfoMap()
Definition: report.cc:51
std::unique_ptr< sc_core::sc_report > globalReportCache
Definition: report.cc:73
sc_core::sc_actions reportSuppressedActions
Definition: report.cc:66
STL pair class.
Definition: stl.hh:61
Bitfield< 0 > m
int reportVerbosityLevel
Definition: report.cc:64
DefaultReportMessages(std::initializer_list< std::pair< int, const char *>>)
Definition: report.cc:77
std::map< int, std::string > & reportIdToMsgMap()
Definition: report.cc:58
sc_core::sc_actions reportCatchActions
Definition: report.cc:68
static void default_handler(const sc_report &, const sc_actions &)
void(* sc_report_handler_proc)(const sc_report &, const sc_actions &)
const char * reportSeverityNames[]
Definition: report.cc:35
sc_core::sc_report_handler_proc reportHandlerProc
Definition: report.cc:70
ReportSevInfo reportSevInfos[sc_core::SC_MAX_SEVERITY]
Definition: report.cc:42
sc_core::sc_actions reportForcedActions
Definition: report.cc:67
bool reportWarningsAsErrors
Definition: report.cc:75
static void register_id(int id, const char *msg)
Definition: sc_report.cc:120
Bitfield< 0 > p

Generated on Fri Feb 28 2020 16:27:06 for gem5 by doxygen 1.8.13