diff options
author | Gabe Black <gabeblack@google.com> | 2018-05-31 18:42:07 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-08-15 01:27:11 +0000 |
commit | ab744f4709e8fa53354800a8b3fc155d57d87356 (patch) | |
tree | 854b0e251811007c53a989bcfaa50040912fde10 /src/systemc/core/sc_module_name.cc | |
parent | 32ffafe2f4bff69a780eb9062491daae3638a544 (diff) | |
download | gem5-ab744f4709e8fa53354800a8b3fc155d57d87356.tar.xz |
systemc: Construct and manage a module name stack.
Change-Id: I5f7f64d6c3d7e08ec6d2529f3c5d84fbfc2c421b
Reviewed-on: https://gem5-review.googlesource.com/10850
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/sc_module_name.cc')
-rw-r--r-- | src/systemc/core/sc_module_name.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/systemc/core/sc_module_name.cc b/src/systemc/core/sc_module_name.cc index 2646d431a..b55e50001 100644 --- a/src/systemc/core/sc_module_name.cc +++ b/src/systemc/core/sc_module_name.cc @@ -29,25 +29,26 @@ #include "base/logging.hh" +#include "systemc/core/module.hh" #include "systemc/ext/core/sc_module_name.hh" namespace sc_core { sc_module_name::sc_module_name(const char *name) : - _name(name), _on_the_stack(true) + _name(name), _gem5_module(new SystemC::Module(name)), _on_the_stack(true) { - warn("%s: Module name not added to stack.\n", __PRETTY_FUNCTION__); + _gem5_module->push(); } sc_module_name::sc_module_name(const sc_module_name &other) : - _name(other._name), _on_the_stack(false) + _name(other._name), _gem5_module(other._gem5_module), _on_the_stack(false) {} sc_module_name::~sc_module_name() { if (_on_the_stack) { - warn("%s: Module name not removed from stack.\n", __PRETTY_FUNCTION__); + _gem5_module->pop(); } } |