diff options
author | Gabe Black <gabeblack@google.com> | 2018-07-19 15:51:24 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-11 21:40:48 +0000 |
commit | a6c0e4623c6bb1077ca43c66663e039efb221bda (patch) | |
tree | 32054538eab1993856c1c9909c1a3e7c877d2092 /src/systemc/core/kernel.hh | |
parent | 544b136cbfbba53b6d97b763445e9f9b25eb2a7f (diff) | |
download | gem5-a6c0e4623c6bb1077ca43c66663e039efb221bda.tar.xz |
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 <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/kernel.hh')
-rw-r--r-- | src/systemc/core/kernel.hh | 24 |
1 files changed, 22 insertions, 2 deletions
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<Kernel, &Kernel::t0Handler> t0Event; }; -} // namespace SystemC +extern Kernel *kernel; + +} // namespace sc_gem5 #endif // __SYSTEMC_KERNEL_H__ |