52 _name(
name), _sc_mod(nullptr), _obj(nullptr), _ended(false),
53 _deprecatedConstructor(false), bindingIndex(0)
56 panic_if(_new_module,
"Previous module not finished.\n");
63 if (_new_module ==
this)
64 _new_module =
nullptr;
79 _modules.push_back(
this);
82 _new_module =
nullptr;
96 if (_modules.empty() || _modules.back() !=
this)
100 panic_if(_new_module,
"Pop with unfinished module.\n");
109 using namespace gem5;
111 "Trying to bind %d interfaces/ports to %d ports.\n",
112 proxies.size(),
ports.size());
114 auto proxyIt = proxies.begin();
115 auto portIt =
ports.begin();
117 for (; proxyIt != proxies.end(); proxyIt++, portIt++) {
118 auto proxy = *proxyIt;
120 if (proxy->interface())
121 port->vbind(*proxy->interface());
123 port->vbind(*proxy->port());
135 e->before_end_of_elaboration();
154 e->end_of_elaboration();
169 e->start_of_simulation();
184 e->end_of_simulation();
195 if (_modules.empty())
197 return _modules.back();
virtual void end_of_simulation()
virtual void before_end_of_elaboration()
virtual void start_of_simulation()
virtual void end_of_elaboration()
bool _deprecatedConstructor
sc_core::sc_module * sc_mod() const
std::vector<::sc_core::sc_export_base * > exports
sc_core::sc_module * _sc_mod
void beforeEndOfElaboration()
void bindPorts(std::vector< const ::sc_core::sc_bind_proxy * > &proxies)
const char * name() const
std::vector<::sc_core::sc_port_base * > ports
void finish(Object *this_obj)
sc_core::sc_object * sc_obj()
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::string csprintf(const char *format, const Args &...args)
const char SC_ID_MODULE_NAME_STACK_EMPTY_[]
const char SC_ID_END_MODULE_NOT_CALLED_[]
UniqueNameGen globalNameGen
static void popParentModule()
static void pushParentModule(Module *m)
Module * newModuleChecked()
std::list< Module * > allModules
#define SC_REPORT_WARNING(msg_type, msg)
#define SC_REPORT_ERROR(msg_type, msg)
const std::string & name()