From 5682f4f7f98f3ea98ea0b0290f859f55ed0ff45f Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 2 Aug 2007 11:59:02 -0700 Subject: main: expose the build information as a simple command line parameter --HG-- extra : convert_revision : 69189c4a2e9fa9290fe51a2a43a2b08e712c395d --- src/python/m5/main.py | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/python/m5') diff --git a/src/python/m5/main.py b/src/python/m5/main.py index 1695ed75f..96f017cb0 100644 --- a/src/python/m5/main.py +++ b/src/python/m5/main.py @@ -26,9 +26,15 @@ # # Authors: Nathan Binkert -import code, optparse, os, socket, sys -from datetime import datetime +import code +import datetime +import optparse +import os +import socket +import sys + from attrdict import attrdict +import defines import traceflags __all__ = [ 'options', 'arguments', 'main' ] @@ -116,6 +122,8 @@ def bool_option(name, default, help): # Help options add_option('-A', "--authors", action="store_true", default=False, help="Show author information") +add_option('-B', "--build-info", action="store_true", default=False, + help="Show build information") add_option('-C', "--copyright", action="store_true", default=False, help="Show full copyright information") add_option('-R', "--readme", action="store_true", default=False, @@ -195,6 +203,22 @@ def main(): parse_args() done = False + + if options.build_info: + done = True + print 'Build information:' + print + print 'compiled %s' % internal.core.cvar.compileDate; + print 'started %s' % datetime.datetime.now().ctime() + print 'executing on %s' % socket.gethostname() + print 'build options:' + keys = defines.m5_build_env.keys() + keys.sort() + for key in keys: + val = defines.m5_build_env[key] + print ' %s = %s' % (key, val) + print + if options.copyright: done = True print info.LICENSE @@ -242,7 +266,7 @@ def main(): print brief_copyright print print "M5 compiled %s" % internal.core.cvar.compileDate; - print "M5 started %s" % datetime.now().ctime() + print "M5 started %s" % datetime.datetime.now().ctime() print "M5 executing on %s" % socket.gethostname() print "command line:", for argv in sys.argv: -- cgit v1.2.3 From dfa147a70ac87cdc5804993a0b39dfb8bb4cfa1b Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 2 Aug 2007 12:03:35 -0700 Subject: python: need to import objects to make some calls work --HG-- extra : convert_revision : b5eec971d76626b2f42448052ab2cb2acb652d1b --- src/python/m5/simulate.py | 1 + 1 file changed, 1 insertion(+) (limited to 'src/python/m5') diff --git a/src/python/m5/simulate.py b/src/python/m5/simulate.py index 1ef78d6cb..ba9fb7899 100644 --- a/src/python/m5/simulate.py +++ b/src/python/m5/simulate.py @@ -36,6 +36,7 @@ import internal from main import options import SimObject import ticks +import objects # The final hook to generate .ini files. Called from the user script # once the config is built. -- cgit v1.2.3 From b3674749168dd4823795644b1bb820ce2876a615 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Thu, 2 Aug 2007 14:12:53 -0700 Subject: python: fix m5.build_env variable. As it is now, some objects will get the incorrect value depending where they were defined. --HG-- extra : convert_revision : a11a14842f9524739cbf54a48be6ec051f371200 --- src/python/m5/__init__.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/python/m5') diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py index 36f2eba61..96cb2ca13 100644 --- a/src/python/m5/__init__.py +++ b/src/python/m5/__init__.py @@ -81,11 +81,6 @@ try: except ImportError: running_m5 = False -if running_m5: - from event import * - from simulate import * - from main import options - if running_m5: import defines build_env.update(defines.m5_build_env) @@ -93,6 +88,11 @@ else: import __scons build_env.update(__scons.m5_build_env) +if running_m5: + from event import * + from simulate import * + from main import options + import SimObject import params import objects -- cgit v1.2.3