From 4a3cc26601e514d85d76dd8f4ae35a3f18592dd0 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 1 Jul 2010 06:14:21 +0000 Subject: [PATCH] bug fix --- Robust/TransSim/FlexScheduler.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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; -- 2.34.1