summaryrefslogtreecommitdiff
path: root/src/systemc/core/SystemC.py
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-02-15 07:58:05 -0800
committerGabe Black <gabeblack@google.com>2019-02-25 23:08:58 +0000
commit296f5219da6a2927e84fb748f7f74018c0c1f32e (patch)
tree51828b05180c1265fb184b6ccca71a1939ab39dd /src/systemc/core/SystemC.py
parent576e5714e81d09868f8a4695443a924faab02b93 (diff)
downloadgem5-296f5219da6a2927e84fb748f7f74018c0c1f32e.tar.xz
systemc: Export the sc_core::sc_time class to python.
This class isn't incredibly useful in python, but it's needed to call some other functions which are more useful. Change-Id: I5c23cca0b50f0455423399db8b009bdf86a6ec41 Reviewed-on: https://gem5-review.googlesource.com/c/16502 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/SystemC.py')
-rw-r--r--src/systemc/core/SystemC.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/systemc/core/SystemC.py b/src/systemc/core/SystemC.py
index 7ab33ea71..7afbd285b 100644
--- a/src/systemc/core/SystemC.py
+++ b/src/systemc/core/SystemC.py
@@ -36,6 +36,12 @@ class SystemC_Kernel(SimObject):
cxx_class = 'sc_gem5::Kernel'
cxx_header = 'systemc/core/kernel.hh'
+ # The sc_time type won't exist until some setup code runs in gem5.
+ try:
+ from _m5.systemc import sc_time
+ except:
+ pass
+
class ScMainResult(object):
def __init__(self, code, message):
self.code = code