bug fix
authorbdemsky <bdemsky>
Thu, 1 Jul 2010 06:14:21 +0000 (06:14 +0000)
committerbdemsky <bdemsky>
Thu, 1 Jul 2010 06:14:21 +0000 (06:14 +0000)
Robust/TransSim/FlexScheduler.java

index 1ac76881042f2bd7bf0e6c4c4df2887a9182f6a1..589413e5074e9aa046299686f58e40b74df24eda 100644 (file)
@@ -181,6 +181,10 @@ public class FlexScheduler extends Thread {
     int eIndex=e.getEvent();
     long eTime=e.getTime();
     long timeleft=eTime-currtime;
+    if (e.isStalled()) {
+      stallcycles-=timeleft; //this time is no longer stalled...back it out
+      timeleft=0;//if the event is stalled, we already waited this time...
+    }
     long totaltime=trans.getTime(eIndex);
     totaltime-=timeleft;//subtract off time to the next event
     abortedcycles+=totaltime;
@@ -211,6 +215,7 @@ public class FlexScheduler extends Thread {
   public void stall(Event ev, long time, long delay) {
     stallcycles+=delay;
     ev.setTime(time+delay);
+    ev.setStall();
     eq.add(ev);
   }
 
@@ -845,6 +850,15 @@ public class FlexScheduler extends Thread {
     Transaction t;
     int threadid;
     int transnum;
+    boolean stalled;
+
+    public boolean isStalled() {
+      return stalled;
+    }
+
+    public void setStall() {
+      stalled=true;
+    }
 
     public void makeInvalid() {
       valid=false;