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
--- 93 unchanged lines hidden (view full) ---
102# make a SmartDict out of the OS environment too
103env = smartdict.SmartDict()
104env.update(os.environ)
105
106
107# Function to provide to C++ so it can look up instances based on paths
108def resolveSimObject(name):
109 obj = config.instanceDict[name]
110 if not obj._ccObject:
111 obj.createCCObject()
112 if obj._ccObject == -1:
113 panic("resolveSimObject: recursive lookup error on %s" % name)
114 return obj._ccObject
115
116# The final hook to generate .ini files. Called from the user script
117# once the config is built.
118def instantiate(root):
119 config.ticks_per_sec = float(root.clock.frequency)
120 # ugly temporary hack to get output to config.ini
121 sys.stdout = file('config.ini', 'w')
122 root.print_ini()
--- 28 unchanged lines hidden ---
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
--- 93 unchanged lines hidden (view full) ---
102# make a SmartDict out of the OS environment too
103env = smartdict.SmartDict()
104env.update(os.environ)
105
106
107# Function to provide to C++ so it can look up instances based on paths
108def resolveSimObject(name):
109 obj = config.instanceDict[name]
110 if not obj._ccObject:
111 obj.createCCObject()
112 if obj._ccObject == -1:
113 panic("resolveSimObject: recursive lookup error on %s" % name)
114 return obj._ccObject
115
116# The final hook to generate .ini files. Called from the user script
117# once the config is built.
118def instantiate(root):
119 config.ticks_per_sec = float(root.clock.frequency)
120 # ugly temporary hack to get output to config.ini
121 sys.stdout = file('config.ini', 'w')
122 root.print_ini()
--- 28 unchanged lines hidden ---