X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Fcom%2Fsun%2Fvlsi%2Fchips%2Fmarina%2Ftest%2FMarina.java;h=12dee06a5aae47e0014e4ced22851d5d61672dfb;hb=c5a81b4b1730b55ae77947584b3eb75de194a13f;hp=dfc2b592dfc7511a851855f9a66796e660c9c906;hpb=74c0578c820fde83bddd777a5474c7efc9684e09;p=fleet.git diff --git a/src/com/sun/vlsi/chips/marina/test/Marina.java b/src/com/sun/vlsi/chips/marina/test/Marina.java index dfc2b59..12dee06 100644 --- a/src/com/sun/vlsi/chips/marina/test/Marina.java +++ b/src/com/sun/vlsi/chips/marina/test/Marina.java @@ -1,11 +1,6 @@ package com.sun.vlsi.chips.marina.test; /* -*- tab-width: 4 -*- */ -import com.sun.async.test.BitVector; -import com.sun.async.test.ChainControl; -import com.sun.async.test.ChipModel; -import com.sun.async.test.JtagTester; -import com.sun.async.test.NanosimModel; -import com.sun.async.test.VerilogModel; +import com.sun.electric.tool.simulation.test.*; import edu.berkeley.fleet.api.Instruction; import edu.berkeley.fleet.marina.MarinaPath; @@ -21,12 +16,14 @@ public class Marina { public static int TOKEN_FIFO_CAPACITY = 3; - public static boolean kesselsCounter = true; - //public static boolean kesselsCounter = false; + //public static final boolean kesselsCounter = true; + public static final boolean kesselsCounter = false; + public static final boolean omegaCounter = false; public static final String DATA_CHAIN = kesselsCounter ? "marina.marina_data" : "marina.ivan_data"; public static final String CONTROL_CHAIN = kesselsCounter ? "marina.marina_control" : "marina.ivan_control"; public static final String REPORT_CHAIN = kesselsCounter ? "marina.marina_report" : "marina.ivan_report"; + public static final String DUKE_CHAIN = "marina.duke"; public static String prefix = "marinaGu@0.outDockW@"+(kesselsCounter?"3":"0")+".marinaOu@"+(kesselsCounter?"1":"0")+"."; public static String MASTER_CLEAR = "mc"; @@ -41,7 +38,7 @@ public class Marina { prefix+"outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.scanEx3h@1"; // bits 2,4,6 private static final String OLC_PATH_ODD = prefix+"outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.olcWcont@0.scanEx3h@2"; // bits 1,3,5 - private static final String OLC_PATH_KESSEL = + public static final String OLC_PATH_KESSEL = prefix+"outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.counte@0.adamScan@1.scanEx6h@"; private static final String ILC_PATH_ODD = prefix+"outputDo@0.outM1Pre@0.outDockP@0.outDockC@0.ilcMoveO@0.scanEx4h@0"; // bits 1,3,5,7 @@ -108,7 +105,7 @@ public class Marina { // The name of the scan chain // The instance path, from the top cell of the netlist, of the instance of infinityWithCover - private final ChainControls cc; // specifies the scan chain + public final ChainControls cc; // specifies the scan chain private final ChipModel model; public final ProperStopper data; public final InstructionStopper instrIn; @@ -117,7 +114,7 @@ public class Marina { private void pr(String msg) {indenter.pr(msg);} /** Shift the report scan chain */ - private void shiftReport(boolean readEnable, boolean writeEnable) { + public void shiftReport(boolean readEnable, boolean writeEnable) { cc.shift(REPORT_CHAIN, readEnable, writeEnable); } @@ -131,23 +128,46 @@ public class Marina { cc.shift(DATA_CHAIN, readEnable, writeEnable); } + /** Shift the data scan chain */ + public void shiftDuke(boolean readEnable, boolean writeEnable) { + cc.shift(DUKE_CHAIN, readEnable, writeEnable); + } + public Marina(ChainControls cc, ChipModel model, boolean clockHack, Indenter indenter) { this.cc = cc; this.model = model; this.indenter = indenter; data = new ProperStopper("north fifo", prefix+"northFif@1.fillDrai@1.properSt@1", - CONTROL_CHAIN, - DATA_CHAIN, - REPORT_CHAIN, - cc, model, clockHack, indenter); + cc, model, clockHack, indenter, + prefix+"northFif@1.fillDrai@1.instruct@0.cntScnTh@1.cntScnOn@1"); instrIn = new InstructionStopper("south fifo", prefix+"southFif@1.tapPropS@1.properSt@1", - CONTROL_CHAIN, - DATA_CHAIN, - REPORT_CHAIN, - cc, model, clockHack, indenter); + cc, model, clockHack, indenter, + prefix+"southFif@1.tapPropS@1.instruct@0.cntScnTh@1.cntScnOn@1"); + } + + int northCount = 0; + int southCount = 0; + + public void stopAndResetCounters() { + instrIn.setCounterEnable(false); + data.setCounterEnable(false); + cc.shift(DATA_CHAIN, true, false); + northCount = data.getCounterValue(); + southCount = instrIn.getCounterValue(); + data.setCounterValue(0); + instrIn.setCounterValue(0); + } + public void startCounters() { startCounters(true, true); } + public void startCounters(boolean south, boolean north) { + instrIn.setCounterEnable(south); + data.setCounterEnable(north); } + public int getNorthCount() { return northCount; } + public int getSouthCount() { return southCount; } + + public void masterClear() { final double WIDTH = 10; // ns // Put a high going pulse on the internal chip master clear signal @@ -267,10 +287,21 @@ public class Marina { nModel.setNodeVoltage(MASTER_CLEAR,0.0); nModel.waitNS(1); } else { - prln("FIXME!"); + + mc0.setLogicState(true); + mc1.setLogicState(true); + model.waitNS(1000); + mc0.setLogicState(false); + mc1.setLogicState(false); + model.waitNS(1000); + } resetAfterMasterClear(); } + + JtagLogicLevel mc0; + JtagLogicLevel mc1; + private void resetAfterMasterClear() { // The following call to ChainControl.resetInBits() is vital! // If you forget, then the inBits member initializes @@ -296,7 +327,42 @@ public class Marina { /** Get the 6 bit outer loop counter. */ public int getOLC() { shiftReport(true, false); - if (kesselsCounter) { + if (omegaCounter) { + BitVector bits = null; + for(int i=0; i<4; i++) { + BitVector x = cc.getOutBits(REPORT_CHAIN+"."+OLC_PATH_KESSEL+i); + //System.out.println("bits are: " + x); + bits = bits==null ? x : bits.cat(x); + } + System.out.print(" kesselsCounter = "); + int ret = 0; + boolean done = true; + boolean bad = false; + for(int bit=5; bit>=0; bit--) { + boolean zeroOrTwo = bits.get(4+bit*3); + boolean zeroOrDone = bits.get(4+bit*3+1); + if ( zeroOrTwo && !zeroOrDone) { + ret += (2<