summaryrefslogtreecommitdiff
path: root/src/systemc/core
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-07-25 19:30:30 -0700
committerGabe Black <gabeblack@google.com>2018-09-11 21:48:32 +0000
commitea6b370fe79e043ed949033f9f3a4306b668aa94 (patch)
tree199b1796e5ea9a12d2464d8b62fb7c7848fd229b /src/systemc/core
parent802efef3c40a028b0048bc4b8985dcc9bf64322f (diff)
downloadgem5-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/core')
-rw-r--r--src/systemc/core/process.cc13
-rw-r--r--src/systemc/core/process.hh8
2 files changed, 21 insertions, 0 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 39ee9e051..6a0e7d5a3 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -333,6 +333,19 @@ Process::ready()
scheduler.ready(this);
}
+void
+Process::lastReport(::sc_core::sc_report *report)
+{
+ if (report) {
+ _lastReport = std::unique_ptr<::sc_core::sc_report>(
+ new ::sc_core::sc_report(*report));
+ } else {
+ _lastReport = nullptr;
+ }
+}
+
+::sc_core::sc_report *Process::lastReport() const { return _lastReport.get(); }
+
Process::Process(const char *name, ProcessFuncWrapper *func,
bool _dynamic, bool needs_start) :
::sc_core::sc_object(name), excWrapper(nullptr), func(func),
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh
index 3b1fb4eb6..8abafbd69 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -31,6 +31,7 @@
#define __SYSTEMC_CORE_PROCESS_HH__
#include <functional>
+#include <memory>
#include <vector>
#include "base/fiber.hh"
@@ -44,6 +45,7 @@
#include "systemc/ext/core/sc_module.hh"
#include "systemc/ext/core/sc_port.hh"
#include "systemc/ext/core/sc_process_handle.hh"
+#include "systemc/ext/utils/sc_report.hh"
namespace sc_gem5
{
@@ -270,6 +272,7 @@ class Process : public ::sc_core::sc_object, public ListNode
bool needsStart() const { return _needsStart; }
bool dynamic() const { return _dynamic; }
bool isUnwinding() const { return _isUnwinding; }
+ void isUnwinding(bool v) { _isUnwinding = v; }
bool terminated() const { return _terminated; }
void forEachKid(const std::function<void(Process *)> &work);
@@ -318,6 +321,9 @@ class Process : public ::sc_core::sc_object, public ListNode
static Process *newest() { return _newest; }
+ void lastReport(::sc_core::sc_report *report);
+ ::sc_core::sc_report *lastReport() const;
+
protected:
Process(const char *name, ProcessFuncWrapper *func, bool _dynamic,
bool needs_start);
@@ -355,6 +361,8 @@ class Process : public ::sc_core::sc_object, public ListNode
PendingSensitivities pendingStaticSensitivities;
Sensitivity *dynamicSensitivity;
+
+ std::unique_ptr<::sc_core::sc_report> _lastReport;
};
inline void