module.cc (13191:a2254693aa5b) module.cc (13207:034ca389a810)
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

--- 99 unchanged lines hidden (view full) ---

108 }
109}
110
111void
112Module::beforeEndOfElaboration()
113{
114 callbackModule(this);
115 _sc_mod->before_end_of_elaboration();
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

--- 99 unchanged lines hidden (view full) ---

108 }
109}
110
111void
112Module::beforeEndOfElaboration()
113{
114 callbackModule(this);
115 _sc_mod->before_end_of_elaboration();
116 for (auto p: ports)
117 p->before_end_of_elaboration();
118 for (auto e: exports)
119 e->before_end_of_elaboration();
120 callbackModule(nullptr);
121}
122
123void
124Module::endOfElaboration()
125{
126 if (_deprecatedConstructor && !_ended) {
127 std::string msg = csprintf("module '%s'", name());
128 SC_REPORT_WARNING("(W509) module construction not properly completed: "
129 "did you forget to add a sc_module_name parameter to "
130 "your module constructor?", msg.c_str());
131 }
132 callbackModule(this);
133 _sc_mod->end_of_elaboration();
116 for (auto e: exports)
117 e->before_end_of_elaboration();
118 callbackModule(nullptr);
119}
120
121void
122Module::endOfElaboration()
123{
124 if (_deprecatedConstructor && !_ended) {
125 std::string msg = csprintf("module '%s'", name());
126 SC_REPORT_WARNING("(W509) module construction not properly completed: "
127 "did you forget to add a sc_module_name parameter to "
128 "your module constructor?", msg.c_str());
129 }
130 callbackModule(this);
131 _sc_mod->end_of_elaboration();
134 for (auto p: ports)
135 p->end_of_elaboration();
136 for (auto e: exports)
137 e->end_of_elaboration();
138 callbackModule(nullptr);
139}
140
141void
142Module::startOfSimulation()
143{
144 callbackModule(this);
145 _sc_mod->start_of_simulation();
132 for (auto e: exports)
133 e->end_of_elaboration();
134 callbackModule(nullptr);
135}
136
137void
138Module::startOfSimulation()
139{
140 callbackModule(this);
141 _sc_mod->start_of_simulation();
146 for (auto p: ports)
147 p->start_of_simulation();
148 for (auto e: exports)
149 e->start_of_simulation();
150 callbackModule(nullptr);
151}
152
153void
154Module::endOfSimulation()
155{
156 callbackModule(this);
157 _sc_mod->end_of_simulation();
142 for (auto e: exports)
143 e->start_of_simulation();
144 callbackModule(nullptr);
145}
146
147void
148Module::endOfSimulation()
149{
150 callbackModule(this);
151 _sc_mod->end_of_simulation();
158 for (auto p: ports)
159 p->end_of_simulation();
160 for (auto e: exports)
161 e->end_of_simulation();
162 callbackModule(nullptr);
163}
164
165Module *
166currentModule()
167{

--- 28 unchanged lines hidden ---
152 for (auto e: exports)
153 e->end_of_simulation();
154 callbackModule(nullptr);
155}
156
157Module *
158currentModule()
159{

--- 28 unchanged lines hidden ---