From af33e74638ea822fba0ddbc7fddbe7583c61d920 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 22 Feb 2005 23:53:34 -0500 Subject: Small initial steps toward generating C++ param structs from Python object descriptions. Mostly cleanup of Python code based on things I encountered trying to figure out what's going on. Main reason I'm committing this now is to transfer work from my laptop to zizzer. sim/pyconfig/m5config.py: Small steps toward param struct generation: all param objects should now have a _cppname attribute that holds their corresponding C++ type name. Made Param ptype attribute an actual type instead of a string. String is still stored in ptype_string. Get rid of AddToPath() and Import() (redundant copies are in importer, and that seems to be the more logical place for them). Add a few comments, delete some unused code. test/genini.py: A few fixes to make the environment more compatible with what really happens when configs are executed from the m5 binary. --HG-- extra : convert_revision : 9fc8f72cd0c22ba3deada02f37484787342534f2 --- test/genini.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 test/genini.py (limited to 'test/genini.py') diff --git a/test/genini.py b/test/genini.py old mode 100644 new mode 100755 index 73e7012f6..9c28ef361 --- a/test/genini.py +++ b/test/genini.py @@ -30,13 +30,14 @@ from os.path import join as joinpath, realpath mypath = sys.path[0] sys.path.append(joinpath(mypath, '..')) -sys.path.append(joinpath(mypath, '../configs/kernel')) sys.path.append(joinpath(mypath, '../util/pbs')) sys.path.append(joinpath(mypath, '../sim/pyconfig')) -from importer import mpy_exec, mpy_execfile, AddToPath +from importer import AddToPath, LoadMpyFile from m5config import * +AddToPath('.') + try: opts, args = getopt.getopt(sys.argv[1:], '-E:I:') for opt,arg in opts: @@ -55,8 +56,7 @@ except getopt.GetoptError: sys.exit('Improper Usage') for arg in args: - AddToPath(os.path.dirname(arg)) - mpy_execfile(arg) + LoadMpyFile(arg) if globals().has_key('root') and isinstance(root, type) \ and issubclass(root, Root): -- cgit v1.2.3