Deleted Added
sdiff udiff text old ( 4046:ef34b290091e ) new ( 4053:ee914b22709e )
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

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

24# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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
33__all__ = [ 'options', 'arguments', 'main' ]
34
35usage="%prog [m5 options] script.py [script options]"
36version="%prog 2.0"
37brief_copyright='''
38Copyright (c) 2001-2006
39The Regents of The University of Michigan
40All Rights Reserved
41'''
42
43# there's only one option parsing done, so make it global and add some
44# helper functions to make it work well.
45parser = optparse.OptionParser(usage=usage, version=version,
46 description=brief_copyright,
47 formatter=optparse.TitledHelpFormatter())
48parser.disable_interspersed_args()
49
50# current option group

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

130
131# Debugging options
132set_group("Debugging Options")
133add_option("--debug-break", metavar="TIME[,TIME]", action='append', split=',',
134 help="Cycle to create a breakpoint")
135
136# Tracing options
137set_group("Trace Options")
138add_option("--trace-flags", metavar="FLAG[,FLAG]", action='append', split=',',
139 help="Sets the flags for tracing")
140add_option("--trace-start", metavar="TIME", type='int',
141 help="Start tracing at TIME (must be in ticks)")
142add_option("--trace-file", metavar="FILE", default="cout",
143 help="Sets the output file for tracing [Default: %default]")
144add_option("--trace-ignore", metavar="EXPR", action='append', split=':',
145 help="Ignore EXPR sim objects")
146
147# Execution Trace options

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

226
227 if options.release_notes:
228 done = True
229 print 'Release Notes:'
230 print
231 print info.RELEASE_NOTES
232 print
233
234 if done:
235 sys.exit(0)
236
237 if options.verbose >= 0:
238 print "M5 Simulator System"
239 print brief_copyright
240 print
241 print "M5 compiled %s" % internal.main.cvar.compileDate;
242 print "M5 started %s" % datetime.now().ctime()
243 print "M5 executing on %s" % socket.gethostname()
244 print "command line:",
245 for argv in sys.argv:
246 print argv,
247 print
248
249 # check to make sure we can find the listed script
250 if not arguments or not os.path.isfile(arguments[0]):
251 if arguments and not os.path.isfile(arguments[0]):
252 print "Script %s not found" % arguments[0]
253 usage(2)
254
255 # tell C++ about output directory
256 internal.main.setOutputDir(options.outdir)
257
258 # update the system path with elements from the -p option
259 sys.path[0:0] = options.path
260
261 import objects
262
263 # set stats options
264 objects.Statistics.text_file = options.stats_file
265
266 # set debugging options
267 for when in options.debug_break:
268 internal.debug.schedBreakCycle(int(when))
269
270 for flag in options.trace_flags:
271 internal.trace.set(flag)
272
273 if options.trace_start is not None:
274 internal.trace.enabled = False
275 def enable_trace():
276 internal.event.enabled = True
277 internal.event.create(enable_trace, options.trace_start)
278
279 internal.trace.output(options.trace_file)
280

--- 52 unchanged lines hidden ---