add results from actual silicon in marina/results/
[fleet.git] / chips / marina / testCode / regen.bsh
1 import com.sun.electric.plugins.menus.ScanChainXML;
2
3 /*
4  * Create a ScanChainXML object
5  */
6
7 import com.sun.electric.tool.user.menus.FileMenu;
8 import com.sun.electric.tool.user.menus.FileMenu.ReadLibrary;
9 import com.sun.electric.tool.simulation.Simulation;
10 import com.sun.electric.tool.io.output.Output;
11 import com.sun.electric.tool.io.FileType;
12 import com.sun.electric.database.hierarchy.EDatabase;
13 import com.sun.electric.database.text.TextUtils;
14 import com.sun.electric.tool.Job;
15 import java.lang.Thread;
16 import java.net.URL;
17 import com.sun.electric.database.variable.EvalJavaBsh;
18 import com.sun.electric.database.hierarchy.View;
19 import com.sun.electric.tool.simulation.Simulation;
20 import com.sun.electric.tool.io.output.Output;
21 import com.sun.electric.database.hierarchy.EDatabase;
22 import com.sun.electric.database.hierarchy.View;
23
24   String topLevelCell = "fakeMarinaPadframe";
25   String topLevelLibrary = "aMarinaM";
26   String projectName = "marina";
27
28   Simulation.setVerilogStopAtStandardCells(false);
29
30   for (Library lib : EDatabase.clientDatabase().getLibraries()) {
31     for (Cell c : lib.getCells()) {
32       if (c.getName().equals(topLevelCell) && c.getView()==View.SCHEMATIC) {
33         Output.exportCellCommand(c, null, projectName+".v", FileType.VERILOG, null);
34         Output.exportCellCommand(c, null, projectName+".schematic-parasitics.spi", FileType.SPICE, null);
35       }
36     }
37   }
38   
39   ScanChainXML gen = new ScanChainXML();
40
41   // Add all the scan chain elements: name, access, clears, 
42   // scan in port name, scan out port name, 
43   // (optional:) data out port name (may be "" or null), 
44   // data out bar port name (may be "" or null).
45   // Both data out and data out bar must be specified or left out.
46
47   //gen.addScanChainElement("scanK", "scanCellKh", "R", "-", "sin", "sout", "din[1](R)", "");
48   gen.addScanChainElement("countersL", "cntScnOne", "RW", "-", "sin", "out", "out(R)", "latch2in@0.dataBar(WI)");
49
50   gen.addScanChainElement("scanM", "scanCellE", "RW", "-", "sin", "sout", "dIn[1](R)", "latch2in@0.dataBar(WI)");
51   gen.addScanChainElement("scanM", "scanCellF", "RW", "L", "sin", "sout", "dout[1](R)", "latch2in@1.dataBar(WI)");
52   gen.addScanChainElement("scanM", "scanCellFtaller", "RW", "L", "sin", "sout", "dout[1](R)", "latch2in@1.dataBar(WI)");
53
54   // Add all the pass through elements: these pass scan data through,
55   // like inverters or buffers
56
57   gen.addPassThroughCell("scanM", "scanAmp", "in[1]", "out[1]");
58
59   // Define the jtag controller by it's library, cell name,
60   // and the number of instruction register bits
61
62   gen.setJtagController("jtagController", "jtagCentral{sch}", 8, "TDI", "TDO");
63
64   // Chip-specific configuration
65
66   gen.setChipName(projectName);
67
68    gen.setOutput(projectName+".xml");
69    gen.addJtagPort(0,  "leaf0[1]", "leaf0[8]", "compare_report");
70    gen.addJtagPort(1,  "leaf1[1]", "leaf1[8]", "compare_control");
71    gen.addJtagPort(2,  "leaf2[1]", "leaf2[8]", "compare_data");
72    gen.addJtagPort(3,  "leaf3[1]", "leaf3[8]", "ivan_report");
73    gen.addJtagPort(4,  "leaf4[1]", "leaf4[8]", "ivan_data");
74    gen.addJtagPort(5,  "leaf5[1]", "leaf5[8]", "ivan_control");
75    gen.addJtagPort(6,  "leaf6[1]", "leaf6[8]", "marina_report");
76    gen.addJtagPort(7,  "leaf7[1]", "leaf7[8]", "marina_control");
77    gen.addJtagPort(8,  "leaf8[1]", "leaf8[8]", "marina_data");
78    gen.addJtagPort(12, "leaf12[1]", "leaf12[8]", "duke");
79
80    gen.start(topLevelLibrary, topLevelCell+"{sch}");
81
82