summaryrefslogtreecommitdiff
path: root/src/systemc/core
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-03 16:24:10 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:50:09 +0000
commit0686b8553381caf7ccd4ac7023ce1d419743ca54 (patch)
tree39f459a2a73d8ff829610940a7b51126e92179e6 /src/systemc/core
parent8946c9d52fc2d789844586867d047be69651ddd6 (diff)
downloadgem5-0686b8553381caf7ccd4ac7023ce1d419743ca54.tar.xz
systemc: Add some error checks to the sc_module constructor.
These match error checks which are already in, for instance, the sc_port constructor. Change-Id: I8dfb4ce37bf0e59c6fa879f0afda5112af78b40b Reviewed-on: https://gem5-review.googlesource.com/c/13290 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/sc_module.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc
index 0954805c8..1c3b54b98 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -221,7 +221,16 @@ sc_module::get_child_events() const
sc_module::sc_module() :
sc_object(sc_gem5::newModuleChecked()->name()),
_gem5_module(sc_gem5::currentModule())
-{}
+{
+ if (sc_is_running()) {
+ SC_REPORT_ERROR("(E529) insert module failed", "simulation running");
+ std::cout << "Running!\n";
+ }
+ if (::sc_gem5::scheduler.elaborationDone()) {
+ SC_REPORT_ERROR("(E529) insert module failed", "elaboration done");
+ std::cout << "Elaboration done!\n";
+ }
+}
sc_module::sc_module(const sc_module_name &) : sc_module() {}
sc_module::sc_module(const char *_name) : sc_module(sc_module_name(_name))