From 52c04aa51795fe6047a8ca9de940a28917d60608 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 15 Dec 2021 23:10:03 -0800 Subject: [PATCH] systemc: Eliminate the unused PythonReadyFunc mechanism. Change-Id: I8892e4d209901454f2ab923aa3fa9932d7963274 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54323 Maintainer: Gabe Black Reviewed-by: Jason Lowe-Power Tested-by: kokoro --- src/systemc/core/SystemC.py | 8 -------- src/systemc/core/python.cc | 20 -------------------- src/systemc/core/python.hh | 9 --------- 3 files changed, 37 deletions(-) diff --git a/src/systemc/core/SystemC.py b/src/systemc/core/SystemC.py index 682817502d..592b950b67 100644 --- a/src/systemc/core/SystemC.py +++ b/src/systemc/core/SystemC.py @@ -63,11 +63,3 @@ class SystemC_ScModule(SystemC_ScObject): @cxxMethod(return_value_policy="reference", cxx_name="gem5_getPort") def getPort(self, if_name, iex): return None - -try: - import _m5 -except: - pass -else: - import _m5.systemc - _m5.systemc.python_ready() diff --git a/src/systemc/core/python.cc b/src/systemc/core/python.cc index 8f2d56b0ac..2283ae7ea2 100644 --- a/src/systemc/core/python.cc +++ b/src/systemc/core/python.cc @@ -38,13 +38,6 @@ namespace sc_gem5 namespace { -PythonReadyFunc *& -firstReadyFunc() -{ - static PythonReadyFunc *first = nullptr; - return first; -} - PythonInitFunc *& firstInitFunc() { @@ -52,18 +45,10 @@ firstInitFunc() return first; } -void -python_ready(pybind11::args args) -{ - for (auto ptr = firstReadyFunc(); ptr; ptr = ptr->next) - ptr->run(); -} - void systemc_pybind(pybind11::module_ &m_internal) { pybind11::module_ m = m_internal.def_submodule("systemc"); - m.def("python_ready", &python_ready); for (auto ptr = firstInitFunc(); ptr; ptr = ptr->next) ptr->run(m); } @@ -71,11 +56,6 @@ gem5::EmbeddedPyBind embed_("systemc", &systemc_pybind); } // anonymous namespace -PythonReadyFunc::PythonReadyFunc() : next(firstReadyFunc()) -{ - firstReadyFunc() = this; -} - PythonInitFunc::PythonInitFunc() : next(firstInitFunc()) { firstInitFunc() = this; diff --git a/src/systemc/core/python.hh b/src/systemc/core/python.hh index 61c9c80d0c..5a3f6efece 100644 --- a/src/systemc/core/python.hh +++ b/src/systemc/core/python.hh @@ -33,15 +33,6 @@ namespace sc_gem5 { -struct PythonReadyFunc -{ - PythonReadyFunc *next; - - PythonReadyFunc(); - ~PythonReadyFunc() {} - virtual void run() = 0; -}; - struct PythonInitFunc { PythonInitFunc *next;