main.py (5799:0af61da2b66a) | main.py (5801:e0850da03cd4) |
---|---|
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 --- 121 unchanged lines hidden (view full) --- 130 help="Ignore EXPR sim objects") 131 132# Help options 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(): | 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 --- 121 unchanged lines hidden (view full) --- 130 help="Ignore EXPR sim objects") 131 132# Help options 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 core 139 import debug 140 import defines |
|
138 import event 139 import info | 141 import event 142 import info |
140 import internal | 143 import stats |
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 --- 31 unchanged lines hidden (view full) --- 180 181 if options.redirect_stderr: 182 redir_fd = os.open(stderr_file, os. O_WRONLY | os.O_CREAT | os.O_TRUNC) 183 os.dup2(redir_fd, sys.stderr.fileno()) 184 185 done = False 186 187 if options.build_info: | 144 import trace 145 146 def check_tracing(): 147 if defines.TRACING_ON: 148 return 149 150 panic("Tracing is not enabled. Compile with TRACING_ON") 151 --- 31 unchanged lines hidden (view full) --- 183 184 if options.redirect_stderr: 185 redir_fd = os.open(stderr_file, os. O_WRONLY | os.O_CREAT | os.O_TRUNC) 186 os.dup2(redir_fd, sys.stderr.fileno()) 187 188 done = False 189 190 if options.build_info: |
188 import defines 189 | |
190 done = True 191 print 'Build information:' 192 print | 191 done = True 192 print 'Build information:' 193 print |
193 print 'compiled %s' % internal.core.cvar.compileDate; 194 print "revision %s" % internal.core.cvar.hgRev 195 print "commit date %s" % internal.core.cvar.hgDate | 194 print 'compiled %s' % defines.compileDate; 195 print "revision %s:%s" % (defines.hgRev, defines.hgId) 196 print "commit date %s" % defines.hgDate |
196 print 'build options:' | 197 print 'build options:' |
197 keys = defines.m5_build_env.keys() | 198 keys = defines.buildEnv.keys() |
198 keys.sort() 199 for key in keys: | 199 keys.sort() 200 for key in keys: |
200 val = defines.m5_build_env[key] | 201 val = defines.buildEnv[key] |
201 print ' %s = %s' % (key, val) 202 print 203 204 if options.copyright: 205 done = True 206 print info.LICENSE 207 print 208 --- 51 unchanged lines hidden (view full) --- 260 if options.verbose > 0 and options.quiet > 0: 261 options.usage(2) 262 263 verbose = options.verbose - options.quiet 264 if options.verbose >= 0: 265 print "M5 Simulator System" 266 print brief_copyright 267 print | 202 print ' %s = %s' % (key, val) 203 print 204 205 if options.copyright: 206 done = True 207 print info.LICENSE 208 print 209 --- 51 unchanged lines hidden (view full) --- 261 if options.verbose > 0 and options.quiet > 0: 262 options.usage(2) 263 264 verbose = options.verbose - options.quiet 265 if options.verbose >= 0: 266 print "M5 Simulator System" 267 print brief_copyright 268 print |
268 print "M5 compiled %s" % internal.core.cvar.compileDate; 269 print "M5 revision %s" % internal.core.cvar.hgRev 270 print "M5 commit date %s" % internal.core.cvar.hgDate | |
271 | 269 |
270 print "M5 compiled %s" % defines.compileDate; 271 print "M5 revision %s:%s" % (defines.hgRev, defines.hgId) 272 print "M5 commit date %s" % defines.hgDate 273 |
|
272 print "M5 started %s" % datetime.datetime.now().strftime("%b %e %Y %X") 273 print "M5 executing on %s" % socket.gethostname() 274 275 print "command line:", 276 for argv in sys.argv: 277 print argv, 278 print 279 280 # check to make sure we can find the listed script 281 if not arguments or not os.path.isfile(arguments[0]): 282 if arguments and not os.path.isfile(arguments[0]): 283 print "Script %s not found" % arguments[0] 284 285 options.usage(2) 286 287 # tell C++ about output directory | 274 print "M5 started %s" % datetime.datetime.now().strftime("%b %e %Y %X") 275 print "M5 executing on %s" % socket.gethostname() 276 277 print "command line:", 278 for argv in sys.argv: 279 print argv, 280 print 281 282 # check to make sure we can find the listed script 283 if not arguments or not os.path.isfile(arguments[0]): 284 if arguments and not os.path.isfile(arguments[0]): 285 print "Script %s not found" % arguments[0] 286 287 options.usage(2) 288 289 # tell C++ about output directory |
288 internal.core.setOutputDir(options.outdir) | 290 core.setOutputDir(options.outdir) |
289 290 # update the system path with elements from the -p option 291 sys.path[0:0] = options.path 292 | 291 292 # update the system path with elements from the -p option 293 sys.path[0:0] = options.path 294 |
293 import objects 294 | |
295 # set stats options | 295 # set stats options |
296 internal.stats.initText(options.stats_file) | 296 stats.initText(options.stats_file) |
297 298 # set debugging options | 297 298 # set debugging options |
299 internal.debug.setRemoteGDBPort(options.remote_gdb_port) | 299 debug.setRemoteGDBPort(options.remote_gdb_port) |
300 for when in options.debug_break: | 300 for when in options.debug_break: |
301 internal.debug.schedBreakCycle(int(when)) | 301 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 --- 89 unchanged lines hidden --- | 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 --- 89 unchanged lines hidden --- |