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

Change subject: systemc: sc_spawn can create static or dynamic processes.
......................................................................

systemc: sc_spawn can create static or dynamic processes.

Their status depends on when sc_spawn is run.

Change-Id: I826adf9d5c905687e705642130ca5ad725ce92af
Reviewed-on: https://gem5-review.googlesource.com/c/12441
Reviewed-by: Gabe Black <[email protected]>
Maintainer: Gabe Black <[email protected]>
---
M src/systemc/core/sc_spawn.cc
1 file changed, 7 insertions(+), 2 deletions(-)

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



diff --git a/src/systemc/core/sc_spawn.cc b/src/systemc/core/sc_spawn.cc
index ecb0bbc..054feb8 100644
--- a/src/systemc/core/sc_spawn.cc
+++ b/src/systemc/core/sc_spawn.cc
@@ -31,6 +31,7 @@
 #include "systemc/core/process.hh"
 #include "systemc/core/process_types.hh"
 #include "systemc/core/scheduler.hh"
+#include "systemc/ext/core/sc_main.hh"
 #include "systemc/ext/core/sc_module.hh"
 #include "systemc/ext/core/sc_spawn.hh"

@@ -59,11 +60,15 @@
             name = ::sc_core::sc_gen_unique_name("thread_p");
     }

+    bool dynamic =
+        (::sc_core::sc_get_status() >
+         ::sc_core::SC_BEFORE_END_OF_ELABORATION);
+
     Process *proc;
     if (method)
-        proc = new Method(name, func, true);
+        proc = new Method(name, func, dynamic);
     else
-        proc = new Thread(name, func, true);
+        proc = new Thread(name, func, dynamic);

     if (opts) {
         for (auto e: opts->_events)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12441
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: I826adf9d5c905687e705642130ca5ad725ce92af
Gerrit-Change-Number: 12441
Gerrit-PatchSet: 7
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