From a61426dcc4a7f775f0902ba272501e926aeec13f Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Thu, 4 Oct 2018 17:45:34 -0700 Subject: [PATCH] systemc: Keep track of progress when positionally binding. Positionally binding more than once (like with the deprecated comma or << operators) should pick up where it left off the last time instead of starting again from the beginning. Change-Id: Ifc33520d6ce40544bd0ad80a5657b1a38a7914e4 Reviewed-on: https://gem5-review.googlesource.com/c/13297 Reviewed-by: Gabe Black Maintainer: Gabe Black --- src/systemc/core/module.cc | 4 +++- src/systemc/core/module.hh | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/systemc/core/module.cc b/src/systemc/core/module.cc index f342b7f05..8cbde8f70 100644 --- a/src/systemc/core/module.cc +++ b/src/systemc/core/module.cc @@ -49,7 +49,7 @@ Module *_new_module; Module::Module(const char *name) : _name(name), _sc_mod(nullptr), _obj(nullptr), _ended(false), - _deprecatedConstructor(false) + _deprecatedConstructor(false), bindingIndex(0) { panic_if(_new_module, "Previous module not finished.\n"); _new_module = this; @@ -109,6 +109,7 @@ Module::bindPorts(std::vector &proxies) auto proxyIt = proxies.begin(); auto portIt = ports.begin(); + portIt += bindingIndex; for (; proxyIt != proxies.end(); proxyIt++, portIt++) { auto proxy = *proxyIt; auto port = *portIt; @@ -117,6 +118,7 @@ Module::bindPorts(std::vector &proxies) else port->vbind(*proxy->port()); } + bindingIndex += proxies.size(); } void diff --git a/src/systemc/core/module.hh b/src/systemc/core/module.hh index 695f30565..8d6df81e6 100644 --- a/src/systemc/core/module.hh +++ b/src/systemc/core/module.hh @@ -125,6 +125,8 @@ class Module std::vector<::sc_core::sc_port_base *> ports; std::vector<::sc_core::sc_export_base *> exports; + int bindingIndex; + void beforeEndOfElaboration(); void endOfElaboration(); void startOfSimulation(); -- 2.30.2