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;
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;
83
81
import java.util.ArrayList;
84
82
import java.util.Collections;
85
83
import java.util.Date;
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();
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 = "";
200
public SpicePreferences() { this(false, false); }
198
201
public SpicePreferences(boolean factory, boolean cdl)
239
242
ignoreParasiticResistors = Simulation.isSpiceIgnoreParasiticResistors();
240
243
epicMemorySize = Simulation.getSpiceEpicMemorySize();
241
244
extractedNetDelimiter = Simulation.getSpiceExtractedNetDelimiter();
245
ignoreModelFiles = Simulation.isSpiceIgnoreModelFiles();
243
247
cdlLibName = Simulation.getCDLLibName();
244
248
cdlLibPath = Simulation.getCDLLibPath();
326
330
String filename = filePath.substring(start, filePath.length());
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));
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);
340
345
if (runSpice.equals(Simulation.spiceRunChoiceRunIgnoreOutput)) {
909
914
if (fun.isResistor())
911
if ((fun.isPolyOrWellResistor() && isShortExplicitResistors()) ||
916
if ((fun.isComplexResistor() && isShortExplicitResistors()) ||
912
917
(fun == PrimitiveNode.Function.RESIST && isShortResistors()))
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;
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)
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()))
1562
1572
protected String parameterizedName(Nodable no, VarContext context)
1564
1574
Cell cell = (Cell)no.getProto();
1565
StringBuffer uniqueCellName = new StringBuffer(getUniqueCellName(cell));
1575
String uniqueName = getUniqueCellName(cell);
1576
if (uniqueName == null)
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);
1583
StringBuffer uniqueCellName = new StringBuffer(uniqueName);
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
2831
2849
private static final boolean CELLISEMPTYDEBUG = false;
2832
2850
private Map<Cell,Boolean> checkedCells = new HashMap<Cell,Boolean>();
2834
private boolean cellIsEmpty(Cell cell)
2852
public boolean cellIsEmpty(Cell cell)
2836
2854
Boolean b = checkedCells.get(cell);
2837
2855
if (b != null) return b.booleanValue();
3131
3149
this.file = file;
3134
public void processFinished(Exec.FinishedEvent e) {
3135
URL fileURL = TextUtils.makeURLToFile(file);
3137
// create a new waveform window
3138
WaveformWindow ww = WaveformWindow.findWaveformWindow(cell);
3140
Simulate.plotSimulationResults(type, cell, fileURL, ww);
3152
public void processFinished(Exec.FinishedEvent e)
3154
// URL fileURL = TextUtils.makeURLToFile(file);
3156
// // create a new waveform window
3157
// WaveformWindow ww = WaveformWindow.findWaveformWindow(cell);
3159
// Simulate.plotSimulationResults(type, cell, fileURL, ww);
3160
SwingUtilities.invokeLater(new Runnable() { public void run() {
3161
Simulate.plotSpiceResultsThisCell();