summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-01-19 09:59:15 -0800
committerNathan Binkert <nate@binkert.org>2009-01-19 09:59:15 -0800
commitda14789c32e14c62cdb0e11957607955e2a19c8a (patch)
tree7ff270c1a9e8547ea28fdf809941f27764977c05 /src
parentc9d3113015c69766f65851addf41172b9bc046b2 (diff)
downloadgem5-da14789c32e14c62cdb0e11957607955e2a19c8a.tar.xz
python: Try to isolate the stuff that's in the m5.internal package a bit more.
Diffstat (limited to 'src')
-rw-r--r--src/python/SConscript2
-rw-r--r--src/python/m5/__init__.py1
-rw-r--r--src/python/m5/core.py5
-rw-r--r--src/python/m5/debug.py3
-rw-r--r--src/python/m5/main.py34
5 files changed, 28 insertions, 17 deletions
diff --git a/src/python/SConscript b/src/python/SConscript
index 726254c1d..a767545ec 100644
--- a/src/python/SConscript
+++ b/src/python/SConscript
@@ -39,6 +39,8 @@ PySource('m5', 'm5/__init__.py')
PySource('m5', 'm5/SimObject.py')
PySource('m5', 'm5/config.py')
PySource('m5', 'm5/convert.py')
+PySource('m5', 'm5/core.py')
+PySource('m5', 'm5/debug.py')
PySource('m5', 'm5/event.py')
PySource('m5', 'm5/main.py')
PySource('m5', 'm5/options.py')
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index 4151d1a13..3a6d39499 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -93,6 +93,7 @@ if internal:
from simulate import *
from main import options, main
import stats
+ import core
import SimObject
import params
diff --git a/src/python/m5/core.py b/src/python/m5/core.py
new file mode 100644
index 000000000..34590016e
--- /dev/null
+++ b/src/python/m5/core.py
@@ -0,0 +1,5 @@
+import internal
+
+def setOutputDir(dir):
+ internal.core.setOutputDir(dir)
+
diff --git a/src/python/m5/debug.py b/src/python/m5/debug.py
new file mode 100644
index 000000000..74c397562
--- /dev/null
+++ b/src/python/m5/debug.py
@@ -0,0 +1,3 @@
+import internal
+
+from internal.debug import schedBreakCycle, setRemoteGDBPort
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 4e9714705..19ceaf10d 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -135,9 +135,12 @@ add_option("--list-sim-objects", action='store_true', default=False,
help="List all built-in SimObjects, their parameters and default values")
def main():
+ import core
+ import debug
+ import defines
import event
import info
- import internal
+ import stats
import trace
def check_tracing():
@@ -185,19 +188,17 @@ def main():
done = False
if options.build_info:
- import defines
-
done = True
print 'Build information:'
print
- print 'compiled %s' % internal.core.cvar.compileDate;
- print "revision %s" % internal.core.cvar.hgRev
- print "commit date %s" % internal.core.cvar.hgDate
+ print 'compiled %s' % defines.compileDate;
+ print "revision %s:%s" % (defines.hgRev, defines.hgId)
+ print "commit date %s" % defines.hgDate
print 'build options:'
- keys = defines.m5_build_env.keys()
+ keys = defines.buildEnv.keys()
keys.sort()
for key in keys:
- val = defines.m5_build_env[key]
+ val = defines.buildEnv[key]
print ' %s = %s' % (key, val)
print
@@ -265,9 +266,10 @@ def main():
print "M5 Simulator System"
print brief_copyright
print
- print "M5 compiled %s" % internal.core.cvar.compileDate;
- print "M5 revision %s" % internal.core.cvar.hgRev
- print "M5 commit date %s" % internal.core.cvar.hgDate
+
+ print "M5 compiled %s" % defines.compileDate;
+ print "M5 revision %s:%s" % (defines.hgRev, defines.hgId)
+ print "M5 commit date %s" % defines.hgDate
print "M5 started %s" % datetime.datetime.now().strftime("%b %e %Y %X")
print "M5 executing on %s" % socket.gethostname()
@@ -285,20 +287,18 @@ def main():
options.usage(2)
# tell C++ about output directory
- internal.core.setOutputDir(options.outdir)
+ core.setOutputDir(options.outdir)
# update the system path with elements from the -p option
sys.path[0:0] = options.path
- import objects
-
# set stats options
- internal.stats.initText(options.stats_file)
+ stats.initText(options.stats_file)
# set debugging options
- internal.debug.setRemoteGDBPort(options.remote_gdb_port)
+ debug.setRemoteGDBPort(options.remote_gdb_port)
for when in options.debug_break:
- internal.debug.schedBreakCycle(int(when))
+ debug.schedBreakCycle(int(when))
if options.trace_flags:
check_tracing()