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
Reviewed-on: https://gem5-review.googlesource.com/c/13291
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
#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"
void waitCount(int count) { _waitCount = count; }
+ const char *uniqueName(const char *seed) { return nameGen.gen(seed); }
+
protected:
void timeout();
std::unique_ptr<::sc_core::sc_report> _lastReport;
std::vector<::sc_core::sc_join *> joinWaiters;
+
+ UniqueNameGen nameGen;
};
} // namespace sc_gem5
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