From 924ee923ef8760c72ccfd5851a4b1c8757d68b68 Mon Sep 17 00:00:00 2001 From: rkao Date: Wed, 10 Sep 2008 21:37:58 +0000 Subject: [PATCH] Support multiple designs, IsolatedInDock, ProperStoppers with write enables --- .../com/sun/vlsi/chips/marina/test/Counter.java | 15 +- .../com/sun/vlsi/chips/marina/test/Design.java | 7 + .../sun/vlsi/chips/marina/test/IsolatedInDock.java | 90 ++++++ .../com/sun/vlsi/chips/marina/test/Marina.java | 99 +++--- .../com/sun/vlsi/chips/marina/test/MarinaTest.java | 325 +++++++------------- .../sun/vlsi/chips/marina/test/MarinaUtils.java | 53 ++-- .../sun/vlsi/chips/marina/test/ProperStopper.java | 71 +++-- 7 files changed, 365 insertions(+), 295 deletions(-) create mode 100644 testCode/com/sun/vlsi/chips/marina/test/Design.java create mode 100644 testCode/com/sun/vlsi/chips/marina/test/IsolatedInDock.java diff --git a/testCode/com/sun/vlsi/chips/marina/test/Counter.java b/testCode/com/sun/vlsi/chips/marina/test/Counter.java index fe4b241..96e2f1f 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/Counter.java +++ b/testCode/com/sun/vlsi/chips/marina/test/Counter.java @@ -4,16 +4,23 @@ import com.sun.async.test.ChainControl; public class Counter { - private final String path; + private final String dataChain, dataPath; private final ChainControl cc; - public Counter(String path, ChainControl cc) { - this.path = path; + public Counter(String cntrInst, String dataChain, ChainControl cc) { + this.dataChain = dataChain; + this.dataPath = dataChain+'.'+cntrInst; this.cc = cc; } + /** Read a new value from the Counter */ public long getCount() { + cc.shift(dataChain, true, false); return 0; // do nothing because I counter schematics don't yet exist - //return cc.getOutBits(path).bitReverse().not().toLong(); + //long cnt = cc.getOutBits(dataPath).bitReverse().not().toLong(); + } + /** Set counter value to zero */ + public void clearCount() { + } } diff --git a/testCode/com/sun/vlsi/chips/marina/test/Design.java b/testCode/com/sun/vlsi/chips/marina/test/Design.java new file mode 100644 index 0000000..6216863 --- /dev/null +++ b/testCode/com/sun/vlsi/chips/marina/test/Design.java @@ -0,0 +1,7 @@ +package com.sun.vlsi.chips.marina.test; + +import com.sun.async.test.JtagTester; + +public interface Design { + public void masterClear(JtagTester tester); +} diff --git a/testCode/com/sun/vlsi/chips/marina/test/IsolatedInDock.java b/testCode/com/sun/vlsi/chips/marina/test/IsolatedInDock.java new file mode 100644 index 0000000..69ec064 --- /dev/null +++ b/testCode/com/sun/vlsi/chips/marina/test/IsolatedInDock.java @@ -0,0 +1,90 @@ +package com.sun.vlsi.chips.marina.test; +/* -*- tab-width: 4 -*- */ +import com.sun.async.test.ChainControl; +import com.sun.async.test.ChipModel; +import com.sun.async.test.JtagTester; +import com.sun.async.test.NanosimModel; + +/** The IsolatedInDock is a design consisting of an input dock with proper + * stoppers on all of its input and output ports. The IsolatedInDock allows + * us to run tests on a single input dock. */ +public class IsolatedInDock implements Design { + private static final String DATA_CHAIN = "marina.isolatedInDock_data"; + private static final String CONTROL_CHAIN = "marina.isolatedInDock_control"; + private static final String REPORT_CHAIN = "marina.isolatedInDock_report"; + + // The name of the scan chain + // The instance path, from the top cell of the netlist, of the instance of infinityWithCover + private final ChainControl cc; // specifies the scan chain + private final ChipModel model; + public final ProperStopper datIn, tokOut, insIn, shipOut; + + public IsolatedInDock(ChainControl cc, ChipModel model, Indenter indenter) { + this.cc = cc; + this.model = model; + datIn = new ProperStopper("datIn", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + tokOut = new ProperStopper("tokOut", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + insIn = new ProperStopper("insIn", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + shipOut = new ProperStopper("shipOut", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + } + public void masterClear(JtagTester tester) { + final double WIDTH = 10; // ns + NanosimModel nModel = (NanosimModel) model; + // Put a high going pulse on the internal chip master clear signal + nModel.setNodeVoltage("scanInD[9]",1.0); + nModel.setNodeVoltage("scanInC[9]",1.0); + nModel.setNodeVoltage("scanInR[9]",1.0); + nModel.waitNS(WIDTH); + nModel.setNodeVoltage("scanInD[9]",0.0); + nModel.setNodeVoltage("scanInC[9]",0.0); + nModel.setNodeVoltage("scanInR[9]",0.0); + + resetAfterMasterClear(); + } + private void resetAfterMasterClear() { + // For reset, I want to clear all the stoppers simultaneously + datIn.clear(); + tokOut.clear(); + insIn.clear(); + shipOut.clear(); + + datIn.stop(); + tokOut.stop(); + insIn.stop(); + shipOut.stop(); + + datIn.resetAfterMasterClear(); + tokOut.resetAfterMasterClear(); + insIn.resetAfterMasterClear(); + shipOut.resetAfterMasterClear(); + } +// /** Shift the data scan chain. */ +// public void shiftData(boolean readEnable, boolean writeEnable) { +// // Get current data of all stoppers +// cc.shift(DATA_CHAIN, readEnable, writeEnable); +// } +// /** Shift the control scan chain */ +// public void shiftControl(boolean readEnable, boolean writeEnable) { +// cc.shift(CONTROL_CHAIN, readEnable, writeEnable); +// } +// /** Shift the report scan chain */ +// public void shiftReport(boolean readEnable, boolean writeEnable) { +// cc.shift(REPORT_CHAIN, readEnable, writeEnable); +// } +} diff --git a/testCode/com/sun/vlsi/chips/marina/test/Marina.java b/testCode/com/sun/vlsi/chips/marina/test/Marina.java index addb433..f701e4d 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/Marina.java +++ b/testCode/com/sun/vlsi/chips/marina/test/Marina.java @@ -2,64 +2,93 @@ package com.sun.vlsi.chips.marina.test; /* -*- tab-width: 4 -*- */ import com.sun.async.test.ChainControl; import com.sun.async.test.ChipModel; +import com.sun.async.test.JtagLogicLevel; +import com.sun.async.test.JtagTester; +import com.sun.async.test.NanosimModel; -public class Marina { +/** The Marina object will eventually represent the Marina test chip. + * Right now, it doesn't do much of anything. It just helps me exercise + * my test infrastructure. */ +public class Marina implements Design { private static final String DATA_CHAIN = "marina.jtag_dockTest_data"; private static final String CONTROL_CHAIN = "marina.jtag_dockTest_control"; private static final String REPORT_CHAIN = "marina.jtag_dockTest_report"; // The name of the scan chain // The instance path, from the top cell of the netlist, of the instance of infinityWithCover - private final String instPath; private final ChainControl cc; // specifies the scan chain + private final ChipModel model; public final ProperStopper stopper1, stopper2; public final Counter counter; public Marina(ChainControl cc, ChipModel model, boolean wholeChipNetlist, Indenter indenter) { this.cc = cc; - instPath = wholeChipNetlist ? ".bigGuts.infinity@1" : ""; - stopper1 = new ProperStopper(CONTROL_CHAIN, instPath+".ps1", - DATA_CHAIN, instPath+".ps1", - REPORT_CHAIN, instPath+".ps1", - cc, model, indenter); - stopper2 = new ProperStopper(CONTROL_CHAIN, instPath+".ps2", - DATA_CHAIN, instPath+".ps2", - REPORT_CHAIN, instPath+".ps2", - cc, model, indenter); - counter = new Counter(DATA_CHAIN+instPath+".cnt", cc); + this.model = model; + stopper1 = new ProperStopper("ps1", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + stopper2 = new ProperStopper("ps2", + CONTROL_CHAIN, + DATA_CHAIN, + REPORT_CHAIN, + cc, model, indenter); + counter = new Counter("??", DATA_CHAIN, cc); } - public void resetAfterMasterClear() { - // For reset, I want to clear all the stoppers with - // a single shift + public void masterClear(JtagTester tester) { + final double WIDTH = 10; + if (model instanceof NanosimModel) { + NanosimModel nModel = (NanosimModel) model; + System.out.println("master clear"); + // Put a low going pulse on the chip's master clear pin. This clears + // the master clear register. The master clear register's output is + // inverted. This inverse drivers the chip's internal master clear + // signal. + nModel.setNodeVoltage("mc",0.0); + nModel.waitNS(WIDTH); + nModel.setNodeVoltage("mc",1.0); + } else { + JtagLogicLevel jll = new JtagLogicLevel(tester, 0); + jll.setLogicState(false); + model.wait(0.100f); + jll.setLogicState(true); + + // Set the master clear register. This resets the chip's internal + // master clear. + cc.setInBits("Infinity.jtag_mc", "1"); + cc.shift("Infinity.jtag_mc", false, true); + } + resetAfterMasterClear(); + } + + + private void resetAfterMasterClear() { + // For reset, I want to simultaneously clear all the stoppers stopper1.clear(); stopper2.clear(); - shiftControl(false, true); stopper1.stop(); stopper2.stop(); - shiftControl(false, true); stopper1.resetAfterMasterClear(); stopper2.resetAfterMasterClear(); } - /** Shift the data scan chain. */ - public void shiftData() { - // Get current data of all stoppers - cc.shift(DATA_CHAIN, true, false); - } - /** Shift the control scan chain */ - public void shiftControl(boolean readEnable, boolean writeEnable) { - cc.shift(CONTROL_CHAIN, readEnable, writeEnable); - } - /** Shift the report scan chain */ - public void shiftReport(boolean readEnable, boolean writeEnable) { - cc.shift(REPORT_CHAIN, readEnable, writeEnable); - } - public void setRotator(boolean r1) { - cc.setInBits(CONTROL_CHAIN+instPath+".infinity@1.infinity@1.rot", r1); - } +// /** Shift the data scan chain. */ +// public void shiftData(boolean readEnable, boolean writeEnable) { +// // Get current data of all stoppers +// cc.shift(DATA_CHAIN, readEnable, writeEnable); +// } +// /** Shift the control scan chain */ +// public void shiftControl(boolean readEnable, boolean writeEnable) { +// cc.shift(CONTROL_CHAIN, readEnable, writeEnable); +// } +// /** Shift the report scan chain */ +// public void shiftReport(boolean readEnable, boolean writeEnable) { +// cc.shift(REPORT_CHAIN, readEnable, writeEnable); +// } public void initCounterScanBits(boolean val) { - cc.setInBits(DATA_CHAIN+instPath+".infinity@1.infinity@0.cnt", val); - cc.setInBits(DATA_CHAIN+instPath+".infinity@1.infinity@5.cnt", val); + cc.setInBits(DATA_CHAIN+".infinity@1.infinity@0.cnt", val); + cc.setInBits(DATA_CHAIN+".infinity@1.infinity@5.cnt", val); } } diff --git a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java index 7e6a714..1d580a9 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/testCode/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -1,13 +1,8 @@ package com.sun.vlsi.chips.marina.test; /* -*- tab-width: 4 -*- */ import java.io.File; -import java.io.PrintStream; import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; -import java.util.Map; -import java.util.Random; import com.sun.async.test.BitVector; import com.sun.async.test.ChainControl; @@ -15,7 +10,6 @@ import com.sun.async.test.ChainTest; import com.sun.async.test.ChipModel; import com.sun.async.test.HP34401A; import com.sun.async.test.Infrastructure; -import com.sun.async.test.JtagLogicLevel; import com.sun.async.test.JtagTester; import com.sun.async.test.ManualPowerChannel; import com.sun.async.test.NanosimModel; @@ -25,40 +19,31 @@ import com.sun.async.test.Pst3202Channel; import com.sun.async.test.SiliconChip; import com.sun.async.test.SimulationModel; import com.sun.async.test.VoltageReadable; +import com.sun.vlsi.chips.marina.test.MarinaUtils.CmdArgs; +import com.sun.vlsi.chips.marina.test.MarinaUtils.Station; +import com.sun.vlsi.chips.marina.test.MarinaUtils.CmdArgs.Mode; /** * Tests for Marina - * User: Russell Kao */ public class MarinaTest { //-------------------------- constants ----------------------------------- // COLUMN_LATENCY is a delay that is larger than the latency through an Infinity column private static final int COLUMN_LATENCY = 10; // nanoseconds - private final MarinaUtils.Station station; - - private enum Select {all, even, odd}; - + //-------------------------------- types --------------------------------- - private static class RingResult { - public final List thruput, current, vddErr; - public RingResult(List t, List c, List v) { - thruput=t; current=c; vddErr=v; - } - public int size() {return Math.max(thruput.size(), current.size());} - } //-------------------------- private data -------------------------------- private static long startTime; private Indenter indenter = new Indenter(); - private final Marina mar; - private final ChipModel model; - private final ChainControl cc; - private final JtagTester tester; - private final boolean wholeChipNetlist; + private Design design; + private ChipModel model; + private ChainControl cc; + private JtagTester tester; + private CmdArgs cmdArgs; private PowerChannel corePowerSupply, padsPowerSupply; private VoltageReadable coreVoltmeter, voltmeterForCurrent; - private final String dataOutDir; //-------------------------- private methods ----------------------------- /** @return true if simulation. Return false if we're testing silicon. */ @@ -81,17 +66,20 @@ public class MarinaTest { } // Tell user what we're about to do - private static void reportTask(MarinaUtils.CmdArgs args) { + private static void reportTask(CmdArgs args) { System.out.println("Begin testing Marina"); switch (args.mode) { - case SIM_EXPERIMENT_SCHEMATIC: - System.out.println(" Simulation of Marina from schematics"); + case ISOLATED_IN_DOCK: + System.out.println(" Simulate isolated input dock"); + break; + case ISOLATED_OUT_DOCK: + System.out.println(" Simulate isolated output dock"); break; - case SIM_EXPERIMENT_LAYOUT: - System.out.println(" Simulation of Marina from layout"); + case WHOLE_CHIP_SCHEMATIC_PARASITICS: + System.out.println(" Simulate whole chip, schematic parasitics"); break; - case SIM_CHIP_SCHEMATIC: - System.out.println(" Simulation of full chip from schematics"); + case WHOLE_CHIP_LAYOUT_PARASITICS: + System.out.println(" Simulate whole chip, layout parasitics"); break; case TEST_SILICON: System.out.println(" Test silicon"); @@ -101,13 +89,38 @@ public class MarinaTest { return; } } + private void setUpSuppliesAndMeters(Station station) { + // set up power supplies and meters + if (!sim()) { + prln("Testing station: "+station); + Infrastructure.gpibControllers = new int[] {0}; + switch (cmdArgs.station) { + case ONE: + corePowerSupply = new Pst3202Channel("ch1", "HPST3202", 1); + padsPowerSupply = new Pst3202Channel("ch2", "HPST3202", 2); + break; + case TWO: + corePowerSupply = new Pst3202Channel("ch1", "HPST3202B", 1); + padsPowerSupply = new Pst3202Channel("ch2", "HPST3202B", 2); + break; + default: + fatal(true, "Unrecognized station: "+cmdArgs.station); + } + corePowerSupply.setCurrent((float)1.7); + corePowerSupply.setVoltageWait((float)1.0); + + padsPowerSupply.setCurrent((float)0.100); + padsPowerSupply.setVoltageWait((float)1.8); + + coreVoltmeter = new HP34401A(station.coreVoltmeter); + voltmeterForCurrent = new HP34401A(station.currentVoltmenter); + } + } - private static void standAlone(String[] args) { - MarinaUtils.CmdArgs cmdArgs = new MarinaUtils.CmdArgs(args); + private MarinaTest(String[] args) { + cmdArgs = new MarinaUtils.CmdArgs(args); reportTask(cmdArgs); - ChipModel model; - JtagTester tester; - boolean sim = cmdArgs.mode != MarinaUtils.CmdArgs.Mode.TEST_SILICON; + boolean sim = cmdArgs.mode != Mode.TEST_SILICON; if (sim) { model = new NanosimModel(); tester = ((SimulationModel)model).createJtagTester("TCK", "TMS", "TRSTb", "TDI", "TDO"); @@ -117,91 +130,61 @@ public class MarinaTest { tester = new Netscan4(ip, cmdArgs.station.jtagChannel); } tester.printInfo = false; - String xmlFileName = cmdArgs.wholeChipNetlist() ? - "../testCode/marinaWholeChip.xml" - : - "../testCode/marina.xml"; - int khz = sim ? 1000000 : 1000; - ChainControl cc = new ChainControl(xmlFileName, tester, 1.8f, khz); - - - PowerChannel pc = new ManualPowerChannel("pc", false); - ChainTest ct = new ChainTest(cc, pc); - - String dataOutDir = cmdArgs.chipNum==-1 ? "" : ("chip"+cmdArgs.chipNum+"/infinity/"); - - MarinaTest it = new MarinaTest(model, cc, tester, cmdArgs.wholeChipNetlist(), - cmdArgs.station, dataOutDir); + String netListName; switch (cmdArgs.mode) { - case SIM_EXPERIMENT_SCHEMATIC: - netListName = "marina.spi"; break; - case SIM_EXPERIMENT_LAYOUT: - netListName = "marinaFromLay.spi"; break; - case SIM_CHIP_SCHEMATIC: + case ISOLATED_IN_DOCK: + netListName = "isolatedInDock.spi"; + cc = new ChainControl("../testCode/isolatedInDock.xml", tester, 1.8f, khz); + design = new IsolatedInDock(cc, model, indenter); + break; + case ISOLATED_OUT_DOCK: + netListName = "isolatedOutDock.spi"; + cc = new ChainControl("../testCode/isolatedOutDock.xml", tester, 1.8f, khz); + design = null; + break; + case WHOLE_CHIP_SCHEMATIC_PARASITICS: + netListName = "marina_pads_guts.spi"; + cc = new ChainControl("???", tester, 1.8f, khz); + design = null; + break; + case WHOLE_CHIP_LAYOUT_PARASITICS: + netListName = "marina_pads_guts.spi"; + cc = new ChainControl("???", tester, 1.8f, khz); + design = null; + break; case TEST_SILICON: - netListName = "marina_pads_guts.spi"; break; + netListName = "marina_pads_guts.spi"; + cc = new ChainControl("???", tester, 1.8f, khz); + design = null; + break; default: fatal(true, "unrecognized CmdArgs.Mode"); return; } + cc.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE; + + PowerChannel pc = new ManualPowerChannel("pc", false); + ChainTest ct = new ChainTest(cc, pc); + + setUpSuppliesAndMeters(cmdArgs.station); if (sim) ((SimulationModel)model).start("nanosim -c cfg", netListName, 0, true); ct.testAllChains("marina", Infrastructure.SEVERITY_WARNING); - it.doOneTest(cmdArgs.testNum); + doOneTest(cmdArgs.testNum); if (sim) ((SimulationModel)model).finish(); - } +} + /** In the absence of looping, the longest path through Infinity is 4 column delays */ private void waitUntilQuiescent() { model.waitNS(4*COLUMN_LATENCY); } - private void masterClear() { - final double WIDTH = 10; - if (model instanceof NanosimModel) { - NanosimModel nModel = (NanosimModel) model; - System.out.println("master clear"); - if (wholeChipNetlist) { - // Put a low going pulse on the chip's master clear pin. This clears - // the master clear register. The master clear register's output is - // inverted. This inverse drivers the chip's internal master clear - // signal. - nModel.setNodeVoltage("mc",0.0); - nModel.waitNS(WIDTH); - nModel.setNodeVoltage("mc",1.0); - } else { - // Put a high going pulse on the internal chip master clear signal - nModel.setNodeVoltage("scanInD[9]",1.0); - nModel.setNodeVoltage("scanInC[9]",1.0); - nModel.setNodeVoltage("scanInR[9]",1.0); - nModel.waitNS(WIDTH); - nModel.setNodeVoltage("scanInD[9]",0.0); - nModel.setNodeVoltage("scanInC[9]",0.0); - nModel.setNodeVoltage("scanInR[9]",0.0); - } - } else { - JtagLogicLevel jll = new JtagLogicLevel(tester, 0); - jll.setLogicState(false); - model.wait(0.100f); - jll.setLogicState(true); - - // Set the master clear register. This resets the chip's internal - // master clear. - cc.setInBits("Infinity.jtag_mc", "1"); - cc.shift("Infinity.jtag_mc", false, true); - } - } private double readCurrent() { - return voltmeterForCurrent.readVoltage() / station.ammeterShuntResistance; - } - - /** You must master clear before calling resetForTest */ - private void resetAfterMasterClear() { - prln("reset after master clear"); - mar.resetAfterMasterClear(); + return voltmeterForCurrent.readVoltage() / cmdArgs.station.ammeterShuntResistance; } /** Generate List of BitVectors where Token=true, high 25 data bits @@ -223,15 +206,14 @@ public class MarinaTest { return ans; } private void stopToStop(ProperStopper s1, ProperStopper s2, + Counter ctr, List din) { prln("Begin stopToStop"); adjustIndent(2); s1.stop(); - mar.shiftControl(false, true); -// mar.shiftData(); -// long ctrAStart = mar.counter.getCount(); + long ctrStart = ctr==null ? 0 : ctr.getCount(); s1.fillMany(din); waitUntilQuiescent(); @@ -240,16 +222,14 @@ public class MarinaTest { MarinaUtils.compareItemsOrdered(din, dout); -// mar.shiftData(); -// long ctrAEnd = mar.counter.getCount(); -// long deltaA = ctrAEnd - ctrAStart; -// -// long sz = din.size(); -// long expectA = ctrAChg ? sz : 0; -// fatal(deltaA!=expectA, -// "counter A delta wrong: expected delta: "+expectA+ -// " counter before:"+ctrAStart+" counter after:"+ctrAEnd); - + if (ctr!=null) { + long ctrEnd = ctr.getCount(); + long delta = ctrEnd - ctrStart; + long expect = din.size(); + fatal(delta!=expect, + "counter delta wrong: expected delta: "+expect+ + " counter before:"+ctrStart+" counter after:"+ctrEnd); + } adjustIndent(-2); prln("End stopToStop"); @@ -258,78 +238,65 @@ public class MarinaTest { * is then run to allow the burst to flow. */ private void stopToStopBurst(ProperStopper src, ProperStopper gate, ProperStopper dst, + Counter ctr, List din) { prln("Begin stopToStopBurst test"); adjustIndent(2); src.stop(); gate.stop(); - mar.shiftControl(false, true); -// mar.shiftData(); -// long ctrAStart = mar.counter.getCount(); + long ctrStart = ctr==null ? 0 : ctr.getCount(); src.fillMany(din); waitUntilQuiescent(); // open the gate to start the burst gate.run(); - mar.shiftControl(false, true); waitUntilQuiescent(); List dout = dst.drainMany(); MarinaUtils.compareItemsOrdered(din, dout); -// mar.shiftData(); -// long ctrAEnd = mar.counter.getCount(); -// long deltaA = ctrAEnd - ctrAStart; -// -// long sz = din.size(); -// long expectA = ctrAChg ? sz : 0; -// fatal(deltaA!=expectA, -// "counter A delta wrong: expected delta: "+expectA+ -// " counter before:"+ctrAStart+" counter after:"+ctrAEnd); - + if (ctr!=null) { + long ctrEnd = ctr.getCount(); + long delta = ctrEnd - ctrStart; + + long expectA = din.size(); + fatal(delta!=expectA, + "counter delta wrong: expected delta: "+expectA+ + " counter before:"+ctrStart+" counter after:"+ctrEnd); + } adjustIndent(-2); prln("End stopToStopBurst test"); } - private void stopToStopOne(ProperStopper s1, ProperStopper s2, int adr) { + private void stopToStopOne(ProperStopper s1, ProperStopper s2, + Counter ctr, int adr) { prln("Begin stopToStopOne"); adjustIndent(2); List din = makeIncrDataConstAdr(1, adr); - stopToStop(s1, s2, din); + stopToStop(s1, s2, ctr, din); adjustIndent(-2); prln("End stopToStopOne"); } - private void stopToStopThree(ProperStopper s1, ProperStopper s2, int adr) { + private void stopToStopThree(ProperStopper s1, ProperStopper s2, + Counter ctr, int adr) { prln("Begin stopToStopOne"); adjustIndent(2); List din = makeIncrDataConstAdr(3, adr); - stopToStop(s1, s2, din); + stopToStop(s1, s2, ctr, din); adjustIndent(-2); prln("End stopToStopOne"); } - private BitVector extractAddr(BitVector dataTokAddr) { - fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); - return dataTokAddr.get((37+1), 14); - } - private BitVector extractToken(BitVector dataTokAddr) { - fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); - return dataTokAddr.get(37, 1); - } - private BitVector extractData(BitVector dataTokAddr) { - fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); - return dataTokAddr.get(0, 37); - } private int indexOf(BitVector o, List dIn) { for (int i=0; i select which test to run"); System.out.println(" -vdd "); System.out.println(" -temp "); - System.out.println(" -ringNum 1 for Left Ring and 2 for Right Ring (only for crosser experiment)"); - System.out.println(" -numTokensOther from 0:13, occupancy of ring NOT under throughput analysis"); - System.out.println(" -exptSch simulate netlist of experiment only, parasitics from schematic"); - System.out.println(" -exptSch simulate netlist of experiment only, parasitics from schematic"); - System.out.println(" -exptLay simulate netlist of experiment only, parasitics from layout"); + System.out.println(" -isoIn simulate netlist of isolated input dock only, parasitics from schematic"); + System.out.println(" -isoOut simulate netlist of isolated output dock only, parasitics from schematic"); System.out.println(" -chipSch simulate netlist of entire chip, parasitics from schematic"); + System.out.println(" -chipLay simulate netlist of entire chip, parasitics from layout"); System.out.println(" -silicon test the silicon"); System.out.println(" -chipNum store test results according to chip number"); System.out.println(" -station select test station"); @@ -81,14 +79,6 @@ public class MarinaUtils { i++; if (i>=nbArgs) usage(); temp = Float.parseFloat(args[i]); - } else if (args[i].equals("-ringNum")) { - i++; - if (i>=nbArgs) usage(); - ringNum = Integer.parseInt(args[i]); - } else if (args[i].equals("-numTokensOther")) { - i++; - if (i>=nbArgs) usage(); - numTokensOther = Integer.parseInt(args[i]); } else if (args[i].equals("-chipNum")) { i++; if (i>=nbArgs) usage(); @@ -102,13 +92,11 @@ public class MarinaUtils { default: System.out.println("Bad station: "+args[i]); usage(); } } else if (args[i].equals("-exptSch")) { - mode = CmdArgs.Mode.SIM_EXPERIMENT_SCHEMATIC; + mode = CmdArgs.Mode.ISOLATED_IN_DOCK; } else if (args[i].equals("-exptLay")) { - mode = CmdArgs.Mode.SIM_EXPERIMENT_LAYOUT; - } else if (args[i].equals("-chipSch")) { - mode = CmdArgs.Mode.SIM_CHIP_SCHEMATIC; + mode = CmdArgs.Mode.ISOLATED_OUT_DOCK; } else if (args[i].equals("-chipLay")) { - mode = CmdArgs.Mode.SIM_CHIP_LAYOUT; + mode = CmdArgs.Mode.WHOLE_CHIP_SCHEMATIC_PARASITICS; } else if (args[i].equals("-silicon")) { mode = CmdArgs.Mode.TEST_SILICON; } else { @@ -445,4 +433,17 @@ public class MarinaUtils { dta.get(37,1).getState() + " " + dta.get(38,14).getState(); } + public static BitVector extractAddr(BitVector dataTokAddr) { + fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); + return dataTokAddr.get((37+1), 14); + } + public static BitVector extractToken(BitVector dataTokAddr) { + fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); + return dataTokAddr.get(37, 1); + } + public static BitVector extractData(BitVector dataTokAddr) { + fatal(dataTokAddr.getNumBits()!=37+1+14, "wrong length for data token addr"); + return dataTokAddr.get(0, 37); + } + } \ No newline at end of file diff --git a/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java b/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java index 1bbce01..d4482c6 100644 --- a/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java +++ b/testCode/com/sun/vlsi/chips/marina/test/ProperStopper.java @@ -6,15 +6,20 @@ import com.sun.async.test.BitVector; import com.sun.async.test.ChainControl; import com.sun.async.test.ChipModel; import com.sun.async.test.Infrastructure; +import com.sun.async.test.NanosimModel; import com.sun.vlsi.chips.marina.test.MarinaUtils.StateWireState; public class ProperStopper { - private boolean traceFill = true; + private final String captureClockRelPath = "aFillSta@0.all1in52@1.data1in3@0"; + private final String captureClockName = "wrr"; + + private boolean traceFill = true; private boolean traceDrain = true; private final String controlChain, controlPath, dataChain, dataPath, reportChain, reportPath; + private final String captureClock; private final ChainControl cc; private final ChipModel model; private final Indenter indenter; @@ -24,6 +29,20 @@ public class ProperStopper { } private void prln(String msg) {indenter.prln(msg);} private void adjustIndent(int n) {indenter.adjustIndent(n);} + + /** NanosimModel.setNodeState() requires special path names. + * Each instance name in the path must begin with the character 'x'. + * Return a path with the added X's. */ + private String prefixInstNamesInPathWithX(String path) { + StringBuffer sb = new StringBuffer(); + sb.append('x'); + for (int i=0; i