summaryrefslogtreecommitdiff
path: root/configs/example/fs.py
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2009-09-22 15:24:16 -0700
committerNathan Binkert <nate@binkert.org>2009-09-22 15:24:16 -0700
commit9a8cb7db7e86c25a755f2e2817a0385b13e3ac32 (patch)
tree56c7b56824b967ad385b6e8890f345d18c102980 /configs/example/fs.py
parent0d58d32ad51eed32e6c7f9135b901006777fbe87 (diff)
downloadgem5-9a8cb7db7e86c25a755f2e2817a0385b13e3ac32.tar.xz
python: Move more code into m5.util allow SCons to use that code.
Get rid of misc.py and just stick misc things in __init__.py Move utility functions out of SCons files and into m5.util Move utility type stuff from m5/__init__.py to m5/util/__init__.py Remove buildEnv from m5 and allow access only from m5.defines Rename AddToPath to addToPath while we're moving it to m5.util Rename read_command to readCommand while we're moving it Rename compare_versions to compareVersions while we're moving it. --HG-- rename : src/python/m5/convert.py => src/python/m5/util/convert.py rename : src/python/m5/smartdict.py => src/python/m5/util/smartdict.py
Diffstat (limited to 'configs/example/fs.py')
-rw-r--r--configs/example/fs.py35
1 files changed, 20 insertions, 15 deletions
diff --git a/configs/example/fs.py b/configs/example/fs.py
index 3164b6fb4..23285e101 100644
--- a/configs/example/fs.py
+++ b/configs/example/fs.py
@@ -26,15 +26,20 @@
#
# Authors: Ali Saidi
-import optparse, os, sys
+import optparse
+import os
+import sys
import m5
+from m5.defines import buildEnv
+from m5.objects import *
+from m5.util import addToPath, fatal
-if not m5.build_env['FULL_SYSTEM']:
- m5.fatal("This script requires full-system mode (*_FS).")
+if not buildEnv['FULL_SYSTEM']:
+ fatal("This script requires full-system mode (*_FS).")
+
+addToPath('../common')
-from m5.objects import *
-m5.AddToPath('../common')
from FSConfig import *
from SysPaths import *
from Benchmarks import *
@@ -98,16 +103,16 @@ else:
np = options.num_cpus
-if m5.build_env['TARGET_ISA'] == "alpha":
+if buildEnv['TARGET_ISA'] == "alpha":
test_sys = makeLinuxAlphaSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "mips":
+elif buildEnv['TARGET_ISA'] == "mips":
test_sys = makeLinuxMipsSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "sparc":
+elif buildEnv['TARGET_ISA'] == "sparc":
test_sys = makeSparcSystem(test_mem_mode, bm[0])
-elif m5.build_env['TARGET_ISA'] == "x86":
+elif buildEnv['TARGET_ISA'] == "x86":
test_sys = makeLinuxX86System(test_mem_mode, np, bm[0])
else:
- m5.fatal("incapable of building non-alpha or non-sparc full system!")
+ fatal("incapable of building non-alpha or non-sparc full system!")
if options.kernel is not None:
test_sys.kernel = binary(options.kernel)
@@ -142,17 +147,17 @@ for i in xrange(np):
if options.fastmem:
test_sys.cpu[i].physmem_port = test_sys.physmem.port
-if m5.build_env['TARGET_ISA'] == 'mips':
+if buildEnv['TARGET_ISA'] == 'mips':
setMipsOptions(TestCPUClass)
if len(bm) == 2:
- if m5.build_env['TARGET_ISA'] == 'alpha':
+ if buildEnv['TARGET_ISA'] == 'alpha':
drive_sys = makeLinuxAlphaSystem(drive_mem_mode, bm[1])
- elif m5.build_env['TARGET_ISA'] == 'mips':
+ elif buildEnv['TARGET_ISA'] == 'mips':
drive_sys = makeLinuxMipsSystem(drive_mem_mode, bm[1])
- elif m5.build_env['TARGET_ISA'] == 'sparc':
+ elif buildEnv['TARGET_ISA'] == 'sparc':
drive_sys = makeSparcSystem(drive_mem_mode, bm[1])
- elif m5.build.env['TARGET_ISA'] == 'x86':
+ elif buildEnv['TARGET_ISA'] == 'x86':
drive_sys = makeX86System(drive_mem_mode, np, bm[1])
drive_sys.cpu = DriveCPUClass(cpu_id=0)
drive_sys.cpu.connectMemPorts(drive_sys.membus)