gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
report.hh
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 #ifndef __SYSTEMC_UTILS_REPORT_HH__
29 #define __SYSTEMC_UTILS_REPORT_HH__
30 
31 #include <initializer_list>
32 #include <list>
33 #include <map>
34 #include <memory>
35 #include <string>
36 #include <utility>
37 
40 
41 namespace sc_gem5
42 {
43 
45 {
46  explicit ReportMsgInfo() :
50  sevCounts{0, 0, 0, 0}, sevLimits{-1, -1, -1, -1}, id(-1)
51  {}
52 
53  void
55  {
56  int sevLimit = sevLimits[severity];
57  int sevCount = sevCounts[severity];
58  if ((limit != -1 && limit >= count) ||
59  (sevLimit != 1 && sevLimit >= sevCount)) {
61  }
62  }
63 
65  int count;
66  int limit;
67 
71 
72  int id;
73 };
74 
76 {
78  actions(actions), count(0), limit(-1)
79  {}
80 
81  void
83  {
84  if (limit != -1 && limit >= count)
86  }
87 
89  int count;
90  int limit;
91 };
92 
95 
96 std::map<std::string, ReportMsgInfo> &reportMsgInfoMap();
97 std::map<int, std::string> &reportIdToMsgMap();
98 
99 extern int reportVerbosityLevel;
100 
104 
106 
107 // gem5-specific support for extra SystemC report handlers. Called _after_
108 // the default/set handler.
113 
114 extern std::unique_ptr<sc_core::sc_report> globalReportCache;
115 
116 extern bool reportWarningsAsErrors;
117 
119 {
120  public:
121  DefaultReportMessages(std::initializer_list<std::pair<int, const char *>>);
122 };
123 
124 } // namespace sc_gem5
125 
126 #endif // __SYSTEMC_UTILS_REPORT_HH__
sc_gem5::DefaultReportMessages::DefaultReportMessages
DefaultReportMessages(std::initializer_list< std::pair< int, const char * >>)
Definition: report.cc:100
sc_core::sc_actions
unsigned sc_actions
Definition: sc_report_handler.hh:39
sc_gem5::ReportSevInfo
Definition: report.hh:75
sc_core::sc_severity
sc_severity
Definition: sc_report.hh:39
sc_gem5::reportSeverityNames
const char * reportSeverityNames[]
Definition: report.cc:33
sc_core
Definition: messages.cc:31
sc_gem5::reportVerbosityLevel
int reportVerbosityLevel
Definition: report.cc:62
sc_gem5::getExtraSystemCReportHandlers
const std::list< sc_core::sc_report_handler_proc > & getExtraSystemCReportHandlers()
Definition: report.cc:79
sc_core::SC_MAX_SEVERITY
@ SC_MAX_SEVERITY
Definition: sc_report.hh:45
sc_gem5::ReportMsgInfo::actions
sc_core::sc_actions actions
Definition: report.hh:64
sc_gem5::ReportSevInfo::actions
sc_core::sc_actions actions
Definition: report.hh:88
sc_gem5::ReportSevInfo::count
int count
Definition: report.hh:89
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::addExtraSystemCReportHandler
void addExtraSystemCReportHandler(sc_core::sc_report_handler_proc proc)
Definition: report.cc:85
sc_gem5::ReportSevInfo::checkLimit
void checkLimit(sc_core::sc_actions &actions)
Definition: report.hh:82
sc_gem5::ReportMsgInfo::count
int count
Definition: report.hh:65
sc_core::SC_STOP
@ SC_STOP
Definition: sc_report_handler.hh:50
sc_gem5::ReportMsgInfo::sevLimits
int sevLimits[sc_core::SC_MAX_SEVERITY]
Definition: report.hh:70
sc_gem5::globalReportCache
std::unique_ptr< sc_core::sc_report > globalReportCache
Definition: report.cc:96
sc_gem5::DefaultReportMessages
Definition: report.hh:118
sc_gem5::ReportMsgInfo::ReportMsgInfo
ReportMsgInfo()
Definition: report.hh:46
sc_core::SC_UNSPECIFIED
@ SC_UNSPECIFIED
Definition: sc_report_handler.hh:43
sc_gem5::ReportMsgInfo::limit
int limit
Definition: report.hh:66
sc_gem5::reportMsgInfoMap
std::map< std::string, ReportMsgInfo > & reportMsgInfoMap()
Definition: report.cc:49
std::pair
STL pair class.
Definition: stl.hh:58
sc_gem5::ReportMsgInfo::sevCounts
int sevCounts[sc_core::SC_MAX_SEVERITY]
Definition: report.hh:69
sc_gem5::ReportMsgInfo::id
int id
Definition: report.hh:72
sc_gem5::reportWarningsAsErrors
bool reportWarningsAsErrors
Definition: report.cc:98
sc_gem5::ReportMsgInfo::sevActions
sc_core::sc_actions sevActions[sc_core::SC_MAX_SEVERITY]
Definition: report.hh:68
sc_gem5::reportForcedActions
sc_core::sc_actions reportForcedActions
Definition: report.cc:65
sc_report_handler.hh
sc_gem5::ReportMsgInfo::checkLimits
void checkLimits(sc_core::sc_severity severity, sc_core::sc_actions &actions)
Definition: report.hh:54
sc_core::sc_report_handler_proc
void(* sc_report_handler_proc)(const sc_report &, const sc_actions &)
Definition: sc_report_handler.hh:62
sc_gem5::removeExtraSystemCReportHandler
void removeExtraSystemCReportHandler(sc_core::sc_report_handler_proc proc)
Definition: report.cc:91
sc_gem5::reportIdToMsgMap
std::map< int, std::string > & reportIdToMsgMap()
Definition: report.cc:56
sc_gem5::ReportSevInfo::ReportSevInfo
ReportSevInfo(sc_core::sc_actions actions)
Definition: report.hh:77
sc_report.hh
sc_gem5::reportSuppressedActions
sc_core::sc_actions reportSuppressedActions
Definition: report.cc:64
sc_gem5
Definition: sc_clock.cc:41
sc_gem5::ReportMsgInfo
Definition: report.hh:44
sc_gem5::reportCatchActions
sc_core::sc_actions reportCatchActions
Definition: report.cc:66
std::list
STL list class.
Definition: stl.hh:51
sc_gem5::ReportSevInfo::limit
int limit
Definition: report.hh:90

Generated on Sun Jul 30 2023 01:57:03 for gem5 by doxygen 1.8.17