Gabe Black has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/13291
Change subject: systemc: Add an sc_gen_unique_name namespace to processes
as well.
......................................................................
systemc: Add an sc_gen_unique_name namespace to processes as well.
The standard says that there are namespaces for each module, and
one global namespace. Accellera also has namespaces for each process,
which shows up in the test output.
Change-Id: I4c8c5cecd5fb685d7bab521d9ae131aef23a6ab4
---
M src/systemc/core/process.hh
M src/systemc/core/sc_module.cc
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh
index 85a7a27..9bddbdd 100644
--- a/src/systemc/core/process.hh
+++ b/src/systemc/core/process.hh
@@ -36,6 +36,7 @@
#include "base/fiber.hh"
#include "systemc/core/list.hh"
+#include "systemc/core/module.hh"
#include "systemc/core/object.hh"
#include "systemc/core/sched_event.hh"
#include "systemc/core/sensitivity.hh"
@@ -131,6 +132,8 @@
void waitCount(int count) { _waitCount = count; }
+ const char *uniqueName(const char *seed) { return nameGen.gen(seed); }
+
protected:
void timeout();
@@ -191,6 +194,8 @@
std::unique_ptr<::sc_core::sc_report> _lastReport;
std::vector<::sc_core::sc_join *> joinWaiters;
+
+ UniqueNameGen nameGen;
};
} // namespace sc_gem5
diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc
index 1c3b54b..fe4b5cd 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -799,8 +799,12 @@
sc_gen_unique_name(const char *seed)
{
auto mod = sc_gem5::pickParentModule();
- return mod ? mod->uniqueName(seed) :
- ::sc_gem5::nameGen.gen(seed);
+ if (mod)
+ return mod->uniqueName(seed);
+ sc_gem5::Process *p = sc_gem5::scheduler.current();
+ if (p)
+ return p->uniqueName(seed);
+ return ::sc_gem5::nameGen.gen(seed);
}
bool
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13291
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: I4c8c5cecd5fb685d7bab521d9ae131aef23a6ab4
Gerrit-Change-Number: 13291
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev