summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-08-27 20:20:40 -0700
committerGabe Black <gabeblack@google.com>2018-09-26 00:03:44 +0000
commit457a086235862f8e01dfe0dad1177a756535ec51 (patch)
treeaec2899b9c0a184943908f95555be047495ed611 /src
parent542f62aa6f285c51119ce281bd76781b8b6e0776 (diff)
downloadgem5-457a086235862f8e01dfe0dad1177a756535ec51.tar.xz
systemc: Add a --working-dir option to the test config.py.
The tests expect to be run from a certain directory. Generally that doesn't matter, but in at least one case the test opens a file with a relative path, and that doesn't work unless CWD is what it expects. Change-Id: I34c0ed975e77daed50ace4f7eebd034bf04c5595 Reviewed-on: https://gem5-review.googlesource.com/12271 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/systemc/tests/config.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/systemc/tests/config.py b/src/systemc/tests/config.py
index 4b143d109..439a6828c 100755
--- a/src/systemc/tests/config.py
+++ b/src/systemc/tests/config.py
@@ -27,7 +27,9 @@
from __future__ import print_function
+import argparse
import m5
+import os
import re
from m5.objects import SystemC_Kernel, Root
@@ -37,6 +39,13 @@ from m5.objects import SystemC_Kernel, Root
kernel = SystemC_Kernel()
root = Root(full_system=True, systemc_kernel=kernel)
+parser = argparse.ArgumentParser()
+parser.add_argument('--working-dir')
+
+args = parser.parse_args()
+if args.working_dir:
+ os.chdir(args.working_dir)
+
kernel.sc_main("Hello", "World");
m5.instantiate(None)