From ea6b370fe79e043ed949033f9f3a4306b668aa94 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 25 Jul 2018 19:30:30 -0700 Subject: 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 Maintainer: Gabe Black --- src/systemc/core/process.cc | 13 +++++++++++++ src/systemc/core/process.hh | 8 ++++++++ 2 files changed, 21 insertions(+) (limited to 'src/systemc/core') 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 +#include #include #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 &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 -- cgit v1.2.3