Deleted Added
sdiff udiff text old ( 3887:4a565b35bdee ) new ( 4042:dbd98b2264ed )
full compact
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

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

25# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26#
27# Authors: Nathan Binkert
28
29import code, optparse, os, socket, sys
30from datetime import datetime
31from attrdict import attrdict
32
33try:
34 import info
35except ImportError:
36 info = None
37
38__all__ = [ 'options', 'arguments', 'main' ]
39
40usage="%prog [m5 options] script.py [script options]"
41version="%prog 2.0"
42brief_copyright='''
43Copyright (c) 2001-2006
44The Regents of The University of Michigan
45All Rights Reserved

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

139 help="Cycle to create a breakpoint")
140
141# Tracing options
142set_group("Trace Options")
143add_option("--trace-flags", metavar="FLAG[,FLAG]", action='append', split=',',
144 help="Sets the flags for tracing")
145add_option("--trace-start", metavar="TIME", default='0s',
146 help="Start tracing at TIME (must have units)")
147add_option("--trace-cycle", metavar="CYCLE", default='0',
148 help="Start tracing at CYCLE")
149add_option("--trace-file", metavar="FILE", default="cout",
150 help="Sets the output file for tracing [Default: %default]")
151add_option("--trace-circlebuf", metavar="SIZE", type="int", default=0,
152 help="If SIZE is non-zero, turn on the circular buffer with SIZE lines")
153add_option("--no-trace-circlebuf", action="store_const", const=0,
154 dest='trace_circlebuf', help=optparse.SUPPRESS_HELP)
155bool_option("trace-dumponexit", default=False,
156 help="Dump trace buffer on exit")

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

206
207 del opts.quiet
208
209 options.update(opts)
210 arguments.extend(args)
211 return opts,args
212
213def main():
214 import internal
215
216 parse_args()
217
218 done = False
219 if options.copyright:
220 done = True
221 print info.LICENSE

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

273
274 # set stats options
275 objects.Statistics.text_file = options.stats_file
276
277 # set debugging options
278 for when in options.debug_break:
279 internal.debug.schedBreakCycle(int(when))
280
281 # set tracing options
282 objects.Trace.flags = options.trace_flags
283 objects.Trace.start = options.trace_start
284 objects.Trace.cycle = options.trace_cycle
285 objects.Trace.file = options.trace_file
286 objects.Trace.bufsize = options.trace_circlebuf
287 objects.Trace.dump_on_exit = options.trace_dumponexit
288 objects.Trace.ignore = options.trace_ignore
289
290 # set execution trace options
291 objects.ExecutionTrace.speculative = options.speculative
292 objects.ExecutionTrace.print_cycle = options.print_cycle
293 objects.ExecutionTrace.pc_symbol = options.print_symbol
294 objects.ExecutionTrace.print_opclass = options.print_opclass
295 objects.ExecutionTrace.print_thread = options.print_thread
296 objects.ExecutionTrace.print_effaddr = options.print_effaddr
297 objects.ExecutionTrace.print_data = options.print_data

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

304 sys.argv = arguments
305 sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path
306
307 scope = { '__file__' : sys.argv[0],
308 '__name__' : '__m5_main__' }
309
310 # we want readline if we're doing anything interactive
311 if options.interactive or options.pdb:
312 exec("import readline", scope)
313
314 # if pdb was requested, execfile the thing under pdb, otherwise,
315 # just do the execfile normally
316 if options.pdb:
317 from pdb import Pdb
318 debugger = Pdb()
319 debugger.run('execfile("%s")' % sys.argv[0], scope)
320 else:

--- 18 unchanged lines hidden ---