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 --- 30 unchanged lines hidden (view full) --- 39# import the m5 compile options 40import defines 41 42# define this here so we can use it right away if necessary 43def panic(string): 44 print >>sys.stderr, 'panic:', string 45 sys.exit(1) 46 |
47# force scalars to one-element lists for uniformity |
48def makeList(objOrList): 49 if isinstance(objOrList, list): 50 return objOrList 51 return [objOrList] 52 53# Prepend given directory to system module search path. We may not 54# need this anymore if we can structure our config library more like a 55# Python package. --- 15 unchanged lines hidden (view full) --- 71# make a SmartDict out of the OS environment too 72env = smartdict.SmartDict() 73env.update(os.environ) 74 75# The final hook to generate .ini files. Called from the user script 76# once the config is built. 77def instantiate(root): 78 params.ticks_per_sec = float(root.clock.frequency) |
79 root.unproxy_all() |
80 # ugly temporary hack to get output to config.ini 81 sys.stdout = file(os.path.join(options.outdir, 'config.ini'), 'w') 82 root.print_ini() 83 sys.stdout.close() # close config.ini 84 sys.stdout = sys.__stdout__ # restore to original 85 cc_main.loadIniFile(resolveSimObject) # load config.ini into C++ 86 root.createCCObject() 87 root.connectPorts() --- 125 unchanged lines hidden --- |