diff -r fea29fc045ee -r 2459297094e6 src/python/m5/simulate.py --- a/src/python/m5/simulate.py Thu Dec 04 11:08:23 2014 -0700 +++ b/src/python/m5/simulate.py Thu Dec 04 11:37:26 2014 -0700 @@ -45,16 +45,18 @@ import sys # import the SWIG-wrapped main C++ functions +import core +import event import internal -import core +import objects import stats import SimObject import ticks -import objects from m5.util.dot_writer import do_dot from m5.internal.stats import updateEvents as updateStatEvents from util import fatal +from util import warn from util import attrdict # define a MaxTick parameter, unsigned 64 bit @@ -136,6 +138,14 @@ else: for obj in root.descendants(): obj.initState() + if not event.getEventQueue(0).empty(): + # SimObjects that do self-initiated processing are expected to + # schedule internal events when startup() is called. Therefore + # event queue shall be empty now. + # TODO: Consider enforcing this check and changing this to fatal. + warn("Event Queue is not empty after instantiation.") + print event.getEventQueue(0).dump() + # Check to see if any of the stat events are in the past after resuming from # a checkpoint, If so, this call will shift them to be at a valid time. updateStatEvents()