diff options
Diffstat (limited to 'src/systemc/core/module.cc')
-rw-r--r-- | src/systemc/core/module.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/systemc/core/module.cc b/src/systemc/core/module.cc index 0c118e0c5..78ce2c6fb 100644 --- a/src/systemc/core/module.cc +++ b/src/systemc/core/module.cc @@ -32,6 +32,7 @@ #include <cassert> #include "base/logging.hh" +#include "systemc/ext/core/sc_port.hh" #include "systemc/ext/utils/sc_report_handler.hh" namespace sc_gem5 @@ -85,6 +86,25 @@ Module::pop() _modules.pop_back(); } +void +Module::bindPorts(std::vector<const ::sc_core::sc_bind_proxy *> &proxies) +{ + panic_if(proxies.size() > ports.size(), + "Trying to bind %d interfaces/ports to %d ports.\n", + proxies.size(), ports.size()); + + auto proxyIt = proxies.begin(); + auto portIt = ports.begin(); + for (; proxyIt != proxies.end(); proxyIt++, portIt++) { + auto proxy = *proxyIt; + auto port = *portIt; + if (proxy->interface()) + port->vbind(*proxy->interface()); + else + port->vbind(*proxy->port()); + } +} + Module * currentModule() { |