From 2f2518395a2055d459b3fbbcaef42e8786dd0b09 Mon Sep 17 00:00:00 2001 From: rkao Date: Thu, 11 Dec 2008 21:04:56 +0000 Subject: [PATCH] tests 3021 and 3025 pass --- .../com/sun/vlsi/chips/marina/test/MarinaTest.java | 2 ++ .../sun/vlsi/chips/marina/test/ProperStopper.java | 23 ++++++++++++++------ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java index 758ea23..05e5975 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -1829,6 +1829,8 @@ public class MarinaTest { prln("calling marina.instrIn.run()"); marina.instrIn.run(); + + model.waitNS(5); int expected = decr_amount>=olc ? 0 : 1; dataItems = marina.data.drainMany(2); diff --git a/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java b/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java index cf96557..ac007e5 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java +++ b/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java @@ -156,13 +156,13 @@ public class ProperStopper { setFillDrainControl(MarinaUtils.RingIfc.STOPSINK.bits()); } /** Stop a running stopper in order to add items. Ensure that we don't - * lose the item in the fill stage. Wait long enough for ring to quiesce. - * Exit state: idle */ + * lose the item in the fill stage. + * Exit state: block */ public void stopToFill() { stop(); // go = 0 idle(); // block = 1 block(); // go = 1 - idle(); // go = 0 +// idle(); // go = 0 } /** get value of the state wire preceding the fill stage */ public StateWireState getPrevStateWire() { @@ -238,7 +238,7 @@ public class ProperStopper { /** Insert one item into the fill stage. * Fill stage must be empty. * You must stop stopper before calling fill. - * exit state: idle */ + * exit state: block */ public void fill(BitVector dta) { if (traceFill) prln("Begin fill. stopper="+name); adjustIndent(2); @@ -263,7 +263,7 @@ public class ProperStopper { fill(); // fill = 1 idle(); // fill = 0 block(); // go = 1 - idle(); +// idle(); model.waitNS(5); @@ -279,7 +279,7 @@ public class ProperStopper { } /** Insert items from a list, one by one. * You must stop stopper before calling fillMany() - * exit state: idle */ + * exit state: block */ public void fillMany(List data) { prln("Begin fillMany. stopper="+name+" numWords="+data.size()); adjustIndent(2); @@ -302,6 +302,13 @@ public class ProperStopper { StateWireState myState=getFillStateWire(); fatal(myState==StateWireState.EMPTY, "drain: fill stage empty"); + return drainNoCheck(); + } + /** Remove one item from fill stage. Return that item. + * Assume that an item is available. + * entry state: stop + * exit state: stop */ + private BitVector drainNoCheck() { shiftData(true, false); BitVector ans = getDatTokAdr(); @@ -327,6 +334,8 @@ public class ProperStopper { prln("begin drainMany. stopper="+name); adjustIndent(2); + stop(); + List ans = new ArrayList(); int cnt = 0; @@ -340,7 +349,7 @@ public class ProperStopper { if (traceDrain) prln("drainMany: reading word number: "+cnt++); - BitVector d = drain(); + BitVector d = drainNoCheck(); ans.add(d); } -- 1.7.10.4