From 3e907fee98c5246fdf0ec05cc0407998dde2b156 Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Thu, 23 Apr 2009 03:31:52 +0000 Subject: [PATCH] more tests pass now --- .../com/sun/vlsi/chips/marina/test/Marina.java | 9 +- .../com/sun/vlsi/chips/marina/test/MarinaTest.java | 167 ++++++-------------- 2 files changed, 56 insertions(+), 120 deletions(-) diff --git a/testCode/com/sun/vlsi/chips/marina/test/Marina.java b/testCode/com/sun/vlsi/chips/marina/test/Marina.java index 5cbe452..06f8876 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/Marina.java +++ b/testCode/com/sun/vlsi/chips/marina/test/Marina.java @@ -148,7 +148,7 @@ public class Marina { // force the OLC to zero for(int i=1; i<=6; i++) - vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.bitt["+i+"]", 1); + vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.inLO["+i+"]", (i==1)?0:1); // set the ILC input to 1 for(int i=1; i<=8; i++) { @@ -156,10 +156,12 @@ public class Marina { vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.\\inLO["+i+"]", (i==1)?0:1); } - // pulse ilc[load] + // pulse ilc[load] and olc[load] vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.ilc_load_", 1); + vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.olc_load_", 1); model.waitNS(1000); vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.ilc_load_", 0); + vm.setNodeState("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.olc_load_", 0); model.waitNS(1000); vm.setNodeState("sid[9]", 1); @@ -192,6 +194,9 @@ public class Marina { vm.releaseNode("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.ilc@0.\\inLO["+i+"] "); } model.waitNS(1000); + vm.releaseNode("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.olc_load_"); + for(int i=1; i<=6; i++) + vm.releaseNode("outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.olc@0.inLO["+i+"]"); // the proper stopper states come up in an undefined ("X") // state, so under Verilog we need to force them to a diff --git a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java index de40372..10b3942 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -601,8 +601,8 @@ public class MarinaTest { } } - private void testFlagZ(Marina marina) { - prln("Begin testFlagZ"); + private void testFlagD(Marina marina) { + prln("Begin testFlagD"); adjustIndent(2); List toks; @@ -642,7 +642,7 @@ public class MarinaTest { } } adjustIndent(-2); - prln("End testFlagZ"); + prln("End testFlagD"); } private void testPredicationOnAB(Marina marina) { @@ -651,8 +651,8 @@ public class MarinaTest { List dItems; - prln("Setting OLC=63"); - setOLC(marina, 63); + prln("Setting ILC=1"); + marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 1)); for(boolean flag_a : new boolean[] { false, true }) { for(boolean flag_b : new boolean[] { false, true }) { @@ -676,9 +676,8 @@ public class MarinaTest { Predicate.NotFlagB, }) { - prln("Attempting send data with a="+flag_a+", b="+flag_b+", predicate="+predicate.getClass().getName()); + prln("Attempting send data with a="+flag_a+", b="+flag_b+", predicate="+predicate); adjustIndent(2); - marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter, 1)); marina.instrIn.fill(new Instruction.Move(dock, predicate, /* predicate */ false, /* torpedoable */ @@ -724,7 +723,7 @@ public class MarinaTest { private void walkOneOLC(Marina marina) { prln("Begin walkOneOLC"); adjustIndent(2); - for (int i=6; i>=0; i--) { + for (int i=5; i>=0; i--) { int inOlc = 1<1 transition and possibly be discarded"); - marina.instrIn.fill(REQUEUEING_NOP); - - // just in case there is some capacity between the execution - // stage and the requeue stage, we stick in a whole bunch of - // NOPs. - for(int i=0; i<4; i++) { - prln("inserting instruction: [Rq] Nop; this (and subsequent instructions) should not execute until Tail is inserted"); - marina.instrIn.fill(REQUEUEING_NOP); - } + prln("inserting instruction: head"); + marina.instrIn.fill(new Instruction.Head(dock)); prln("inserting instruction: [Rq] Set ILC=1"); marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1)); prln("inserting instruction: [Rq] Send Data"); - marina.instrIn.fill(REQUEUEING_SEND_DATA); + marina.instrIn.fill(SEND_DATA); dataItems = marina.data.drainMany(1); fatal(dataItems.size()!=0, "Expected exactly no data items to emerge but got at least: "+dataItems.size()); - adjustIndent(-2); - prln("End testWaitForTail"); - } - - // This test case will FAIL if the requeue stage behaves as - // described in IES50. If we determine that the behavior - // described there is actually desirable, then this test should be - // modified. - private void testRequeueStageDrop(Marina marina) { - List dataItems; - - prln("Begin testRequeueStageDrop"); - adjustIndent(2); - - // We have decided that this issue will not be fixed in - // Marina. Therefore, the test is commented out. - - /* - prln("inserting instruction: Set OLC=63"); - setOLC(marina, 63); - - prln("inserting instruction: Set ILC=1"); - marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1)); - - // if you uncomment this, then the NOP will be dropped and the test will pass - //prln("inserting instruction: [Rq] Nop; this will cause 0->1 transition and possibly be discarded"); - //marina.instrIn.fill(REQUEUEING_NOP); - - prln("inserting instruction: [Rq] Send Data; this will cause 0->1 transition and be discarded"); - marina.instrIn.fill(REQUEUEING_SEND_DATA); - - prln("inserting instruction: [Rq] Set ILC=1"); - marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1)); - - prln("inserting instruction: Tail"); - marina.instrIn.fill(new Instruction.Tail(dock)); + prln("inserting instruction: head"); + marina.instrIn.fill(new Instruction.Tail(dock)); - dataItems = marina.data.drainMany(3); - fatal(dataItems.size()<3, "Expected exactly unlimited data items to emerge but got only: "+dataItems.size()); - */ + BitVector bv = marina.data.drain(); + fatal(bv==null, "Expected at least one data item to emerge but got none"); adjustIndent(-2); - prln("End testRequeueStageDrop"); + prln("End testWaitForTail"); } - private void testFlagAB(Marina marina) { prln("Begin testFlagAB"); adjustIndent(2); @@ -1403,7 +1336,7 @@ public class MarinaTest { adjustIndent(2); // walk a bit from 0 to 5 - for(int bit=0; bit<6; bit++) { + for(int bit=5; bit>=0; bit--) { prln("inserting data item in north fifo ring"); BitVector data = new BitVector(37, "empty"); BitVector addr = new BitVector(14, "empty"); @@ -1415,6 +1348,7 @@ public class MarinaTest { marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,1)); marina.instrIn.fill(RECV_DATA); marina.instrIn.fill(new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.InnerLoopCounter,SetSource.DataLatch)); + model.waitNS(CYCLE_TIME_NS * 64); int ilc = marina.getILC().getCount(); fatal(ilc != (1<