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/module.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/systemc/core/module.cc') diff --git a/src/systemc/core/module.cc b/src/systemc/core/module.cc index 3b7e922e3..e41e93285 100644 --- a/src/systemc/core/module.cc +++ b/src/systemc/core/module.cc @@ -51,6 +51,8 @@ Module::Module(const char *name) : _name(name), _sc_mod(nullptr), _obj(nullptr) _new_module = this; } +Module::~Module() { allModules.erase(this); } + void Module::finish(Object *this_obj) { @@ -58,6 +60,10 @@ Module::finish(Object *this_obj) _obj = this_obj; _modules.push_back(this); _new_module = nullptr; + // This is called from the constructor of this_obj, so it can't use + // dynamic cast. + sc_mod(static_cast<::sc_core::sc_module *>(this_obj->sc_obj())); + allModules.insert(this); } void @@ -84,4 +90,6 @@ newModule() return _new_module; } +std::set allModules; + } // namespace sc_gem5 -- cgit v1.2.3