clear from the Python side that this is the
interface to C++.
src/SConscript:
main_wrap.cc -> cc_main_wrap.cc
src/python/SConscript:
src/python/m5/__init__.py:
src/sim/main.cc:
s/main/cc_main/
src/python/m5/config.py:
s/main/cc_main/
Also directly import cc_main so we don't need
to put the "m5." in front all the time.
--HG--
extra : convert_revision :
755552f70cf671881ff31e476c677b95ef12950d
sim/eventq.cc
sim/faults.cc
sim/main.cc
- python/swig/main_wrap.cc
+ python/swig/cc_main_wrap.cc
sim/param.cc
sim/profile.cc
sim/root.cc
pyzip_files.append('m5/defines.py')
pyzip_files.append(join(env['ROOT'], 'util/pbs/jobfile.py'))
-env.Command(['swig/main_wrap.cc', 'm5/main.py'],
- 'swig/main.i',
+env.Command(['swig/cc_main_wrap.cc', 'm5/cc_main.py'],
+ 'swig/cc_main.i',
'$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
'-o ${TARGETS[0]} $SOURCES')
-pyzip_dep_files.append('m5/main.py')
+pyzip_dep_files.append('m5/cc_main.py')
# Action function to build the zip archive. Uses the PyZipFile module
# included in the standard Python library.
import sys, os, time, atexit, optparse
# import the SWIG-wrapped main C++ functions
-import main
+import cc_main
# import a few SWIG-wrapped items (those that are likely to be used
# directly by user scripts) completely into this module for
# convenience
-from main import simulate, SimLoopExitEvent
+from cc_main import simulate, SimLoopExitEvent
# import the m5 compile options
import defines
global options
options = _options
# tell C++ about output directory
- main.setOutputDir(options.outdir)
+ cc_main.setOutputDir(options.outdir)
# Callback to set trace flags. Not necessarily the best way to do
# things in the long run (particularly if we change how these global
root.print_ini()
sys.stdout.close() # close config.ini
sys.stdout = sys.__stdout__ # restore to original
- main.loadIniFile(resolveSimObject) # load config.ini into C++
+ cc_main.loadIniFile(resolveSimObject) # load config.ini into C++
root.createCCObject()
root.connectPorts()
- main.finalInit()
+ cc_main.finalInit()
noDot = True # temporary until we fix dot
if not noDot:
dot = pydot.Dot()
# Export curTick to user script.
def curTick():
- return main.cvar.curTick
+ return cc_main.cvar.curTick
# register our C++ exit callback function with Python
-atexit.register(main.doExitCleanup)
+atexit.register(cc_main.doExitCleanup)
# This import allows user scripts to reference 'm5.objects.Foo' after
# just doing an 'import m5' (without an 'import m5.objects'). May not
import os, re, sys, types, inspect, copy
import m5
-from m5 import panic
+from m5 import panic, cc_main
from convert import *
from multidict import multidict
def getCCObject(self):
if not self._ccObject:
self._ccObject = -1 # flag to catch cycles in recursion
- self._ccObject = m5.main.createSimObject(self.path())
+ self._ccObject = cc_main.createSimObject(self.path())
elif self._ccObject == -1:
raise RuntimeError, "%s: recursive call to getCCObject()" \
% self.path()
if self.ccConnected: # already done this
return
peer = self.peer
- m5.main.connectPorts(self.simobj.getCCObject(), self.name, self.index,
+ cc_main.connectPorts(self.simobj.getCCObject(), self.name, self.index,
peer.simobj.getCCObject(), peer.name, peer.index)
self.ccConnected = True
peer.ccConnected = True
}
-extern "C" { void init_main(); }
+extern "C" { void init_cc_main(); }
int
main(int argc, char **argv)
Py_Initialize();
PySys_SetArgv(argc, argv);
- // initialize SWIG 'main' module
- init_main();
+ // initialize SWIG 'cc_main' module
+ init_cc_main();
if (argc > 0) {
// extra arg(s): first is script file, remaining ones are args