main.py (11878:f9e3be6b1634) main.py (11923:d2f0605ac2af)
1# Copyright (c) 2016 ARM Limited
2# All rights reserved.
3#
4# The license below extends only to copyright in the software and shall
5# not be construed as granting a license to any other intellectual
6# property including but not limited to intellectual property relating
7# to a hardware implementation of the functionality of the software
8# licensed hereunder. You may use the software subject to the license
9# terms below provided that you ensure that this notice is replicated
10# unmodified and in its entirety in all distributions of the software,
11# modified or unmodified, in source code or in binary form.
12#
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 34 unchanged lines hidden (view full) ---

43 import config
44 from options import OptionParser
45
46 options = OptionParser(usage=usage, version=version,
47 description=brief_copyright)
48 option = options.add_option
49 group = options.set_group
50
13# Copyright (c) 2005 The Regents of The University of Michigan
14# All rights reserved.
15#
16# Redistribution and use in source and binary forms, with or without
17# modification, are permitted provided that the following conditions are
18# met: redistributions of source code must retain the above copyright
19# notice, this list of conditions and the following disclaimer;
20# redistributions in binary form must reproduce the above copyright

--- 34 unchanged lines hidden (view full) ---

55 import config
56 from options import OptionParser
57
58 options = OptionParser(usage=usage, version=version,
59 description=brief_copyright)
60 option = options.add_option
61 group = options.set_group
62
63 listener_modes = ( "on", "off", "auto" )
64
51 # Help options
52 option('-B', "--build-info", action="store_true", default=False,
53 help="Show build information")
54 option('-C', "--copyright", action="store_true", default=False,
55 help="Show full copyright information")
56 option('-R', "--readme", action="store_true", default=False,
57 help="Show the readme")
58
59 # Options for configuring the base simulator
60 option('-d', "--outdir", metavar="DIR", default="m5out",
61 help="Set the output directory to DIR [Default: %default]")
62 option('-r', "--redirect-stdout", action="store_true", default=False,
63 help="Redirect stdout (& stderr, without -e) to file")
64 option('-e', "--redirect-stderr", action="store_true", default=False,
65 help="Redirect stderr to file")
66 option("--stdout-file", metavar="FILE", default="simout",
67 help="Filename for -r redirection [Default: %default]")
68 option("--stderr-file", metavar="FILE", default="simerr",
69 help="Filename for -e redirection [Default: %default]")
65 # Help options
66 option('-B', "--build-info", action="store_true", default=False,
67 help="Show build information")
68 option('-C', "--copyright", action="store_true", default=False,
69 help="Show full copyright information")
70 option('-R', "--readme", action="store_true", default=False,
71 help="Show the readme")
72
73 # Options for configuring the base simulator
74 option('-d', "--outdir", metavar="DIR", default="m5out",
75 help="Set the output directory to DIR [Default: %default]")
76 option('-r', "--redirect-stdout", action="store_true", default=False,
77 help="Redirect stdout (& stderr, without -e) to file")
78 option('-e', "--redirect-stderr", action="store_true", default=False,
79 help="Redirect stderr to file")
80 option("--stdout-file", metavar="FILE", default="simout",
81 help="Filename for -r redirection [Default: %default]")
82 option("--stderr-file", metavar="FILE", default="simerr",
83 help="Filename for -e redirection [Default: %default]")
84 option("--listener-mode", metavar="{on,off,auto}",
85 choices=listener_modes, default="auto",
86 help="Port (e.g., gdb) listener mode (auto: Enable if running " \
87 "interactively) [Default: %default]")
70 option('-i', "--interactive", action="store_true", default=False,
71 help="Invoke the interactive interpreter after running the script")
72 option("--pdb", action="store_true", default=False,
73 help="Invoke the python debugger before running the script")
74 option('-p', "--path", metavar="PATH[:PATH]", action='append', split=':',
75 help="Prepend PATH to the system path when invoking the script")
76 option('-q', "--quiet", action="count", default=0,
77 help="Reduce verbosity")

--- 96 unchanged lines hidden (view full) ---

174 import core
175 import debug
176 import defines
177 import event
178 import info
179 import stats
180 import trace
181
88 option('-i', "--interactive", action="store_true", default=False,
89 help="Invoke the interactive interpreter after running the script")
90 option("--pdb", action="store_true", default=False,
91 help="Invoke the python debugger before running the script")
92 option('-p', "--path", metavar="PATH[:PATH]", action='append', split=':',
93 help="Prepend PATH to the system path when invoking the script")
94 option('-q', "--quiet", action="count", default=0,
95 help="Reduce verbosity")

--- 96 unchanged lines hidden (view full) ---

192 import core
193 import debug
194 import defines
195 import event
196 import info
197 import stats
198 import trace
199
182 from util import fatal
200 from util import inform, fatal, panic, isInteractive
183
184 if len(args) == 0:
185 options, arguments = parse_options()
186 elif len(args) == 2:
187 options, arguments = args
188 else:
189 raise TypeError, "main() takes 0 or 2 arguments (%d given)" % len(args)
190

--- 125 unchanged lines hidden (view full) ---

316 core.setOutputDir(options.outdir)
317
318 # update the system path with elements from the -p option
319 sys.path[0:0] = options.path
320
321 # set stats options
322 stats.addStatVisitor(options.stats_file)
323
201
202 if len(args) == 0:
203 options, arguments = parse_options()
204 elif len(args) == 2:
205 options, arguments = args
206 else:
207 raise TypeError, "main() takes 0 or 2 arguments (%d given)" % len(args)
208

--- 125 unchanged lines hidden (view full) ---

334 core.setOutputDir(options.outdir)
335
336 # update the system path with elements from the -p option
337 sys.path[0:0] = options.path
338
339 # set stats options
340 stats.addStatVisitor(options.stats_file)
341
342 # Disable listeners unless running interactively or explicitly
343 # enabled
344 if options.listener_mode == "off":
345 m5.disableAllListeners()
346 elif options.listener_mode == "auto":
347 if not isInteractive():
348 inform("Standard input is not a terminal, disabling listeners.")
349 m5.disableAllListeners()
350 elif options.listener_mode == "on":
351 pass
352 else:
353 panic("Unhandled listener mode: %s" % options.listener_mode)
354
324 # set debugging options
325 debug.setRemoteGDBPort(options.remote_gdb_port)
326 for when in options.debug_break:
327 debug.schedBreak(int(when))
328
329 if options.debug_flags:
330 check_tracing()
331

--- 85 unchanged lines hidden ---
355 # set debugging options
356 debug.setRemoteGDBPort(options.remote_gdb_port)
357 for when in options.debug_break:
358 debug.schedBreak(int(when))
359
360 if options.debug_flags:
361 check_tracing()
362

--- 85 unchanged lines hidden ---