Deleted Added
sdiff udiff text old ( 5773:7434b2271b0c ) new ( 5799:0af61da2b66a )
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

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

133set_group("Help Options")
134add_option("--list-sim-objects", action='store_true', default=False,
135 help="List all built-in SimObjects, their parameters and default values")
136
137def main():
138 import event
139 import info
140 import internal
141
142 # load the options.py config file to allow people to set their own
143 # default options
144 options_file = config.get('options.py')
145 if options_file:
146 scope = { 'options' : options }
147 execfile(options_file, scope)
148
149 arguments = options.parse_args()

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

216 if options.release_notes:
217 done = True
218 print 'Release Notes:'
219 print
220 print info.RELEASE_NOTES
221 print
222
223 if options.trace_help:
224 import traceflags
225
226 done = True
227 print "Base Flags:"
228 traceflags.baseFlags.sort()
229 print_list(traceflags.baseFlags, indent=4)
230 print
231 print "Compound Flags:"
232 traceflags.compoundFlags.sort()
233 for flag in traceflags.compoundFlags:
234 if flag == 'All':
235 continue
236 print " %s:" % flag
237 print_list(traceflags.compoundFlagMap[flag], indent=8)
238 print
239
240 if options.list_sim_objects:
241 import SimObject
242 done = True
243 print "SimObjects:"
244 objects = SimObject.allClasses.keys()
245 objects.sort()
246 for name in objects:

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

301 internal.stats.initText(options.stats_file)
302
303 # set debugging options
304 internal.debug.setRemoteGDBPort(options.remote_gdb_port)
305 for when in options.debug_break:
306 internal.debug.schedBreakCycle(int(when))
307
308 if options.trace_flags:
309 import traceflags
310
311 on_flags = []
312 off_flags = []
313 for flag in options.trace_flags:
314 off = False
315 if flag.startswith('-'):
316 flag = flag[1:]
317 off = True
318 if flag not in traceflags.allFlags and flag != "All":
319 print >>sys.stderr, "invalid trace flag '%s'" % flag
320 sys.exit(1)
321
322 if off:
323 off_flags.append(flag)
324 else:
325 on_flags.append(flag)
326
327 for flag in on_flags:
328 internal.trace.set(flag)
329
330 for flag in off_flags:
331 internal.trace.clear(flag)
332
333 if options.trace_start:
334 def enable_trace():
335 internal.trace.cvar.enabled = True
336
337 e = event.create(enable_trace)
338 event.mainq.schedule(e, options.trace_start)
339 else:
340 internal.trace.cvar.enabled = True
341
342 internal.trace.output(options.trace_file)
343
344 for ignore in options.trace_ignore:
345 internal.trace.ignore(ignore)
346
347 sys.argv = arguments
348 sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path
349
350 filename = sys.argv[0]
351 filedata = file(filename, 'r').read()
352 filecode = compile(filedata, filename, 'exec')
353 scope = { '__file__' : filename,

--- 51 unchanged lines hidden ---