Deleted Added
sdiff udiff text old ( 13620:e0d9b09788f6 ) new ( 13662:3e072654ca86 )
full compact
1/*
2 * Copyright (c) 2012, 2017 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

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

186
187std::map<std::string, EmbeddedPyBind *> &
188EmbeddedPyBind::getMap()
189{
190 static std::map<std::string, EmbeddedPyBind *> objs;
191 return objs;
192}
193
194void
195EmbeddedPyBind::initAll()
196{
197 std::list<EmbeddedPyBind *> pending;
198
199 py::module m_m5 = py::module("_m5");
200 m_m5.attr("__package__") = py::cast("_m5");
201
202 pybind_init_core(m_m5);

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

221 if (obj.depsReady()) {
222 obj.init(m_m5);
223 it = pending.erase(it);
224 } else {
225 ++it;
226 }
227 }
228 }
229}
230
231int
232initM5Python()
233{
234 EmbeddedPyBind::initAll();
235 return EmbeddedPython::initAll();
236}
237
238/*
239 * Make the commands array weak so that they can be overridden (used
240 * by unit tests to specify a different python main function.
241 */
242const char * __attribute__((weak)) m5MainCommands[] = {
243 "import m5",

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

302 }
303
304#if HAVE_PROTOBUF
305 google::protobuf::ShutdownProtobufLibrary();
306#endif
307
308 return 0;
309}
310
311PyMODINIT_FUNC
312initm5(void)
313{
314 initM5Python();
315 PyImport_ImportModule(PyCC("m5"));
316}