summaryrefslogtreecommitdiff
path: root/src/python/m5
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2019-02-20 16:36:57 -0800
committerGabe Black <gabeblack@google.com>2019-02-25 23:09:42 +0000
commit9bc9b2408395f93297a38aa1f54df562291f7752 (patch)
treebd7eee320d40045e37fa0db6a0a4c1a445e5d9fc /src/python/m5
parent055109800c5f65dcabd07c583c96a5fc20f86ce6 (diff)
downloadgem5-9bc9b2408395f93297a38aa1f54df562291f7752.tar.xz
systemc: Add m5.systemc and m5.tlm python modules.
These will be how systemc and tlm APIs which are not attached to SimObjects will be exposed. This avoids having to artificially attach them to wrapping SimObjects for instance, which is a bit awkward and non-obvious. The python code which attaches the systemc and tlm modules to the m5 modules lives in src/python/m5/__init__.py, but the modules themselves live in src/systemc/python to keep all the systemc code grouped together. It might be a little confusing to have a small part of the glue that adds those modules in a separate place (__init__.py), but that is, as far as I can tell, unavoidable, and it's better in my opinion to keep the systemc code grouped together than to put it alongside the other python code and __init__.py. Change-Id: Iecb218daec5e15772152b5ad22b51f43b86c3d4b Reviewed-on: https://gem5-review.googlesource.com/c/16563 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/python/m5')
-rw-r--r--src/python/m5/__init__.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index d97727cd8..8cad3b8d1 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -47,9 +47,13 @@ except ImportError:
if in_gem5:
from . import SimObject
from . import core
+ from . import defines
from . import objects
from . import params
from . import stats
+ if defines.buildEnv['USE_SYSTEMC']:
+ from . import systemc
+ from . import tlm
from . import util
from .event import *