From 55ea050d4823ca294db94d6a1f7f2fc35177e044 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 10 Jul 2006 23:00:13 -0400 Subject: Migrate most of main() and and all option parsing to python configs/test/fs.py: configs/test/test.py: update for the new way that m5 deals with options src/python/SConscript: Compile AUTHORS, LICENSE, README, and RELEASE_NOTES into the python stuff. src/python/m5/__init__.py: redo the way options work. Move them all to main.py src/sim/main.cc: Migrate more functionality for main() into python. Namely option parsing src/python/m5/attrdict.py: A dictionary object that overrides attribute access to do item access. src/python/m5/main.py: The new location for M5's option parsing, and the main() routine to set up the simulation. --HG-- extra : convert_revision : c86b87a9f508bde1994088e23fd470c7753ee4c1 --- configs/test/fs.py | 6 +++--- configs/test/test.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'configs') diff --git a/configs/test/fs.py b/configs/test/fs.py index cd894ab73..d191f7055 100644 --- a/configs/test/fs.py +++ b/configs/test/fs.py @@ -1,14 +1,14 @@ +import optparse, os, sys + import m5 from m5.objects import * -import os,optparse,sys from SysPaths import * -parser = optparse.OptionParser(option_list=m5.standardOptions) +parser = optparse.OptionParser() parser.add_option("-t", "--timing", action="store_true") (options, args) = parser.parse_args() -m5.setStandardOptions(options) if args: print "Error: script doesn't take any positional arguments" diff --git a/configs/test/test.py b/configs/test/test.py index e7b0971ef..a2c9f8bb0 100644 --- a/configs/test/test.py +++ b/configs/test/test.py @@ -4,15 +4,16 @@ # MIPS: "m5 test.py -a Mips -c hello_mips" import os, optparse, sys + import m5 from m5.objects import * from FullO3Config import * # parse command-line arguments -parser = optparse.OptionParser(option_list=m5.standardOptions) +parser = optparse.OptionParser() parser.add_option("-c", "--cmd", default="hello", - help="The binary to run in syscall emulation mode.") + help="The binary to run in syscall emulation mode.") parser.add_option("-o", "--options", default="", help="The options to pass to the binary, use \" \" around the entire\ string.") @@ -26,7 +27,6 @@ parser.add_option("-m", "--maxtick", type="int", help="Set the maximum number of ticks to run for") (options, args) = parser.parse_args() -m5.setStandardOptions(options) if args: print "Error: script doesn't take any positional arguments" -- cgit v1.2.3