def run_test(root):
# Called from tests/run.py
+ # Set the working directory in case we are executing from
+ # outside gem5's source tree
+ import os
+ os.chdir(os.path.join(os.path.dirname(__file__), "../"))
+
# Execute the script we are wrapping
- execfile('configs/learning_gem5/part1/simple.py')
+ execfile(srcpath('configs/learning_gem5/part1/simple.py'))
def run_test(root):
# Called from tests/run.py
+
+ # Set the working directory in case we are executing from
+ # outside gem5's source tree
+ import os
+ os.chdir(os.path.join(os.path.dirname(__file__), "../"))
+
# Add paths that we need
m5.util.addToPath('../configs/learning_gem5/part1')
m5.util.addToPath('../configs/common')
# For instance, sys.argv.append('--l2_size=512kB')
# Execute the script we are wrapping
- execfile('configs/learning_gem5/part1/two_level.py')
+ execfile(srcpath('configs/learning_gem5/part1/two_level.py'))
def run_test(root):
# Called from tests/run.py
+ # Set the working directory in case we are executing from
+ # outside gem5's source tree
+ import os
+ os.chdir(os.path.join(os.path.dirname(__file__), "../"))
+
# The path to this script is the only parameter. Delete it so
# we can execute the script that we want to execute.
import sys
sys.argv.append('-m %d' % maxtick)
# Execute the script we are wrapping
- execfile('configs/example/memcheck.py', globals())
+ execfile(srcpath('configs/example/memcheck.py'), globals())
file = app
return joinpath(test_progs, app, 'input', file)
+def srcpath(path):
+ """Path to file in gem5's source tree"""
+ return joinpath(os.path.dirname(__file__), "..", path)
+
# build configuration
sys.path.append(joinpath(tests_root, 'configs'))
test_filename = config