diff -r 0a253e960329 -r d8060adbdd29 src/python/m5/simulate.py --- a/src/python/m5/simulate.py Fri May 30 10:19:49 2014 -0400 +++ b/src/python/m5/simulate.py Fri May 30 10:23:58 2014 -0400 @@ -184,7 +184,11 @@ # If we've got some objects that can't drain immediately, then simulate if unready_objs > 0: dm.setCount(unready_objs) - simulate() + #WARNING: if a valid exit event occurs while draining, it will not + # get returned to the user script + exit_event = simulate() + while exit_event.getCause() != 'Finished drain': + exit_event = simulate() else: all_drained = True internal.drain.cleanupDrainManager(dm)