main.py (9512:d367034c7e3c) main.py (9960:501c7384a5bc)
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

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

90 option("--json-config", metavar="FILE", default="config.json",
91 help="Create JSON output of the configuration [Default: %default]")
92 option("--dot-config", metavar="FILE", default="config.dot",
93 help="Create DOT & pdf outputs of the configuration [Default: %default]")
94
95 # Debugging options
96 group("Debugging Options")
97 option("--debug-break", metavar="TIME[,TIME]", action='append', split=',',
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

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

90 option("--json-config", metavar="FILE", default="config.json",
91 help="Create JSON output of the configuration [Default: %default]")
92 option("--dot-config", metavar="FILE", default="config.dot",
93 help="Create DOT & pdf outputs of the configuration [Default: %default]")
94
95 # Debugging options
96 group("Debugging Options")
97 option("--debug-break", metavar="TIME[,TIME]", action='append', split=',',
98 help="Cycle to create a breakpoint")
98 help="Tick to create a breakpoint")
99 option("--debug-help", action='store_true',
99 option("--debug-help", action='store_true',
100 help="Print help on trace flags")
100 help="Print help on debug flags")
101 option("--debug-flags", metavar="FLAG[,FLAG]", action='append', split=',',
101 option("--debug-flags", metavar="FLAG[,FLAG]", action='append', split=',',
102 help="Sets the flags for tracing (-FLAG disables a flag)")
102 help="Sets the flags for debug output (-FLAG disables a flag)")
103 option("--debug-start", metavar="TIME", type='int',
104 help="Start debug output at TIME (must be in ticks)")
105 option("--debug-file", metavar="FILE", default="cout",
106 help="Sets the output file for debug [Default: %default]")
107 option("--debug-ignore", metavar="EXPR", action='append', split=':',
108 help="Ignore EXPR sim objects")
103 option("--remote-gdb-port", type='int', default=7000,
104 help="Remote gdb base port (set to 0 to disable listening)")
105
109 option("--remote-gdb-port", type='int', default=7000,
110 help="Remote gdb base port (set to 0 to disable listening)")
111
106 # Tracing options
107 group("Trace Options")
108 option("--trace-start", metavar="TIME", type='int',
109 help="Start tracing at TIME (must be in ticks)")
110 option("--trace-file", metavar="FILE", default="cout",
111 help="Sets the output file for tracing [Default: %default]")
112 option("--trace-ignore", metavar="EXPR", action='append', split=':',
113 help="Ignore EXPR sim objects")
114
115 # Help options
116 group("Help Options")
117 option("--list-sim-objects", action='store_true', default=False,
118 help="List all built-in SimObjects, their params and default values")
119
120 # load the options.py config file to allow people to set their own
121 # default options
122 options_file = config.get('options.py')

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

311 sys.path[0:0] = options.path
312
313 # set stats options
314 stats.initText(options.stats_file)
315
316 # set debugging options
317 debug.setRemoteGDBPort(options.remote_gdb_port)
318 for when in options.debug_break:
112 # Help options
113 group("Help Options")
114 option("--list-sim-objects", action='store_true', default=False,
115 help="List all built-in SimObjects, their params and default values")
116
117 # load the options.py config file to allow people to set their own
118 # default options
119 options_file = config.get('options.py')

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

308 sys.path[0:0] = options.path
309
310 # set stats options
311 stats.initText(options.stats_file)
312
313 # set debugging options
314 debug.setRemoteGDBPort(options.remote_gdb_port)
315 for when in options.debug_break:
319 debug.schedBreakCycle(int(when))
316 debug.schedBreak(int(when))
320
321 if options.debug_flags:
322 check_tracing()
323
324 on_flags = []
325 off_flags = []
326 for flag in options.debug_flags:
327 off = False

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

333 print >>sys.stderr, "invalid debug flag '%s'" % flag
334 sys.exit(1)
335
336 if off:
337 debug.flags[flag].disable()
338 else:
339 debug.flags[flag].enable()
340
317
318 if options.debug_flags:
319 check_tracing()
320
321 on_flags = []
322 off_flags = []
323 for flag in options.debug_flags:
324 off = False

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

330 print >>sys.stderr, "invalid debug flag '%s'" % flag
331 sys.exit(1)
332
333 if off:
334 debug.flags[flag].disable()
335 else:
336 debug.flags[flag].enable()
337
341 if options.trace_start:
338 if options.debug_start:
342 check_tracing()
339 check_tracing()
343 e = event.create(trace.enable, event.Event.Trace_Enable_Pri)
344 event.mainq.schedule(e, options.trace_start)
340 e = event.create(trace.enable, event.Event.Debug_Enable_Pri)
341 event.mainq.schedule(e, options.debug_start)
345 else:
346 trace.enable()
347
342 else:
343 trace.enable()
344
348 trace.output(options.trace_file)
345 trace.output(options.debug_file)
349
346
350 for ignore in options.trace_ignore:
347 for ignore in options.debug_ignore:
351 check_tracing()
352 trace.ignore(ignore)
353
354 sys.argv = arguments
355 sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path
356
357 filename = sys.argv[0]
358 filedata = file(filename, 'r').read()

--- 45 unchanged lines hidden ---
348 check_tracing()
349 trace.ignore(ignore)
350
351 sys.argv = arguments
352 sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path
353
354 filename = sys.argv[0]
355 filedata = file(filename, 'r').read()

--- 45 unchanged lines hidden ---