summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-02 16:59:46 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 00:47:36 +0000
commit7ddf2336fec1540935ac5771e6fdd50e45473e23 (patch)
tree8a0bcd1c9c784bb695a4c137d6dd8d2f35ff18b7
parent3e92388fd56170c6a7f828a1505e24314ec8bf4c (diff)
downloadgem5-7ddf2336fec1540935ac5771e6fdd50e45473e23.tar.xz
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 <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
-rw-r--r--src/systemc/core/sc_module.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/systemc/core/sc_module.cc b/src/systemc/core/sc_module.cc
index 46050934e..0954805c8 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 @@ sc_gen_unique_name(const char *seed)
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