Merge ktlim@zamp:/z/ktlim2/clean/newmem-merge
[gem5.git] / configs / test / test.py
index 2b5a6769f5e84476da99d8c108cc32db6742365e..2047d65af81e17f3d54aee4f980d3f28cf2290d6 100644 (file)
@@ -12,11 +12,14 @@ from FullO3Config import *
 parser = optparse.OptionParser(option_list=m5.standardOptions)
 
 parser.add_option("-c", "--cmd", default="hello")
+parser.add_option("-o", "--options", default="")
+parser.add_option("-i", "--input", default="")
 parser.add_option("-t", "--timing", action="store_true")
 parser.add_option("-d", "--detailed", action="store_true")
 parser.add_option("-m", "--maxtick", type="int")
 
 (options, args) = parser.parse_args()
+m5.setStandardOptions(options)
 
 if args:
     print "Error: script doesn't take any positional arguments"
@@ -27,7 +30,9 @@ this_dir = os.path.dirname(__file__)
 
 process = LiveProcess()
 process.executable = os.path.join(this_dir, options.cmd)
-process.cmd = options.cmd
+process.cmd = options.cmd + " " + options.options
+if options.input != "":
+    process.input = options.input
 
 magicbus = Bus()
 mem = PhysicalMemory()
@@ -54,5 +59,5 @@ if options.maxtick:
 else:
     exit_event = m5.simulate()
 
-print 'Exiting @ cycle', m5.curTick(), 'because', exit_event.getCause()
+print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()