diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-25 19:30:30 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-11 21:48:32 +0000 |
commit | ea6b370fe79e043ed949033f9f3a4306b668aa94 (patch) | |
tree | 199b1796e5ea9a12d2464d8b62fb7c7848fd229b /src/systemc/utils/sc_report.cc | |
parent | 802efef3c40a028b0048bc4b8985dcc9bf64322f (diff) | |
download | gem5-ea6b370fe79e043ed949033f9f3a4306b668aa94.tar.xz |
systemc: Implement most of the sc_report_handler mechanism.
This doesn't include support for the deprecated integer message ids.
Change-Id: I309d58df1cdc464428189eb0b7180edf41ca4f67
Reviewed-on: https://gem5-review.googlesource.com/12048
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/utils/sc_report.cc')
-rw-r--r-- | src/systemc/utils/sc_report.cc | 97 |
1 files changed, 26 insertions, 71 deletions
diff --git a/src/systemc/utils/sc_report.cc b/src/systemc/utils/sc_report.cc index 6edbf2a05..838488021 100644 --- a/src/systemc/utils/sc_report.cc +++ b/src/systemc/utils/sc_report.cc @@ -29,85 +29,47 @@ #include "base/logging.hh" #include "systemc/ext/utils/sc_report.hh" +#include "systemc/ext/utils/sc_report_handler.hh" namespace sc_core { -sc_report::sc_report(const sc_report &) +sc_report::sc_report(sc_severity _severity, const char *_msgType, + const char *_msg, int _verbosity, const char *_fileName, + int _lineNumber, sc_time _time, const char *_processName, int _id) : + _severity(_severity), _msgType(_msgType), _msg(_msg), + _verbosity(_verbosity), _fileName(_fileName), _lineNumber(_lineNumber), + _time(_time), _processName(_processName), _id(_id) { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); + _what = sc_report_compose_message(*this); } +sc_report::sc_report(const sc_report &r) : + sc_report(r._severity, r._msgType, r._msg, r._verbosity, r._fileName, + r._lineNumber, r._time, r._processName, r._id) +{} + sc_report & -sc_report::operator = (const sc_report &) -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); +sc_report::operator = (const sc_report &r) +{ + _severity = r._severity; + _msgType = r._msgType; + _msg = r._msg; + _verbosity = r._verbosity; + _fileName = r._fileName; + _lineNumber = r._lineNumber; + _time = r._time; + _processName = r._processName; + _id = r._id; return *this; } sc_report::~sc_report() throw() {} -sc_severity -sc_report::get_severity() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return SC_FATAL; -} - -const char * -sc_report::get_msg_type() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return ""; -} - -const char * -sc_report::get_msg() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return ""; -} - -int -sc_report::get_verbosity() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return SC_NONE; -} - -const char * -sc_report::get_file_name() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return ""; -} - -int -sc_report::get_line_number() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return 0; -} - -const sc_time & -sc_report::get_time() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return *(const sc_time *)nullptr; -} - -const char * -sc_report::get_process_name() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return ""; -} - const char * sc_report::what() const throw() { - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return ""; + return _what.c_str(); } const char * @@ -154,17 +116,10 @@ sc_report::suppress_warnings(bool) warn("%s not implemented.\n", __PRETTY_FUNCTION__); } -int -sc_report::get_id() const -{ - warn("%s not implemented.\n", __PRETTY_FUNCTION__); - return 0; -} - void sc_abort() { - panic("%s not implemented.\n", __PRETTY_FUNCTION__); + panic("simulation aborted"); } } // namespace sc_core |