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

Change subject: systemc: Implement sc_hierarchical_name_exists.
......................................................................

systemc: Implement sc_hierarchical_name_exists.

This function checks the top level collection of events and objects
to find if one with a particular name exists.

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

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 4605093..0954805 100644
--- a/src/systemc/core/sc_module.cc
+++ b/src/systemc/core/sc_module.cc
@@ -32,8 +32,10 @@
 #include <vector>

 #include "base/logging.hh"
+#include "systemc/core/event.hh"
 #include "systemc/core/kernel.hh"
 #include "systemc/core/module.hh"
+#include "systemc/core/object.hh"
 #include "systemc/core/process_types.hh"
 #include "systemc/core/sensitivity.hh"
 #include "systemc/ext/channel/sc_signal_in_if.hh"
@@ -795,8 +797,8 @@
 bool
 sc_hierarchical_name_exists(const char *name)
 {
-    warn("%s not implemented.\n", __PRETTY_FUNCTION__);
-    return false;
+    return sc_gem5::findEvent(name) != sc_gem5::allEvents.end() ||
+        ::sc_gem5::findObject(name, sc_gem5::allObjects);
 }

 bool

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