summaryrefslogtreecommitdiff
path: root/src/systemc/core/SystemC.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/systemc/core/SystemC.py')
-rw-r--r--src/systemc/core/SystemC.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/systemc/core/SystemC.py b/src/systemc/core/SystemC.py
index 13ef4eb98..49b569b0c 100644
--- a/src/systemc/core/SystemC.py
+++ b/src/systemc/core/SystemC.py
@@ -36,11 +36,22 @@ class SystemC_Kernel(SimObject):
cxx_class = 'sc_gem5::Kernel'
cxx_header = 'systemc/core/kernel.hh'
+ class ScMainResult(object):
+ def __init__(self, code, message):
+ self.code = code
+ self.message = message
+
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)
+ def sc_main_result(self):
+ '''Retrieve and return the results of running sc_main'''
+ from _m5.systemc import sc_main_result_code, sc_main_result_str
+ return SystemC_Kernel.ScMainResult(
+ sc_main_result_code(), sc_main_result_str());
+
# 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.