From 0a6016cd31f480cff79132fc75e3e4c99895a34d Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Thu, 6 Nov 2008 20:38:41 +0000 Subject: [PATCH] add tests 3000 and 3001 --- .../com/sun/vlsi/chips/marina/test/MarinaTest.java | 39 +++++++++++++++++++- 1 file changed, 37 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 8e06bcf..4e13c7b 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -497,7 +497,38 @@ public class MarinaTest { prln("End countOlc"); } private void testFlagAB(IsolatedInDock inDock) { - + prln("Begin testFlagAB"); + adjustIndent(2); + + Instruction.Set.FlagFunction zero = Instruction.Set.FlagFunction.ZERO; + Instruction.Set.FlagFunction one = zero; + + // we should be able to use any pair of FlagX+NotFlagX, + // but we toss them all in to maximize the chances of the + // test passing (later we will try the individual + // combinations to maximize the chances of failure). + one = one.add(Predicate.FlagA); + one = one.add(Predicate.NotFlagA); + one = one.add(Predicate.FlagB); + one = one.add(Predicate.NotFlagB); + one = one.add(Predicate.FlagC); + one = one.add(Predicate.NotFlagC); + + // clear the flags to a known state, then check both 0->1 and 1->0 transitions + for(boolean b : new boolean[] { false, true, false }) { + prln((b?"Setting":"Clearing")+" flags"); + + inDock.instrIn.fill(new + Instruction.Set(DOCK,false,Predicate.IgnoreOLC, + b ? one : zero, + b ? one : zero + )); + fatal(inDock.getFlagA(), "after "+(b?"setting":"clearing")+" FlagA, it was still "+(b?"clear":"set")); + fatal(inDock.getFlagB(), "after "+(b?"setting":"clearing")+" FlagB, it was still "+(b?"clear":"set")); + } + + adjustIndent(-2); + prln("End testFlagAB"); } private void doOneTest(int testNum) { prln("MarinaTest: performing test: "+testNum); @@ -518,7 +549,11 @@ public class MarinaTest { // Bill's tests begin with 2000 case 2000: break; - + + // Adam's tests begin with 3000 + case 3000: sendToken((IsolatedInDock)design); break; + case 3001: testFlagAB((IsolatedInDock)design); break; + default: fatal(true, "Test number: "+testNum+" doesn't exist."); break; -- 1.7.10.4