From c5a81b4b1730b55ae77947584b3eb75de194a13f Mon Sep 17 00:00:00 2001 From: Adam Megacz Date: Thu, 19 Nov 2009 19:02:35 -0800 Subject: [PATCH] switch to VoltageReadablePowerChannel, add a bunch of tests --- src/com/sun/vlsi/chips/marina/test/Marina.java | 6 +- src/com/sun/vlsi/chips/marina/test/MarinaTest.java | 741 ++++++++++++-------- 2 files changed, 467 insertions(+), 280 deletions(-) diff --git a/src/com/sun/vlsi/chips/marina/test/Marina.java b/src/com/sun/vlsi/chips/marina/test/Marina.java index 353c049..12dee06 100644 --- a/src/com/sun/vlsi/chips/marina/test/Marina.java +++ b/src/com/sun/vlsi/chips/marina/test/Marina.java @@ -16,9 +16,9 @@ public class Marina { public static int TOKEN_FIFO_CAPACITY = 3; - //public static boolean kesselsCounter = true; - public static boolean kesselsCounter = false; - public static boolean omegaCounter = 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"; diff --git a/src/com/sun/vlsi/chips/marina/test/MarinaTest.java b/src/com/sun/vlsi/chips/marina/test/MarinaTest.java index 01b394d..98044b2 100644 --- a/src/com/sun/vlsi/chips/marina/test/MarinaTest.java +++ b/src/com/sun/vlsi/chips/marina/test/MarinaTest.java @@ -163,6 +163,12 @@ public class MarinaTest { static PowerChannel vdd18; static PowerChannel vdd10; + static PowerChannel vdds; + + private void setVdd10(float v) { + if (vdd10==null) return; + vdd10.setVoltageWait(v); + } private void doSim() throws Exception { String netListName; @@ -178,11 +184,17 @@ public class MarinaTest { return; } + Infrastructure.gpibControllers = new int[]{1}; - vdd18 = new Pst3202Channel("ch2", "tiPST3202", 2); - vdd10 = new Pst3202Channel("ch3", "tiPST3202", 3); - vdd10.setVoltageNoWait(vdd); - vdd18.setVoltageNoWait(1.8f); + vdd18 = new Pst3202Channel("ch1", "tiPST3202", 1); + vdd18 = new Pst3202Channel("ch3", "tiPST3202", 3); + vdd10 = new PowerChannelResistorVoltageReadable(new Pst3202Channel("ch2", "tiPST3202", 2), + 1000, + new HP34401A("HP34970"), + true); + + if (vdd10!=null) setVdd10(vdd); + if (vdd18!=null) vdd18.setVoltageNoWait(1.8f); model = cmdArgs.useVerilog ? new VerilogModel() @@ -209,58 +221,61 @@ public class MarinaTest { JtagTester tester = model instanceof SimulationModel ? ((SimulationModel)model).createJtagTester("TCK", "TMS", "TRSTb", "TDI", "TDO") - : new Netscan("jtag2"); // bad kessels counter - //: new Netscan4("jtag3", 4); // good kessels counter + : new Netscan("jtag2"); + //: new Netscan("10.0.0.200"); + //: new Signalyzer(); + //: new Netscan("jtag2"); JtagLogicLevel mc0=null; JtagLogicLevel mc1=null; - if (tester instanceof Netscan) { - ((Netscan)tester).reset(); + if (tester instanceof NetscanGeneric) { + ((NetscanGeneric)tester).reset(); // master clear // not sure if "GPIO1" means "index 0" or not mc0 = new JtagLogicLevel(tester, 0); mc1 = new JtagLogicLevel(tester, 1); + mc1 = mc0; mc0.setLogicState(true); mc1.setLogicState(true); } /* - Logger.setLogInits(true); - tester.setLogSets(true); - tester.setLogOthers(true); - tester.setAllLogging(true); - tester.printInfo = true; + Logger.setLogInits(true); + tester.setLogSets(true); + tester.setLogOthers(true); + tester.setAllLogging(true); + tester.printInfo = true; */ tester.printInfo = false; ChainControls ccs = new ChainControls(); PowerChannel pc = new ManualPowerChannel("pc", false); /* - JtagTester testerD, testerR, testerC; - testerD = ((SimulationModel)model).createJtagSubchainTester("sid[1:9]", null); - testerR = ((SimulationModel)model).createJtagSubchainTester("sir[1:9]", null); - testerC = ((SimulationModel)model).createJtagSubchainTester("sic[1:9]", null); - testerD.printInfo = testerR.printInfo = testerC.printInfo = false; + JtagTester testerD, testerR, testerC; + testerD = ((SimulationModel)model).createJtagSubchainTester("sid[1:9]", null); + testerR = ((SimulationModel)model).createJtagSubchainTester("sir[1:9]", null); + testerC = ((SimulationModel)model).createJtagSubchainTester("sic[1:9]", null); + testerD.printInfo = testerR.printInfo = testerC.printInfo = false; - ccD = new ChainControl(SCAN_CHAIN_XML, testerD, 1.8f, khz); - ccR = new ChainControl(SCAN_CHAIN_XML, testerR, 1.8f, khz); - ccC = new ChainControl(SCAN_CHAIN_XML, testerC, 1.8f, khz); - ccD.noTestSeverity = ccR.noTestSeverity = ccC.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE; + ccD = new ChainControl(SCAN_CHAIN_XML, testerD, 1.8f, khz); + ccR = new ChainControl(SCAN_CHAIN_XML, testerR, 1.8f, khz); + ccC = new ChainControl(SCAN_CHAIN_XML, testerC, 1.8f, khz); + ccD.noTestSeverity = ccR.noTestSeverity = ccC.noTestSeverity = Infrastructure.SEVERITY_NOMESSAGE; - ctD = new ChainTest(ccD, pc); - ctR = new ChainTest(ccR, pc); - ctC = new ChainTest(ccC, pc); + ctD = new ChainTest(ccD, pc); + ctR = new ChainTest(ccR, pc); + ctC = new ChainTest(ccC, pc); */ /* - ccs.addChain(Marina.DATA_CHAIN, ccD); - ccs.addChain(Marina.REPORT_CHAIN, ccR); - ccs.addChain(Marina.CONTROL_CHAIN, ccC); + ccs.addChain(Marina.DATA_CHAIN, ccD); + ccs.addChain(Marina.REPORT_CHAIN, ccR); + ccs.addChain(Marina.CONTROL_CHAIN, ccC); */ /* - PowerChannel ch2 = new Pst3202Channel("ch2", "tiPST3202", 2); - PowerChannel ch3 = new Pst3202Channel("ch3", "tiPST3202", 3); - Infrastructure.gpibControllers = new int[]{1}; - ch2.setVoltageNoWait(1f); - ch3.setVoltageNoWait(1.8f); + PowerChannel ch2 = new Pst3202Channel("ch2", "tiPST3202", 2); + PowerChannel ch3 = new Pst3202Channel("ch3", "tiPST3202", 3); + Infrastructure.gpibControllers = new int[]{1}; + ch2.setVoltageNoWait(1f); + ch3.setVoltageNoWait(1.8f); */ @@ -737,65 +752,65 @@ public class MarinaTest { //for (int i=-1; i<6; i++) { marina.fillSouthProperStopper(new Instruction[] { - new Instruction.Head(dock), + new Instruction.Head(dock), - // new Instruction.Set(dock,Predicate.IgnoreFlagD, SetDest.OuterLoopCounter, 1), - FLAG_NOP, - FLAG_NOP, - FLAG_NOP, - TORPEDOABLE_RECV_DATA, - FLAG_NOP, - FLAG_NOP, - FLAG_NOP, + // new Instruction.Set(dock,Predicate.IgnoreFlagD, SetDest.OuterLoopCounter, 1), + FLAG_NOP, + FLAG_NOP, + FLAG_NOP, + TORPEDOABLE_RECV_DATA, + FLAG_NOP, + FLAG_NOP, + FLAG_NOP, - //new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement), + //new Instruction.Set(dock,Predicate.IgnoreFlagD,SetDest.OuterLoopCounter, SetSource.Decrement), - new Instruction.Tail(dock), - }); + new Instruction.Tail(dock), + }); marina.fillSouthProperStopper(new Instruction[] { - null, - }, - true); + null, + }, + true); while(true) { - BitVector bits = null; - marina.shiftReport(true, false); - for(int i=0; i<4; i++) { - BitVector x = marina.cc.getOutBits(marina.REPORT_CHAIN+"."+marina.OLC_PATH_KESSEL+i); - //System.out.println("bits are: " + x); - bits = bits==null ? x : bits.cat(x); - } - System.out.println("dec="+bits.get(0)); - if (bits.get(1)) throw new RuntimeException(); + BitVector bits = null; + marina.shiftReport(true, false); + for(int i=0; i<4; i++) { + BitVector x = marina.cc.getOutBits(marina.REPORT_CHAIN+"."+marina.OLC_PATH_KESSEL+i); + //System.out.println("bits are: " + x); + bits = bits==null ? x : bits.cat(x); + } + System.out.println("dec="+bits.get(0)); + if (bits.get(1)) throw new RuntimeException(); } */ /* for (int i=0; i<64; i++) { - if (marina.kesselsCounter) { - System.out.println("master-clearing..."); - // master clear on each iteration; otherwise we'd need to "run down" the olc - marina.masterClear(); - marina.enableInstructionSend(true); - } - - expectTokensExactly(0); - marina.getOLC(); - - int inOlc = i==-1 ? 0 : (1< 24.3ns for 62 counts => 390ps cycle time => 2.5Ghz + marina.fillSouthProperStopper(new Instruction[] { + new Instruction.Head(dock), + setOlc(xx), + FLAG_NOP, + FLAG_NOP, + TORPEDOABLE_RECV_DATA, + FLAG_NOP, + FLAG_NOP, + SEND_DATA, + new Instruction.Tail(dock), + }, false, false); + + marina.fillSouthProperStopper(new Instruction[] { + /* + new Instruction.Set(dock,Predicate.FlagD, + Instruction.Set.FlagFunction.ZERO.add(Predicate.NotFlagA), + Instruction.Set.FlagFunction.ZERO), + setOlcIfZero(32), + setIlc(63), + SEND_DATA_IF_A_SET_AND_D_NOT_SET, + setIlc(63), + SEND_DATA_IF_A_SET_AND_D_NOT_SET, + DEC, + setIlc(63), + SEND_DATA_IF_A_SET_AND_D_NOT_SET, + setIlc(63), + SEND_DATA, + */ + null, + null, + null, + null, + null, + null, + null, + null, + }, true, true); + + //marina.startCounters(false, false); + + marina.instrIn.run(); + + vdd10.setVoltageWait(vdd); + marina.startCounters(false, true); + + try { Thread.sleep(wait); } catch (Exception e) { } + //marina.instrIn.stop(); + + marina.stopAndResetCounters(); + int countNorth = marina.getNorthCount(); + int countSouth = marina.getSouthCount(); + pw.println(xx + " " + countNorth + " " + vdd + " " + vdd10.readCurrent()); + pw.flush(); + System.out.println(xx + " " + countNorth + " " + vdd + " " + vdd10.readCurrent()); + } + pw.close(); + break; + } + case 8888: { + + //int wait = 1000; + int wait = 200; + //int toks = 1; + + PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream("out.dat"))); + for(double myvdd = 1.00; myvdd<1.01; myvdd += 0.05) { + vdd = (float)myvdd; + vdd18.setVoltageWait((float)Math.max(1.8,vdd)); + vdd10.setVoltageWait(vdd); + Thread.sleep(1000); for(int toks = 0; toks < 13; toks++) { - int MAX_ITER = 10; - double total = 0; - for(int iter = 0; iter < MAX_ITER; iter++) { + int MAX_ITER = 10; + double total = 0; + for(int iter = 0; iter < MAX_ITER; iter++) { - marina.masterClear(); - marina.data.sink(); - marina.stopAndResetCounters(); + marina.masterClear(); + marina.data.sink(); + marina.stopAndResetCounters(); - marina.enableInstructionSend(true); - marina.fillSouthProperStopper(setOlc(1)); - marina.fillSouthProperStopper(new Instruction.Head(dock)); - for(int i=0; i (2<<29)) - System.out.println("warning: count was greater than 2^29..."); - double gst = ((((double)count*2)) / (1000000. * wait /* * toks*/)); - System.out.println("south counter is: " + count + ", which is " + gst + "Ginst/sec with toks="+toks + " @vdd="+vdd); - total += gst; - - System.out.println(); - System.out.println(); - /* - System.out.println("counters are " + count + " and " + countNorth + "; ratio is "+ - (((double)countNorth)/((double)(count*2))) + " " + - (((double)countNorth)/((double)(count*2+1))) + " " + - ""); - */ - } - pw.println(vdd + " " + toks + " " + (((double)total) / MAX_ITER)); - pw.flush(); + marina.instrIn.run(); + + // have to set the voltage while drawing current + vdd10.setVoltageWait(vdd); + + marina.startCounters(); + try { Thread.sleep(wait); } catch (Exception e) { } + marina.stopAndResetCounters(); + //marina.instrIn.stop(); + + int countNorth = marina.getNorthCount(); + int countSouth = marina.getSouthCount(); + System.out.println(); + System.out.println(); + if (countSouth > (2<<29)) + System.out.println("warning: count was greater than 2^29..."); + double gst = ((((double)countSouth*2)) / (1000000. * wait /* * toks*/)); + System.out.println("south counter is: " + countSouth + ", which is " + gst + "Ginst/sec with toks="+toks + " @vdd="+vdd); + total += gst; + + System.out.println(); + System.out.println(); + /* + System.out.println("counters are " + count + " and " + countNorth + "; ratio is "+ + (((double)countNorth)/((double)(count*2))) + " " + + (((double)countNorth)/((double)(count*2+1))) + " " + + ""); + */ } + float vdd10v = vdd10.readVoltage(); + float vdd18v = vdd18.readVoltage(); + float vddsv = vdds.readCurrent(); + float vdd10c = vdd10.readCurrent(); + float vdd18c = vdd18.readCurrent(); + pw.println(vdd + " " + + toks + " " + + (((double)total) / MAX_ITER) + " " + + //vddsv + " " + + vdd10c + " " + + vdd18v + " " + + vdd18c + " " + + ""); + pw.flush(); } - break; } - case 9999: - loadEveryValueOLC(marina); - countOlc(marina); - break; - - default: - fatal(true, "Test number: "+testNum+" doesn't exist."); - break; + break; + } + case 8889: { + + int wait = 1000; + //int wait = 200; + //int toks = 1; + + PrintWriter pw = new PrintWriter(new OutputStreamWriter(new FileOutputStream("out.dat"))); + for(int toks = 0; toks < 13; toks++) { + int MAX_ITER = 10; + double total = 0; + for(int iter = 0; iter < MAX_ITER; iter++) { + + marina.masterClear(); + marina.data.sink(); + marina.stopAndResetCounters(); + + marina.enableInstructionSend(true); + marina.fillSouthProperStopper(setOlc(1)); + marina.fillSouthProperStopper(new Instruction.Set(dock,Predicate.IgnoreFlagD, + Instruction.Set.FlagFunction.ZERO, + Instruction.Set.FlagFunction.ZERO)); + marina.fillSouthProperStopper(new Instruction.Head(dock)); + //marina.fillSouthProperStopper(setIlc(31)); + marina.fillSouthProperStopper(SEND_DATA); + for(int i=0; i (2<<29)) + System.out.println("warning: count was greater than 2^29..."); + double gst = ((((double)count*2)) / (1000000. * wait /* * toks*/)); + System.out.println("south counter is: " + count + ", which is " + gst + "Ginst/sec with toks="+toks + " @vdd="+vdd); + total += gst; + + System.out.println(); + System.out.println(); + } + pw.println(vdd + " " + toks + " " + (((double)total) / MAX_ITER)); + pw.flush(); + } + break; } - // If we get here then test passed - prln("Test Result: Passed"); - printTestTime(); - //Infrastructure.exit(0); + case 9999: + loadEveryValueOLC(marina); + countOlc(marina); + break; + + default: + fatal(true, "Test number: "+testNum+" doesn't exist."); + break; + } + // If we get here then test passed + prln("Test Result: Passed"); + printTestTime(); + //Infrastructure.exit(0); } -- 1.7.10.4