~ubuntu-branches/ubuntu/natty/electric/natty

« back to all changes in this revision

Viewing changes to com/sun/electric/tool/io/output/Spice.java

  • Committer: Bazaar Package Importer
  • Author(s): Onkar Shinde
  • Date: 2010-01-09 16:26:04 UTC
  • mfrom: (1.1.4 upstream) (3.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100109162604-1ypvmy8ijmlc6oq7
Tags: 8.10-1
* New upstream version.
* debian/control
  - Add libjava3d-java and quilt build dependencies.
  - Update standards version to 3.8.3.
  - Add libjava3d-java as recommends to binary package.
* debian/rules
  - Use quilt patch system instead of simple patchsys.
  - Add java3d related jar files to DEB_JARS.
* debian/patches/*
  - Update as per current upstream source. Convert to quilt.
* debian/ant.properties
  - Do not disable 3D plugin anymore.
  - Use new property to disable compilation of OS X related classes.
* debian/wrappers/electric
  - Add java3d related jar files to runtime classpath.
* debian/README.source
  - Change text to the appropriate one for quilt.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
import com.sun.electric.tool.user.User;
71
71
import com.sun.electric.tool.user.dialogs.ExecDialog;
72
72
import com.sun.electric.tool.user.ui.TopLevel;
73
 
import com.sun.electric.tool.user.waveform.WaveformWindow;
74
73
 
75
74
import java.awt.geom.AffineTransform;
76
75
import java.io.BufferedWriter;
79
78
import java.io.FileWriter;
80
79
import java.io.IOException;
81
80
import java.io.PrintWriter;
82
 
import java.net.URL;
83
81
import java.util.ArrayList;
84
82
import java.util.Collections;
85
83
import java.util.Date;
89
87
import java.util.List;
90
88
import java.util.Map;
91
89
import java.util.Set;
 
90
import java.util.regex.Matcher;
 
91
 
 
92
import javax.swing.SwingUtilities;
92
93
 
93
94
/**
94
95
 * This is the Simulation Interface tool.
185
186
        public boolean                      ignoreParasiticResistors = false;
186
187
        public int                          epicMemorySize = Simulation.getFactorySpiceEpicMemorySize();
187
188
        public String                       extractedNetDelimiter = Simulation.getFactorySpiceExtractedNetDelimiter();
 
189
        public boolean                      ignoreModelFiles = Simulation.isFactorySpiceIgnoreModelFiles();
188
190
 
189
191
        public String                       cdlLibName = Simulation.getFactoryCDLLibName();
190
192
        public String                       cdlLibPath = Simulation.getFactoryCDLLibPath();
195
197
        public Map<Cell,String>             modelFiles = Collections.emptyMap();
196
198
        public String                       workdir = "";
197
199
 
 
200
                public SpicePreferences() { this(false, false); }
198
201
                public SpicePreferences(boolean factory, boolean cdl)
199
202
                {
200
203
            super(factory);
239
242
            ignoreParasiticResistors        = Simulation.isSpiceIgnoreParasiticResistors();
240
243
            epicMemorySize                  = Simulation.getSpiceEpicMemorySize();
241
244
            extractedNetDelimiter           = Simulation.getSpiceExtractedNetDelimiter();
 
245
            ignoreModelFiles                = Simulation.isSpiceIgnoreModelFiles();
242
246
 
243
247
            cdlLibName                      = Simulation.getCDLLibName();
244
248
            cdlLibPath                      = Simulation.getCDLLibPath();
326
330
                String filename = filePath.substring(start, filePath.length());
327
331
 
328
332
                // replace vars in command and args
329
 
                command = command.replaceAll("\\$\\{WORKING_DIR}", workdir);
330
 
                command = command.replaceAll("\\$\\{USE_DIR}", rundir);
331
 
                command = command.replaceAll("\\$\\{FILENAME}", filename);
332
 
                command = command.replaceAll("\\$\\{FILENAME_NO_EXT}", filename_noext);
 
333
                command = command.replaceAll("\\$\\{WORKING_DIR}", Matcher.quoteReplacement(workdir));
 
334
                command = command.replaceAll("\\$\\{USE_DIR}", Matcher.quoteReplacement(rundir));
 
335
                command = command.replaceAll("\\$\\{FILEPATH}", Matcher.quoteReplacement(filePath));
 
336
                command = command.replaceAll("\\$\\{FILENAME}", Matcher.quoteReplacement(filename));
 
337
                command = command.replaceAll("\\$\\{FILENAME_NO_EXT}", Matcher.quoteReplacement(filename_noext));
333
338
 
334
339
                // set up run probe
335
340
                FileType type = Simulate.getSpiceOutputType(outputFormat, engine);
336
 
                String [] extensions = type.getExtensions();
337
 
                String outFile = rundir + File.separator + filename_noext + "." + extensions[0];
 
341
//                String [] extensions = type.getExtensions();
 
342
                String outFile = rundir + File.separator + filename_noext + "." + type.getFirstExtension();
338
343
                Exec.FinishedListener l = new SpiceFinishedListener(cell, type, outFile);
339
344
 
340
345
                if (runSpice.equals(Simulation.spiceRunChoiceRunIgnoreOutput)) {
908
913
                        {
909
914
                                if (fun.isResistor())
910
915
                                {
911
 
                    if ((fun.isPolyOrWellResistor() && isShortExplicitResistors()) ||
 
916
                    if ((fun.isComplexResistor() && isShortExplicitResistors()) ||
912
917
                        (fun == PrimitiveNode.Function.RESIST && isShortResistors()))
913
918
                                continue;
914
919
                                        Variable resistVar = ni.getVar(Schematics.SCHEM_RESISTANCE);
948
953
//                            if (ni.getProto().getName().equals("P-Well-RPO-Resistor")) fun = PrimitiveNode.Function.RESPWELL;
949
954
//                            if (ni.getProto().getName().equals("N-Well-RPO-Resistor")) fun = PrimitiveNode.Function.RESNWELL;
950
955
//                        }
951
 
                        if (fun == PrimitiveNode.Function.RESPPOLY || fun == PrimitiveNode.Function.RESNPOLY ||
952
 
                                fun == PrimitiveNode.Function.RESPWELL || fun == PrimitiveNode.Function.RESNWELL)
 
956
                        if (fun.isComplexResistor())
 
957
//                            fun == PrimitiveNode.Function.RESPPOLY || fun == PrimitiveNode.Function.RESNPOLY ||
 
958
//                              fun == PrimitiveNode.Function.RESPWELL || fun == PrimitiveNode.Function.RESNWELL)
953
959
                        {
954
960
                            partName = "XR";
955
961
                            double width = ni.getLambdaBaseYSize();
965
971
                            String prepend = "";
966
972
                            if (fun == PrimitiveNode.Function.RESPPOLY) prepend = "rppo1rpo"; else
967
973
                                if (fun == PrimitiveNode.Function.RESNPOLY) prepend = "rnpo1rpo"; else
968
 
                                        if (fun == PrimitiveNode.Function.RESPWELL) prepend = "rpwod "; else
969
 
                                        if (fun == PrimitiveNode.Function.RESNWELL) prepend = "rnwod ";
 
974
                                    if (fun == PrimitiveNode.Function.RESPNSPOLY) prepend = "rpponsrpo"; else   // made up value
 
975
                                        if (fun == PrimitiveNode.Function.RESNNSPOLY) prepend = "rnponsrpo"; else  // made up value
 
976
                                            if (fun == PrimitiveNode.Function.RESPWELL) prepend = "rpwod "; else
 
977
                                                if (fun == PrimitiveNode.Function.RESNWELL) prepend = "rnwod "; else
 
978
                                                   if (fun == PrimitiveNode.Function.RESPACTIVE) prepend = "rpaod "; else
 
979
                                                       if (fun == PrimitiveNode.Function.RESNACTIVE) prepend = "rnaod ";
970
980
                            if (layoutTechnology == Technology.getCMOS90Technology() ||
971
981
                                (cell.getView() == View.LAYOUT && cell.getTechnology() == Technology.getCMOS90Technology()))
972
982
                            {
1562
1572
    protected String parameterizedName(Nodable no, VarContext context)
1563
1573
    {
1564
1574
        Cell cell = (Cell)no.getProto();
1565
 
        StringBuffer uniqueCellName = new StringBuffer(getUniqueCellName(cell));
 
1575
        String uniqueName = getUniqueCellName(cell);
 
1576
        if (uniqueName == null)
 
1577
        {
 
1578
            uniqueName = cell.getName();
 
1579
            String msg = "Cell " + cell.describe(true) + " is missing information. Corresponding schematic might be missing";
 
1580
            msg += " Taking '" + uniqueName + "' now.";
 
1581
            dumpMessage(msg, true);
 
1582
        }
 
1583
        StringBuffer uniqueCellName = new StringBuffer(uniqueName);
1566
1584
 
1567
1585
        if (uniquifyCells.get(cell) != null && modelOverrides.get(cell) == null) {
1568
1586
            // if this cell is marked to be make unique, make a unique name out of the var context
2342
2360
                    fileName = str;
2343
2361
            }
2344
2362
        }
2345
 
        if (fileName != null) {
 
2363
        if (fileName != null && !localPrefs.ignoreModelFiles) {
2346
2364
            if (!modelOverrides.containsKey(cell))
2347
2365
            {
2348
2366
                String absFileName = fileName;
2831
2849
    private static final boolean CELLISEMPTYDEBUG = false;
2832
2850
    private Map<Cell,Boolean> checkedCells = new HashMap<Cell,Boolean>();
2833
2851
 
2834
 
    private boolean cellIsEmpty(Cell cell)
 
2852
    public boolean cellIsEmpty(Cell cell)
2835
2853
    {
2836
2854
        Boolean b = checkedCells.get(cell);
2837
2855
        if (b != null) return b.booleanValue();
3131
3149
            this.file = file;
3132
3150
        }
3133
3151
 
3134
 
        public void processFinished(Exec.FinishedEvent e) {
3135
 
            URL fileURL = TextUtils.makeURLToFile(file);
3136
 
 
3137
 
                        // create a new waveform window
3138
 
            WaveformWindow ww = WaveformWindow.findWaveformWindow(cell);
3139
 
 
3140
 
            Simulate.plotSimulationResults(type, cell, fileURL, ww);
 
3152
        public void processFinished(Exec.FinishedEvent e)
 
3153
        {
 
3154
//            URL fileURL = TextUtils.makeURLToFile(file);
 
3155
//
 
3156
//                      // create a new waveform window
 
3157
//            WaveformWindow ww = WaveformWindow.findWaveformWindow(cell);
 
3158
//
 
3159
//            Simulate.plotSimulationResults(type, cell, fileURL, ww);
 
3160
            SwingUtilities.invokeLater(new Runnable() { public void run() {
 
3161
                Simulate.plotSpiceResultsThisCell();
 
3162
            }});
3141
3163
        }
3142
3164
    }
3143
3165