__init__.py (3102:225b76c8ac68) __init__.py (3105:993f1abefd67)
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
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
47def makeList(objOrList):
48 if isinstance(objOrList, list):
49 return objOrList
50 return [objOrList]
51
52# Prepend given directory to system module search path. We may not
53# need this anymore if we can structure our config library more like a
54# Python package.

--- 15 unchanged lines hidden (view full) ---

70# make a SmartDict out of the OS environment too
71env = smartdict.SmartDict()
72env.update(os.environ)
73
74# The final hook to generate .ini files. Called from the user script
75# once the config is built.
76def instantiate(root):
77 params.ticks_per_sec = float(root.clock.frequency)
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()
78 # ugly temporary hack to get output to config.ini
79 sys.stdout = file(os.path.join(options.outdir, 'config.ini'), 'w')
80 root.print_ini()
81 sys.stdout.close() # close config.ini
82 sys.stdout = sys.__stdout__ # restore to original
83 cc_main.loadIniFile(resolveSimObject) # load config.ini into C++
84 root.createCCObject()
85 root.connectPorts()

--- 125 unchanged lines hidden ---
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 ---