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 import trace |
142 |
143 def check_tracing(): 144 if defines.TRACING_ON: 145 return 146 147 panic("Tracing is not enabled. Compile with TRACING_ON") 148 |
149 # load the options.py config file to allow people to set their own 150 # default options 151 options_file = config.get('options.py') 152 if options_file: 153 scope = { 'options' : options } 154 execfile(options_file, scope) 155 156 arguments = options.parse_args() --- 66 unchanged lines hidden (view full) --- 223 if options.release_notes: 224 done = True 225 print 'Release Notes:' 226 print 227 print info.RELEASE_NOTES 228 print 229 230 if options.trace_help: |
231 done = True |
232 check_tracing() 233 trace.help() |
234 235 if options.list_sim_objects: 236 import SimObject 237 done = True 238 print "SimObjects:" 239 objects = SimObject.allClasses.keys() 240 objects.sort() 241 for name in objects: --- 54 unchanged lines hidden (view full) --- 296 internal.stats.initText(options.stats_file) 297 298 # set debugging options 299 internal.debug.setRemoteGDBPort(options.remote_gdb_port) 300 for when in options.debug_break: 301 internal.debug.schedBreakCycle(int(when)) 302 303 if options.trace_flags: |
304 check_tracing() |
305 306 on_flags = [] 307 off_flags = [] 308 for flag in options.trace_flags: 309 off = False 310 if flag.startswith('-'): 311 flag = flag[1:] 312 off = True |
313 if flag not in trace.flags.all and flag != "All": |
314 print >>sys.stderr, "invalid trace flag '%s'" % flag 315 sys.exit(1) 316 317 if off: 318 off_flags.append(flag) 319 else: 320 on_flags.append(flag) 321 322 for flag in on_flags: |
323 trace.set(flag) |
324 325 for flag in off_flags: |
326 trace.clear(flag) |
327 328 if options.trace_start: |
329 check_tracing() 330 e = event.create(trace.enable) |
331 event.mainq.schedule(e, options.trace_start) 332 else: |
333 trace.enable() |
334 |
335 trace.output(options.trace_file) |
336 337 for ignore in options.trace_ignore: |
338 check_tracing() 339 trace.ignore(ignore) |
340 341 sys.argv = arguments 342 sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path 343 344 filename = sys.argv[0] 345 filedata = file(filename, 'r').read() 346 filecode = compile(filedata, filename, 'exec') 347 scope = { '__file__' : filename, --- 51 unchanged lines hidden --- |