summaryrefslogtreecommitdiff
path: root/src/python/m5/__init__.py
diff options
context:
space:
mode:
authorSteve Reinhardt <stever@eecs.umich.edu>2006-06-13 23:19:42 -0400
committerSteve Reinhardt <stever@eecs.umich.edu>2006-06-13 23:19:42 -0400
commit185ec39f792386d8b30f3288f2c2e4eaf0b43d02 (patch)
treebd06995cf95f7085d4c328fed2f1cec2aec1a01a /src/python/m5/__init__.py
parent7709e6ba93be4b67b22e2f3f9c853a3e1ab4458b (diff)
parente981a97dec3df921f3800fd9ae5ec01ed4e9d2b1 (diff)
downloadgem5-185ec39f792386d8b30f3288f2c2e4eaf0b43d02.tar.xz
Merge zizzer:/bk/newmem
into vm1.(none):/home/stever/bk/newmem --HG-- extra : convert_revision : 6ebb12890c516a11733a04041f29c9964267a5ca
Diffstat (limited to 'src/python/m5/__init__.py')
-rw-r--r--src/python/m5/__init__.py15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/python/m5/__init__.py b/src/python/m5/__init__.py
index 2d4825b0e..a4fc9a5e3 100644
--- a/src/python/m5/__init__.py
+++ b/src/python/m5/__init__.py
@@ -103,6 +103,16 @@ build_env.update(defines.m5_build_env)
env = smartdict.SmartDict()
env.update(os.environ)
+
+# Function to provide to C++ so it can look up instances based on paths
+def resolveSimObject(name):
+ obj = config.instanceDict[name]
+ if not obj._ccObject:
+ obj.createCCObject()
+ if obj._ccObject == -1:
+ panic("resolveSimObject: recursive lookup error on %s" % name)
+ return obj._ccObject
+
# The final hook to generate .ini files. Called from the user script
# once the config is built.
def instantiate(root):
@@ -112,7 +122,10 @@ def instantiate(root):
root.print_ini()
sys.stdout.close() # close config.ini
sys.stdout = sys.__stdout__ # restore to original
- main.initialize() # load config.ini into C++ and process it
+ main.loadIniFile(resolveSimObject) # load config.ini into C++
+ root.createCCObject()
+ root.connectPorts()
+ main.finalInit()
noDot = True # temporary until we fix dot
if not noDot:
dot = pydot.Dot()