Deleted Added
sdiff udiff text old ( 5528:10a17e8a6d35 ) new ( 5586:d27058799d3a )
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

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

29import code
30import datetime
31import os
32import socket
33import sys
34
35from util import attrdict
36import config
37import defines
38from options import OptionParser
39import traceflags
40
41__all__ = [ 'options', 'arguments', 'main' ]
42
43def print_list(items, indent=4):
44 line = ' ' * indent
45 for i,item in enumerate(items):
46 if len(line) + len(item) > 76:
47 print line

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

127 help="Ignore EXPR sim objects")
128
129# Help options
130set_group("Help Options")
131add_option("--list-sim-objects", action='store_true', default=False,
132 help="List all built-in SimObjects, their parameters and default values")
133
134def main():
135 import defines
136 import event
137 import info
138 import internal
139
140 # load the options.py config file to allow people to set their own
141 # default options
142 options_file = config.get('options.py')
143 if options_file:

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

171
172 if options.redirect_stderr:
173 redir_fd = os.open(stderr_file, os. O_WRONLY | os.O_CREAT | os.O_TRUNC)
174 os.dup2(redir_fd, sys.stderr.fileno())
175
176 done = False
177
178 if options.build_info:
179 done = True
180 print 'Build information:'
181 print
182 print 'compiled %s' % internal.core.cvar.compileDate;
183 print "revision %s" % internal.core.cvar.hgRev
184 print "commit date %s" % internal.core.cvar.hgDate
185 print 'build options:'
186 keys = defines.m5_build_env.keys()

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

212 if options.release_notes:
213 done = True
214 print 'Release Notes:'
215 print
216 print info.RELEASE_NOTES
217 print
218
219 if options.trace_help:
220 done = True
221 print "Base Flags:"
222 print_list(traceflags.baseFlags, indent=4)
223 print
224 print "Compound Flags:"
225 for flag in traceflags.compoundFlags:
226 if flag == 'All':
227 continue

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

292 # set stats options
293 internal.stats.initText(options.stats_file)
294
295 # set debugging options
296 internal.debug.setRemoteGDBPort(options.remote_gdb_port)
297 for when in options.debug_break:
298 internal.debug.schedBreakCycle(int(when))
299
300 on_flags = []
301 off_flags = []
302 for flag in options.trace_flags:
303 off = False
304 if flag.startswith('-'):
305 flag = flag[1:]
306 off = True
307 if flag not in traceflags.allFlags:
308 print >>sys.stderr, "invalid trace flag '%s'" % flag
309 sys.exit(1)
310
311 if off:
312 off_flags.append(flag)
313 else:
314 on_flags.append(flag)
315
316 for flag in on_flags:
317 internal.trace.set(flag)
318
319 for flag in off_flags:
320 internal.trace.clear(flag)
321
322 if options.trace_start:
323 def enable_trace():
324 internal.trace.cvar.enabled = True
325 event.create(enable_trace, int(options.trace_start))
326 else:
327 internal.trace.cvar.enabled = True
328
329 internal.trace.output(options.trace_file)

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

353 # once the script is done
354 if options.interactive:
355 interact = code.InteractiveConsole(scope)
356 interact.interact("M5 Interactive Console")
357
358if __name__ == '__main__':
359 from pprint import pprint
360
361 parse_args()
362
363 print 'opts:'
364 pprint(options, indent=4)
365 print
366
367 print 'args:'
368 pprint(arguments, indent=4)