sc_main.cc (12990:19d91b53e04e) sc_main.cc (13038:7bf84150855b)
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

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

27 * Authors: Gabe Black
28 */
29
30#include <cstring>
31
32#include "base/fiber.hh"
33#include "base/logging.hh"
34#include "base/types.hh"
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

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

27 * Authors: Gabe Black
28 */
29
30#include <cstring>
31
32#include "base/fiber.hh"
33#include "base/logging.hh"
34#include "base/types.hh"
35#include "python/pybind11/pybind.hh"
36#include "sim/core.hh"
37#include "sim/eventq.hh"
38#include "sim/init.hh"
39#include "systemc/core/kernel.hh"
35#include "sim/core.hh"
36#include "sim/eventq.hh"
37#include "sim/init.hh"
38#include "systemc/core/kernel.hh"
39#include "systemc/core/python.hh"
40#include "systemc/core/scheduler.hh"
41#include "systemc/ext/core/sc_main.hh"
42#include "systemc/ext/utils/sc_report_handler.hh"
43
44// A weak symbol to detect if sc_main has been defined, and if so where it is.
45[[gnu::weak]] int sc_main(int argc, char *argv[]);
46
47namespace sc_core

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

108 // again later.
109 scMainCalled = true;
110
111 scMainFiber.run();
112}
113
114// Make our sc_main wrapper available in the internal _m5 python module under
115// the systemc submodule.
40#include "systemc/core/scheduler.hh"
41#include "systemc/ext/core/sc_main.hh"
42#include "systemc/ext/utils/sc_report_handler.hh"
43
44// A weak symbol to detect if sc_main has been defined, and if so where it is.
45[[gnu::weak]] int sc_main(int argc, char *argv[]);
46
47namespace sc_core

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

108 // again later.
109 scMainCalled = true;
110
111 scMainFiber.run();
112}
113
114// Make our sc_main wrapper available in the internal _m5 python module under
115// the systemc submodule.
116void
117systemc_pybind(pybind11::module &m_internal)
116
117struct InstallScMain : public ::sc_gem5::PythonInitFunc
118{
118{
119 pybind11::module m = m_internal.def_submodule("systemc");
120 m.def("sc_main", &sc_main);
121}
122EmbeddedPyBind embed_("systemc", &systemc_pybind);
119 void
120 run(pybind11::module &systemc) override
121 {
122 systemc.def("sc_main", &sc_main);
123 }
124} installScMain;
123
124sc_stop_mode _stop_mode = SC_STOP_FINISH_DELTA;
125
126} // anonymous namespace
127
128int
129sc_argc()
130{

--- 115 unchanged lines hidden ---
125
126sc_stop_mode _stop_mode = SC_STOP_FINISH_DELTA;
127
128} // anonymous namespace
129
130int
131sc_argc()
132{

--- 115 unchanged lines hidden ---