summaryrefslogtreecommitdiff
path: root/src/systemc/SystemC.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-05-02 19:56:29 -0700
committerGabe Black <gabeblack@google.com>2018-07-23 22:14:00 +0000
commit821b17583404f9c4843f6e9f1100352784dd4617 (patch)
tree9f9c03fc5ec3505169ca133ee18d152f888372dd /src/systemc/SystemC.py
parent7014f6948797efc74440d93a08285ddc1bca5d19 (diff)
downloadgem5-821b17583404f9c4843f6e9f1100352784dd4617.tar.xz
systemc: Hook up sc_main.
sc_main is exported as a python method on the SystemC_Kernel class and takes a series of string arguments. The internal c++ implementation converts those arguments into the standard argc and argv and uses them to call the standard SystemC version of that function. A weak SystemC version of sc_main is provided so that systemc will compile with or without a simulation provided version of that function. The weak version just complains and dies. Change-Id: Iad735536c37c8bc85d06cf24779f607ae4309b8b Reviewed-on: https://gem5-review.googlesource.com/10824 Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/SystemC.py')
-rw-r--r--src/systemc/SystemC.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/systemc/SystemC.py b/src/systemc/SystemC.py
index 8eb6c22a2..bc04ed69c 100644
--- a/src/systemc/SystemC.py
+++ b/src/systemc/SystemC.py
@@ -36,6 +36,11 @@ class SystemC_Kernel(SimObject):
cxx_class = 'SystemC::Kernel'
cxx_header = 'systemc/kernel.hh'
+ def sc_main(self, *args):
+ '''Call the systemc sc_main function with the given string args'''
+ from _m5.systemc import sc_main
+ sc_main(*args)
+
# This class represents systemc sc_object instances in python config files. It
# inherits from SimObject in python, but the c++ version, sc_core::sc_object,
# doesn't inherit from gem5's c++ SimObject class.