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>
from __future__ import print_function
+import argparse
import m5
+import os
import re
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)