sim: draining bug for fast-forwaring multiple cores stable_2014_12_14
authorAndrew Lukefahr <lukefahr@umich.edu>
Sat, 11 Oct 2014 20:02:22 +0000 (15:02 -0500)
committerAndrew Lukefahr <lukefahr@umich.edu>
Sat, 11 Oct 2014 20:02:22 +0000 (15:02 -0500)
fix draining bug where multiple cores hit max_insts_any_thread simultaneously

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

src/python/m5/simulate.py

index 8529a74727f8e542ba0aa50a498c22d1dd888f40..5673e26c7cf5667087dcd3396f2c9f3bf31fec00 100644 (file)
@@ -184,7 +184,11 @@ def drain(root):
         # 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)