From 9bbcbf6f3a4660a8f313ace2ac2055957a15c90b Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Mon, 24 Nov 2008 03:02:34 +0000 Subject: [PATCH] add test 3021 --- .../com/sun/vlsi/chips/marina/test/MarinaTest.java | 66 +++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java index 5933fde..ea11778 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -1493,10 +1493,34 @@ public class MarinaTest { true, /* dataOut */ false /* tokenOut */ )); + List dataItems; + MarinaPacket mp; - List dataItems = marina.data.drainMany(); + dataItems = marina.data.drainMany(); fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items"); - MarinaPacket mp = new MarinaPacket(dataItems.get(0)); + mp = new MarinaPacket(dataItems.get(0)); + + // the 14th bit of the outbound address cannot be set by the + // ship, so we don't care about it + fatalIfBitVectorsDoNotMatch(MarinaUtils.berkToSun(bv), mp.path.get(0,13)); + + prln("send data with no change to path"); + marina.instrIn.fill(new Instruction.Move(DOCK, + false, /* requeueing */ + Predicate.IgnoreOLC, /* predicate */ + false, /* torpedoable */ + null, /* path */ + false, /* tokenIn */ + false, /* dataIn */ + false, /* latchData */ + false, /* latchPath */ + true, /* dataOut */ + false /* tokenOut */ + )); + + dataItems = marina.data.drainMany(); + fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items"); + mp = new MarinaPacket(dataItems.get(0)); // the 14th bit of the outbound address cannot be set by the // ship, so we don't care about it @@ -1506,6 +1530,43 @@ public class MarinaTest { prln("End sendDataWithPath"); } + private void recvPath(Marina marina) { + prln("Begin recvPath"); + adjustIndent(2); + + for(int bit=0; bit<13; bit++) { + BitVector packet_data = new BitVector(37, "inbound data item"); + for(int i=0; i<37; i++) packet_data.set(i, false); + packet_data.set(24+bit, true); + BitVector packet_path = new BitVector(14, "inbound data item"); + for(int i=0; i<14; i++) packet_path.set(i, false); + + marina.fillNorthProperStopper(new MarinaPacket(packet_data, false, packet_path)); + + prln("recv path, send data (using recv'd path)"); + marina.instrIn.fill(new Instruction.Move(DOCK, + false, /* requeueing */ + Predicate.IgnoreOLC, /* predicate */ + false, /* torpedoable */ + null, /* path */ + false, /* tokenIn */ + true, /* dataIn */ + false, /* latchData */ + true, /* latchPath */ + true, /* dataOut */ + false /* tokenOut */ + )); + + List dataItems = marina.data.drainMany(); + fatal(dataItems.size()!=1, "Expected one data item to emerge but got: "+dataItems.size()+" data items"); + MarinaPacket mp = new MarinaPacket(dataItems.get(0)); + + fatalIfBitVectorsDoNotMatch(packet_data.get(24,13), mp.path.get(0,13)); + } + + adjustIndent(-2); + prln("End recvPath"); + } private void sendTorpedo(Marina marina) { prln("Begin sendTorpedo"); @@ -1746,6 +1807,7 @@ public class MarinaTest { case 3018: sendDataWithPath(marina); break; case 3019: setOlcFromDataLatch(marina); break; case 3020: setIlcFromDataLatch(marina); break; + case 3021: recvPath(marina); break; default: fatal(true, "Test number: "+testNum+" doesn't exist."); -- 1.7.10.4