From: bdemsky Date: Thu, 1 Jul 2010 06:14:21 +0000 (+0000) Subject: bug fix X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4a3cc26601e514d85d76dd8f4ae35a3f18592dd0;p=IRC.git bug fix --- diff --git a/Robust/TransSim/FlexScheduler.java b/Robust/TransSim/FlexScheduler.java index 1ac76881..589413e5 100644 --- a/Robust/TransSim/FlexScheduler.java +++ b/Robust/TransSim/FlexScheduler.java @@ -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;