diff options
author | Nathan Binkert <binkertn@umich.edu> | 2006-07-10 23:00:13 -0400 |
---|---|---|
committer | Nathan Binkert <binkertn@umich.edu> | 2006-07-10 23:00:13 -0400 |
commit | 55ea050d4823ca294db94d6a1f7f2fc35177e044 (patch) | |
tree | 89dfadc4bb399ecc2f23a78c78f12b0ae8ae2ca7 /src/python/SConscript | |
parent | ad4374e0cd235ea98ddc2a4659f9d7c86e5b355b (diff) | |
download | gem5-55ea050d4823ca294db94d6a1f7f2fc35177e044.tar.xz |
Migrate most of main() and and all option parsing to python
configs/test/fs.py:
configs/test/test.py:
update for the new way that m5 deals with options
src/python/SConscript:
Compile AUTHORS, LICENSE, README, and RELEASE_NOTES into the
python stuff.
src/python/m5/__init__.py:
redo the way options work.
Move them all to main.py
src/sim/main.cc:
Migrate more functionality for main() into python.
Namely option parsing
src/python/m5/attrdict.py:
A dictionary object that overrides attribute access to
do item access.
src/python/m5/main.py:
The new location for M5's option parsing, and the main()
routine to set up the simulation.
--HG--
extra : convert_revision : c86b87a9f508bde1994088e23fd470c7753ee4c1
Diffstat (limited to 'src/python/SConscript')
-rw-r--r-- | src/python/SConscript | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/python/SConscript b/src/python/SConscript index 3a9def9a8..c9e713199 100644 --- a/src/python/SConscript +++ b/src/python/SConscript @@ -75,16 +75,27 @@ def addPkg(pkgdir): # build_env flags. def MakeDefinesPyFile(target, source, env): f = file(str(target[0]), 'w') - print >>f, "m5_build_env = ", - print >>f, source[0] + print >>f, "m5_build_env = ", source[0] f.close() optionDict = dict([(opt, env[opt]) for opt in env.ExportOptions]) env.Command('m5/defines.py', Value(optionDict), MakeDefinesPyFile) +def MakeInfoPyFile(target, source, env): + f = file(str(target[0]), 'w') + for src in source: + data = ''.join(file(src.srcnode().abspath, 'r').xreadlines()) + print >>f, "%s = %s" % (src, repr(data)) + f.close() + +env.Command('m5/info.py', + [ '#/AUTHORS', '#/LICENSE', '#/README', '#/RELEASE_NOTES' ], + MakeInfoPyFile) + # Now specify the packages & files for the zip archive. addPkg('m5') pyzip_files.append('m5/defines.py') +pyzip_files.append('m5/info.py') pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py')) env.Command(['swig/cc_main_wrap.cc', 'm5/cc_main.py'], |