Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/13290 )

Change subject: systemc: Add some error checks to the sc_module constructor.
......................................................................

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 <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/sc_module.cc
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Gabe Black: Looks good to me, approved; Looks good to me, approved



diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc
index 0954805..1c3b54b 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -221,7 +221,16 @@
 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))

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13290
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I8dfb4ce37bf0e59c6fa879f0afda5112af78b40b
Gerrit-Change-Number: 13290
Gerrit-PatchSet: 4
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Matthias Jung <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to