3 # the mpy import code is added to the global import meta_path as a
4 # side effect of this import
5 from mpy_importer
import AddToPath
, LoadMpyFile
7 # define this here so we can use it right away if necessary
9 print >>sys
.stderr
, 'panic:', string
12 # find the m5 compile options: must be specified as a dict in
13 # __main__.m5_build_env.
15 if not hasattr(__main__
, 'm5_build_env'):
16 panic("__main__ must define m5_build_env")
18 # make a SmartDict out of the build options for our local use
20 build_env
= smartdict
.SmartDict()
21 build_env
.update(__main__
.m5_build_env
)
23 # make a SmartDict out of the OS environment too
24 env
= smartdict
.SmartDict()
25 env
.update(os
.environ
)
27 # import the main m5 config code
29 config
.add_param_types(config
)
31 # import the built-in object definitions
33 config
.add_param_types(objects
)
35 cpp_classes
= config
.MetaSimObject
.cpp_classes