module.cc (13268:9802f3e0a6ae) | module.cc (13291:ccbae1f89cd3) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 35 unchanged lines hidden (view full) --- 44 45std::list<Module *> _modules; 46Module *_new_module; 47 48} // anonymous namespace 49 50Module::Module(const char *name) : 51 _name(name), _sc_mod(nullptr), _obj(nullptr), _ended(false), | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 35 unchanged lines hidden (view full) --- 44 45std::list<Module *> _modules; 46Module *_new_module; 47 48} // anonymous namespace 49 50Module::Module(const char *name) : 51 _name(name), _sc_mod(nullptr), _obj(nullptr), _ended(false), |
52 _deprecatedConstructor(false) | 52 _deprecatedConstructor(false), bindingIndex(0) |
53{ 54 panic_if(_new_module, "Previous module not finished.\n"); 55 _new_module = this; 56} 57 58Module::~Module() 59{ 60 // Aborted module construction? --- 43 unchanged lines hidden (view full) --- 104Module::bindPorts(std::vector<const ::sc_core::sc_bind_proxy *> &proxies) 105{ 106 panic_if(proxies.size() > ports.size(), 107 "Trying to bind %d interfaces/ports to %d ports.\n", 108 proxies.size(), ports.size()); 109 110 auto proxyIt = proxies.begin(); 111 auto portIt = ports.begin(); | 53{ 54 panic_if(_new_module, "Previous module not finished.\n"); 55 _new_module = this; 56} 57 58Module::~Module() 59{ 60 // Aborted module construction? --- 43 unchanged lines hidden (view full) --- 104Module::bindPorts(std::vector<const ::sc_core::sc_bind_proxy *> &proxies) 105{ 106 panic_if(proxies.size() > ports.size(), 107 "Trying to bind %d interfaces/ports to %d ports.\n", 108 proxies.size(), ports.size()); 109 110 auto proxyIt = proxies.begin(); 111 auto portIt = ports.begin(); |
112 portIt += bindingIndex; |
|
112 for (; proxyIt != proxies.end(); proxyIt++, portIt++) { 113 auto proxy = *proxyIt; 114 auto port = *portIt; 115 if (proxy->interface()) 116 port->vbind(*proxy->interface()); 117 else 118 port->vbind(*proxy->port()); 119 } | 113 for (; proxyIt != proxies.end(); proxyIt++, portIt++) { 114 auto proxy = *proxyIt; 115 auto port = *portIt; 116 if (proxy->interface()) 117 port->vbind(*proxy->interface()); 118 else 119 port->vbind(*proxy->port()); 120 } |
121 bindingIndex += proxies.size(); |
|
120} 121 122void 123Module::beforeEndOfElaboration() 124{ 125 pushParentModule(this); 126 try { 127 _sc_mod->before_end_of_elaboration(); --- 88 unchanged lines hidden --- | 122} 123 124void 125Module::beforeEndOfElaboration() 126{ 127 pushParentModule(this); 128 try { 129 _sc_mod->before_end_of_elaboration(); --- 88 unchanged lines hidden --- |