📄 simulation.java
字号:
public static boolean isWaveformDisplayMultiState() { return cacheWaveformDisplayMultiState.getBoolean(); } /** * Method to set whether the waveform uses a multi-state display. * Multi-state displays distinguish different strengths with different colors in the waveform window, * and use different colors to distinguish different levels when drawing the cross-probing of the waveform * in the schematics and layout window. * @param m true if the waveform uses a multi-state display. */ public static void setWaveformDisplayMultiState(boolean m) { cacheWaveformDisplayMultiState.setBoolean(m); } /** * Method to tell whether the waveform uses a multi-state display, by default. * Multi-state displays distinguish different strengths with different colors in the waveform window, * and use different colors to distinguish different levels when drawing the cross-probing of the waveform * in the schematics and layout window. * @return true if the waveform uses a multi-state display, by default. */ public static boolean isFactoryWaveformDisplayMultiState() { return cacheWaveformDisplayMultiState.getBooleanFactoryValue(); } /****************************** IRSIM OPTIONS ******************************/ private static Pref cacheIRSIMShowsCommands = Pref.makeBooleanPref("IRSIMShowsCommands", tool.prefs, false); /** * Method to tell whether IRSIM shows commands that are issued (for debugging). * @return true if IRSIM shows commands that are issued (for debugging). */ public static boolean isIRSIMShowsCommands() { return cacheIRSIMShowsCommands.getBoolean(); } /** * Method to set if IRSIM shows commands that are issued (for debugging). * @param r true if IRSIM shows commands that are issued (for debugging). */ public static void setIRSIMShowsCommands(boolean r) { cacheIRSIMShowsCommands.setBoolean(r); } /** * Method to tell whether IRSIM shows commands that are issued (for debugging), by default. * @return true if IRSIM shows commands that are issued (for debugging), by default. */ public static boolean isFactoryIRSIMShowsCommands() { return cacheIRSIMShowsCommands.getBooleanFactoryValue(); } private static Pref cacheIRSIMDebugging = Pref.makeIntPref("IRSIMDebugging", tool.prefs, 0); /** * Method to tell the debugging level for IRSIM simulation. * This is a combination of bits, where: * Bit 1: debug event scheduling (Sim.DEBUG_EV) * Bit 2: debug final value computation (Sim.DEBUG_DC) * Bit 3: debug tau/delay computation (Sim.DEBUG_TAU) * Bit 4: debug taup computation (Sim.DEBUG_TAUP) * Bit 5: debug spike analysis (Sim.DEBUG_SPK) * Bit 6: debug tree walk (Sim.DEBUG_TW) * @return the debugging level for IRSIM simulation. */ public static int getIRSIMDebugging() { return cacheIRSIMDebugging.getInt(); } /** * Method to set the debugging level for IRSIM simulation. * This is a combination of bits, where: * Bit 1: debug event scheduling (Sim.DEBUG_EV) * Bit 2: debug final value computation (Sim.DEBUG_DC) * Bit 3: debug tau/delay computation (Sim.DEBUG_TAU) * Bit 4: debug taup computation (Sim.DEBUG_TAUP) * Bit 5: debug spike analysis (Sim.DEBUG_SPK) * Bit 6: debug tree walk (Sim.DEBUG_TW) * @param p the debugging level for IRSIM simulation. */ public static void setIRSIMDebugging(int p) { cacheIRSIMDebugging.setInt(p); } /** * Method to tell the debugging level for IRSIM simulation, by default. * This is a combination of bits, where: * Bit 1: debug event scheduling (Sim.DEBUG_EV) * Bit 2: debug final value computation (Sim.DEBUG_DC) * Bit 3: debug tau/delay computation (Sim.DEBUG_TAU) * Bit 4: debug taup computation (Sim.DEBUG_TAUP) * Bit 5: debug spike analysis (Sim.DEBUG_SPK) * Bit 6: debug tree walk (Sim.DEBUG_TW) * @return the debugging level for IRSIM simulation, by default. */ public static int getFactoryIRSIMDebugging() { return cacheIRSIMDebugging.getIntFactoryValue(); } private static Pref cacheIRSIMParameterFile = Pref.makeStringPref("IRSIMParameterFile", tool.prefs, "scmos0.3.prm"); /** * Method to tell the parameter file to use for IRSIM. * @return the parameter file to use for IRSIM. */ public static String getIRSIMParameterFile() { return cacheIRSIMParameterFile.getString(); } /** * Method to set the parameter file to use for IRSIM. * @param p the parameter file to use for IRSIM. */ public static void setIRSIMParameterFile(String p) { cacheIRSIMParameterFile.setString(p); } /** * Method to tell the parameter file to use for IRSIM, by default. * @return the parameter file to use for IRSIM, by default. */ public static String getFactoryIRSIMParameterFile() { return cacheIRSIMParameterFile.getStringFactoryValue(); } private static Pref cacheIRSIMStepModel = Pref.makeStringPref("IRSIMStepModel", tool.prefs, "RC"); /** * Method to tell the stepping model to use for IRSIM. * Possible choices are "RC" (the default) and "Linear". * @return the stepping model to use for IRSIM. */ public static String getIRSIMStepModel() { return cacheIRSIMStepModel.getString(); } /** * Method to set the stepping model to use for IRSIM. * Possible choices are "RC" (the default) and "Linear". * @param m the stepping model to use for IRSIM. */ public static void setIRSIMStepModel(String m) { cacheIRSIMStepModel.setString(m); } /** * Method to tell the stepping model to use for IRSIM, by default. * Possible choices are "RC" and "Linear". * @return the stepping model to use for IRSIM, by default. */ public static String getFactoryIRSIMStepModel() { return cacheIRSIMStepModel.getStringFactoryValue(); } private static Pref cacheIRSIMDelayedX = Pref.makeBooleanPref("IRSIMDelayedX", tool.prefs, true); /** * Get whether or not IRSIM uses a delayed X model, versus the old fast-propogating X model. * @return true if using the delayed X model, false if using the old fast-propogating X model. */ public static boolean isIRSIMDelayedX() { return cacheIRSIMDelayedX.getBoolean(); } /** * Get whether or not IRSIM uses a delayed X model, versus the old fast-propogating X model. * @param b true to use the delayed X model, false to use the old fast-propogating X model. */ public static void setIRSIMDelayedX(boolean b) { cacheIRSIMDelayedX.setBoolean(b); } /** * Get whether or not IRSIM uses a delayed X model, versus the old fast-propogating X model, by default. * @return true if using the delayed X model, false if using the old fast-propogating X model, by default. */ public static boolean isFactoryIRSIMDelayedX() { return cacheIRSIMDelayedX.getBooleanFactoryValue(); } /****************************** SPICE OPTIONS ******************************/ public enum SpiceEngine { /** Spice 2 engine. */ SPICE_ENGINE_2(0, "Spice 2"), /** Spice 3 engine. */ SPICE_ENGINE_3(1, "Spice 3"), /** HSpice engine. */ SPICE_ENGINE_H(2, "HSpice"), /** PSpice engine. */ SPICE_ENGINE_P(3, "PSpice"), /** GNUCap engine. */ SPICE_ENGINE_G(4, "Gnucap"), /** SmartSpice engine. */ SPICE_ENGINE_S(5, "SmartSpice"), /** HSpice engine for Assura. */ SPICE_ENGINE_H_ASSURA(6, "HSpice for Assura"), /** HSpice engine for Calibre. */ SPICE_ENGINE_H_CALIBRE(7, "HSpice for Calibre"); private int code; private String name; private SpiceEngine(int val, String name) { this.code = val; this.name = name; } public int code() { return code; } public String toString() { return name;} } private static Pref cacheSpiceEngine = Pref.makeIntPref("SpiceEngine", tool.prefs, SpiceEngine.SPICE_ENGINE_H.code());// static// {// Pref.Meaning m = cacheSpiceEngine.attachToObject(tool, "Spice tab", "Spice engine");// m.setTrueMeaning(new String[] {"Spice 2", "Spice 3", "HSpice", "PSpice", "GNUCap", "SmartSpice"});// } /** * Method to tell which SPICE engine is being used. * Since different versions of SPICE have slightly different syntax, * this is needed to tell the deck generator which variation to target. * @return which SPICE engine is being used. * These constants are available: <BR> * Simulation.SPICE_ENGINE_2 for Spice 2.<BR> * Simulation.SPICE_ENGINE_3 for Spice 3.<BR> * Simulation.SPICE_ENGINE_H for HSpice.<BR> * Simulation.SPICE_ENGINE_P for PSpice.<BR> * Simulation.SPICE_ENGINE_G for GNUCap.<BR> * Simulation.SPICE_ENGINE_S for Smart Spice.<BR> * Simulation.SPICE_ENGINE_H_ASSURA for HSpice for Assura.<BR> * Where Simulation.SPICE_ENGINE_3 is the default. */ public static SpiceEngine getSpiceEngine() { int cache = cacheSpiceEngine.getInt(); for (SpiceEngine p : SpiceEngine.values()) { if (p.code() == cache) return p; } throw new Error("No Spice engine found"); } /** * Method to set which SPICE engine is being used. * Since different versions of SPICE have slightly different syntax, * this is needed to tell the deck generator which variation to target. * @param engine which SPICE engine is being used. * These constants are available: <BR> * Simulation.SpiceEngine.SPICE_ENGINE_2 for Spice 2.<BR> * Simulation.SpiceEngine.SPICE_ENGINE_3 for Spice 3. (the default)<BR> * Simulation.SpiceEngine.SPICE_ENGINE_H for HSpice.<BR> * Simulation.SpiceEngine.SPICE_ENGINE_P for PSpice.<BR> * Simulation.SpiceEngine.SPICE_ENGINE_G for GNUCap.<BR> * Simulation.SpiceEngine.SPICE_ENGINE_S for Smart Spice.<BR> * Simulation.SpiceEngine.SPICE_ENGINE_H_ASSURA for HSpice for Assura. */ public static void setSpiceEngine(SpiceEngine engine) { cacheSpiceEngine.setInt(engine.code()); } /** * Method to tell which SPICE engine is being used, by default. * Since different versions of SPICE have slightly different syntax, * this is needed to tell the deck generator which variation to target. * @return which SPICE engine is being used, by default. * These constants are available: <BR> * Simulation.SPICE_ENGINE_2 for Spice 2.<BR> * Simulation.SPICE_ENGINE_3 for Spice 3.<BR> * Simulation.SPICE_ENGINE_H for HSpice.<BR> * Simulation.SPICE_ENGINE_P for PSpice.<BR> * Simulation.SPICE_ENGINE_G for GNUCap.<BR> * Simulation.SPICE_ENGINE_S for Smart Spice.<BR> * Simulation.SPICE_ENGINE_H_ASSURA for HSpice for Assura.<BR> */ public static SpiceEngine getFactorySpiceEngine() { int cache = cacheSpiceEngine.getIntFactoryValue(); for (SpiceEngine p : SpiceEngine.values()) { if (p.code() == cache) return p; } throw new Error("No Spice engine found"); } private static Pref cacheSpiceLevel = Pref.makeStringPref("SpiceLevel", tool.prefs, "1");// static { cacheSpiceLevel.attachToObject(tool, "Tools/Spice tab", "Spice level"); } /** * Method to tell which SPICE level is being used. * SPICE can use 3 different levels of simulation. * @return which SPICE level is being used (1, 2, or 3). */ public static String getSpiceLevel() { return cacheSpiceLevel.getString(); } /** * Method to set which SPICE level is being used. * SPICE can use 3 different levels of simulation. * @param level which SPICE level is being used (1, 2, or 3). */ public static void setSpiceLevel(String level) { cacheSpiceLevel.setString(level); } /** * Method to tell which SPICE level is being used, by default. * SPICE can use 3 different levels of simulation. * @return which SPICE level is being used (1, 2, or 3), by default. */ public static String getFactorySpiceLevel() { return cacheSpiceLevel.getStringFactoryValue(); } private static Pref cacheSpiceOutputFormat = Pref.makeStringPref("SpiceOutputFormat", tool.prefs, "Standard");// static { cacheSpiceOutputFormat.attachToObject(tool, "Tools/Spice tab", "Spice output format"); } /** * Method to tell the type of output files expected from Spice. * @return the type of output files expected from Spice. * The values are:<BR> * "Standard": Standard output (the default)<BR> * "Raw" Raw output<BR> * "Raw/Smart": Raw output from SmartSpice<BR> */ public static String getSpiceOutputFormat() { return cacheSpiceOutputFormat.getString(); } /** * Method to set the type of output files expected from Spice. * @param format the type of output files expected from Spice. * The values are:<BR> * "Standard": Standard output (the default)<BR> * "Raw" Raw output<BR> * "Raw/Smart": Raw output from SmartSpice<BR> */ public static void setSpiceOutputFormat(String format) { cacheSpiceOutputFormat.setString(format); } /** * Method to tell the type of output files expected from Spice, by default. * @return the type of output files expected from Spice, by default. * The values are:<BR> * "Standard": Standard output<BR> * "Raw" Raw output<BR> * "Raw/Smart": Raw output from SmartSpice<BR> */ public static String getFactorySpiceOutputFormat() { return cacheSpiceOutputFormat.getStringFactoryValue(); } private static Pref cacheSpiceShortResistors = Pref.makeIntPref("SpiceShortResistors", tool.prefs, 0); /** * Method to tell how SPICE should short resistors. * These values can be: <BR> * 0 for no resistor shorting.<BR> * 1 for parasitic resistor shorting (normal resistors shorted, poly resistors not shorted).<BR> * 2 for all resistor shorting.<BR> * @return how SPICE should short resistors. */ public static int getSpiceShortResistors() { return cacheSpiceShortResistors.getInt(); } /** * Method to set how SPICE should short resistors. * @param sr how SPICE should short resistors: <BR> * 0 for no resistor shorting.<BR> * 1 for parasitic resistor shorting (normal resistors shorted, poly resistors not shorted).<BR> * 2 for all resistor shorting.<BR> */ public static void setSpiceShortResistors(int sr) { cacheSpiceShortResistors.setInt(sr); } /** * Method to tell how SPICE should short resistors, by default. * These values can be: <BR> * 0 for no resistor shorting.<BR> * 1 for parasitic resistor shorting (normal resistors shorted, poly resistors not shorted).<BR> * 2 for all resistor shorting.<BR> * @return how SPICE should short resistors, by default. */ public static int getFactorySpiceShortResistors() { return cacheSpiceShortResistors.getIntFactoryValue(); } public static final String spiceRunChoiceDontRun = "Don't Run"; public static final String spiceRunChoiceRunIgnoreOutput = "Run, Ignore Output"; public static final String spiceRunChoiceRunReportOutput = "Run, Report Output"; private static final String [] spiceRunChoices = {spiceRunChoiceDontRun, spiceRunChoiceRunIgnoreOutput, spiceRunChoiceRunReportOutput}; private static Pref cacheSpiceRunChoice = Pref.makeIntPref("SpiceRunChoice", tool.prefs, 0);// static {// Pref.Meaning m = cacheSpiceRunChoice.attachToObject(tool, "Tool Options, Spice tab", "Spice Run Choice");// m.setTrueMeaning(new String[] {spiceRunChoiceDontRun, spiceRunChoiceRunIgnoreOutput, spiceRunChoiceRunReportOutput});// } /** Determines possible settings for the Spice Run Choice */ public static String [] getSpiceRunChoiceValues() { return spiceRunChoices; } /** Get the current setting for the Spice Run Choice preference */ public static String getSpiceRunChoice() { return spiceRunChoices[cacheSpiceRunChoice.getInt()]; } /** Set the setting for the Spice Run Choice preference. Ignored if invalid */ public static void setSpiceRunChoice(String choice) { String [] values = getSpiceRunChoiceValues(); for (int i=0; i<values.length; i++) { if (values[i].equals(choice)) { cacheSpiceRunChoice.setInt(i); return; } } } /** Get the default setting for the Spice Run Choice preference */ public static String getFactorySpiceRunChoice() { return spiceRunChoices[cacheSpiceRunChoice.getIntFactoryValue()]; } private static Pref cacheSpiceRunDir = Pref.makeStringPref("SpiceRunDir", tool.prefs, "");// static { cacheSpiceRunDir.attachToObject(tool, "Tool Options, Spice tab", "Spice Run Dir"); } /** Get the spice run directory */ public static String getSpiceRunDir() { return cacheSpiceRunDir.getString(); } /** Set the spice run directory */ public static void setSpiceRunDir(String dir) { cacheSpiceRunDir.setString(dir); } /** Get the factory default spice run directory */ public static String getFactorySpiceRunDir() { return cacheSpiceRunDir.getStringFactoryValue(); } private static Pref cacheSpiceUseRunDir = Pref.makeBooleanPref("SpiceUseRunDir", tool.prefs, false);// static { cacheSpiceUseRunDir.attachToObject(tool, "Tool Options, Spice tab", "Use Run Dir"); } /** Get whether or not to use the user-specified spice run dir */ public static boolean getSpiceUseRunDir() { return cacheSpiceUseRunDir.getBoolean(); } /** Set whether or not to use the user-specified spice run dir */ public static void setSpiceUseRunDir(boolean b) { cacheSpiceUseRunDir.setBoolean(b); } /** Get whether or not to use the user-specified spice run dir, by default */ public static boolean getFactorySpiceUseRunDir() { return cacheSpiceUseRunDir.getBooleanFacto
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -