Steve, I think things are working correctly. Note that I was just printing the help message. So simulate() will never get called. And at exit, the stats.dump function gets called which queries for the current tick.
-- Nilay On Tue, January 22, 2013 9:10 pm, Steve Reinhardt wrote: > That seems strange... atexit.register(stats.dump) should just be enqueuing > a pointer to the stats.dump function to be called when the simulator > exits. > The stats.dump function should not actually be executed at that point in > time. > > Steve > > > On Tue, Jan 22, 2013 at 6:25 PM, Nilay <[email protected]> wrote: > >> On Tue, January 22, 2013 3:35 pm, Steve Reinhardt wrote: >> > I think the question Ali was asking is where in the python is >> curTick() >> > being called before simulate(). On the C++ side, any call from python >> is >> > going to come through core_wrap.cc. You might have to use the python >> > debugger and put a breakpoint on the python side of the swig-generated >> > code >> > to figure this out. >> > >> >> I can answer this question now. In file src/python/m5/simulate.py, we >> register two functions that would called on exit. >> >> # Python exit handlers happen in reverse order. We want to dump stats >> last. >> atexit.register(stats.dump) >> >> # register our C++ exit callback function with Python >> atexit.register(internal.core.doExitCleanup) >> >> The function stats.dump makes call to curTick(). >> >> While going through all the python code, I think I would like to set the >> thread local queue of the main thread in main.py file. It seems the >> function main() in that file is called before any other python function >> is >> called. >> >> >> -- >> Nilay >> _______________________________________________ gem5-dev mailing list [email protected] http://m5sim.org/mailman/listinfo/gem5-dev
