From a6c0e4623c6bb1077ca43c66663e039efb221bda Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 19 Jul 2018 15:51:24 -0700 Subject: systemc: Implement the various sc_module stage callbacks. This change also gets rid of the SystemC namespace which was deprecated in favor of sc_gem5. A few utility functions which check whether certain callbacks have finished were also implemented. status tracking moved from a global variable in sc_main.cc to a member of the kernel simobject. Change-Id: I50967fae9c576fbe45b1faff587aaa824857a289 Reviewed-on: https://gem5-review.googlesource.com/12033 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/kernel.hh | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) (limited to 'src/systemc/core/kernel.hh') diff --git a/src/systemc/core/kernel.hh b/src/systemc/core/kernel.hh index 8cbf4fb3b..15641c510 100644 --- a/src/systemc/core/kernel.hh +++ b/src/systemc/core/kernel.hh @@ -32,8 +32,9 @@ #include "params/SystemC_Kernel.hh" #include "sim/sim_object.hh" +#include "systemc/ext/core/sc_main.hh" -namespace SystemC +namespace sc_gem5 { /* @@ -49,14 +50,33 @@ class Kernel : public SimObject typedef SystemC_KernelParams Params; Kernel(Params *params); + void init() override; + void regStats() override; void startup() override; void t0Handler(); + sc_core::sc_status status() { return _status; } + void status(sc_core::sc_status s) { _status = s; } + + void stop(); + + bool startOfSimulationComplete() { return _startComplete; } + bool endOfSimulationComplete() { return _endComplete; } + private: + bool _stopAfterCallbacks; + void stopWork(); + + bool _startComplete; + bool _endComplete; + sc_core::sc_status _status; + EventWrapper t0Event; }; -} // namespace SystemC +extern Kernel *kernel; + +} // namespace sc_gem5 #endif // __SYSTEMC_KERNEL_H__ -- cgit v1.2.3