python: Get rid of some unused cruft in main.py.

There was some code at the end of main.py which would let you run it
directly. This would parse options passed to the script, and show you
what they equaled.

Also, the "main" function would optionally let you pass in options to
override whatever it would find with parse_arguments. This is no longer
used.

Change-Id: Ib0effa7ac2b4a51b68994372a7c7fcf1c9b4dc13
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50707
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-09-20 16:51:52 -07:00
parent f42ce27065
commit 011dc236d3

View File

@@ -214,7 +214,7 @@ def _check_tracing():
fatal("Tracing is not enabled. Compile with TRACING_ON")
def main(*args):
def main():
import m5
import _m5.core
@@ -229,12 +229,7 @@ def main(*args):
from .util import inform, fatal, panic, isInteractive
from m5.util.terminal_formatter import TerminalFormatter
if len(args) == 0:
options, arguments = parse_options()
elif len(args) == 2:
options, arguments = args
else:
raise TypeError("main() takes 0 or 2 arguments (%d given)" % len(args))
options, arguments = parse_options()
m5.options = options
@@ -462,15 +457,3 @@ def main(*args):
# once the script is done
if options.interactive:
interact(scope)
if __name__ == '__main__':
from pprint import pprint
options, arguments = parse_options()
print('opts:')
pprint(options, indent=4)
print()
print('args:')
pprint(arguments, indent=4)