Wrspice Manual (PDF)
Total Page:16
File Type:pdf, Size:1020Kb
WRspice Reference Manual Whiteley Research Incorporated Sunnyvale, CA 94086 Release 4.3.13 January 27, 2021 c Whiteley Research Incorporated, 2017. WRspice is part of the XicTools software package for integrated circuit design from White- ley Research Inc. WRspice was authored by S. R. Whiteley, with extensive adaptation of the Berkeley SPICE3 program. This manual was prepared by Whiteley Research Inc., ac- knowledging the material originally authored by the developers of SPICE3 in the Electrical Engineering and Computer Sciences Department of the University of California, Berkeley. WRspice, and the entire XicTools suite, including this manual, is provided as open-source under the Apache-2.0 license, as much as applicable per individual tools, some of which are GNU-licensed. WRspice and subsidiary programs and utilities are offered as-is, and the suitability of these programs for any purpose or application must be established by the user, as neither Whiteley Research Inc., or the University of California can imply or guarantee such suitability. ii This page intentionally left blank. Contents 1 Introduction to WRspice 1 1.1 History of WRspice ....................................... 1 1.2 WRspice Overview ....................................... 5 1.3 TypesofAnalysis ................................. ...... 8 1.4 Multi-threading ................................. ....... 11 1.4.1 Multi-ThreadedLoading . ..... 11 1.4.2 Multi-ThreadedLooping . ..... 12 1.5 ProgramControl.................................. ...... 13 1.6 Post-ProcessingandRunControl . .......... 14 1.7 IntroductiontoInteractiveSimulation . ............... 14 2 WRspice Input Format 21 2.1 InputFormat..................................... ..... 21 2.1.1 CaseSensitivity ............................... 22 2.1.2 NumericValues ................................. 23 2.1.3 Units......................................... 23 2.2 VariableExpansioninInput . ......... 24 2.3 Title, Comments, Job Separation, and Inclusions . ................ 25 2.3.1 TitleLine ..................................... 25 2.3.2 Comments...................................... 25 2.3.3 .title Line..................................... 25 2.3.4 .end Line ...................................... 26 2.3.5 .newjob Line .................................... 26 2.3.6 .include or .inc Line............................... 27 2.3.7 .lib Line ...................................... 27 2.3.8 .mosmap Line .................................... 29 2.4 Initialization .................................. ........ 29 2.4.1 .global Line .................................... 29 2.4.2 .ic Line ....................................... 30 2.4.3 .nodeset Line.................................... 30 iii iv CONTENTS 2.4.4 .options Line.................................... 30 2.4.4.1 SimulationOptions . 31 2.4.5 .table Line..................................... 35 2.4.6 .temp Line...................................... 36 2.5 ParametersandExpressions . ......... 36 2.5.1 Single-QuotedExpressions . ....... 36 2.5.2 .param Line..................................... 37 2.5.2.1 SubcircuitParameters. 38 2.5.2.2 Pre-DefinedParameters . 39 2.5.3 .if, .elif, .else, and .endif Lines....................... 39 2.6 Subcircuits ..................................... ...... 41 2.6.1 .subckt Line .................................... 41 2.6.1.1 SubcircuitExpansion . 42 2.6.1.2 wrspice Mode ........................... 43 2.6.1.3 spice3 Mode............................ 44 2.6.2 .ends Line...................................... 44 2.6.3 SubcircuitCalls ............................... 44 2.6.4 Subcircuit/ModelCache . ..... 45 2.7 AnalysisSpecification ............................ ......... 46 2.7.1 ChainedSweepAnalysis .......................... 47 2.7.2 .ac Line ....................................... 48 2.7.3 .dc Line ....................................... 49 2.7.4 .disto Line..................................... 50 2.7.5 .noise Line..................................... 52 2.7.6 .op Line ....................................... 53 2.7.7 .pz Line ....................................... 56 2.7.8 .sens Line...................................... 57 2.7.9 .tf Line ....................................... 57 2.7.10 .tran Line...................................... 58 2.8 OutputGeneration................................ ....... 60 2.8.1 .save Line...................................... 60 2.8.2 .print Line..................................... 61 2.8.3 .plot Line...................................... 61 2.8.4 .four Line...................................... 62 2.8.5 .width Line..................................... 62 2.9 ParameterMeasurementandTesting . .......... 62 2.9.1 .measure Line.................................... 62 2.9.2 .stop Line...................................... 62 CONTENTS v 2.10 ControlScriptExecution . .......... 63 2.10.1 .exec, .control, .postrun, and .endc Lines .................. 63 2.10.2 .check, .checkall, .monte, and .noexec Lines................. 65 2.11 VerilogInterface ............................... ......... 66 2.11.1 .verilog, .endv Lines............................... 66 2.11.2 .adc Line ...................................... 67 2.12 CircuitElements................................ ........ 68 2.13 DeviceModels ................................... ...... 69 2.13.1 DefaultModels ................................ 71 2.13.2 AnalysisatDifferentTemperatures . ......... 71 2.14 PassiveElementLines ............................ ......... 73 2.14.1 Capacitors ................................... 73 2.14.2 CapacitorModel ............................... 74 2.14.3 Inductors.................................... 74 2.14.4 InductorModel ................................ 75 2.14.5 Coupled(Mutual)Inductors . ....... 76 2.14.6 Resistors.................................... 76 2.14.7 ResistorModel ................................ 77 2.14.8 Switches ..................................... 79 2.14.9 SwitchModel .................................. 79 2.14.10 TransmissionLines(General) . ......... 80 2.14.10.1 ModelLevel ............................ 81 2.14.10.2 ElectricalCharacteristics . 81 2.14.10.3 InitialConditions . 82 2.14.10.4 TimestepandBreakpointControl . 82 2.14.10.5 HistoryList............................. 84 2.14.11 TransmissionLineModel . ....... 85 2.14.12 UniformRCLine ............................... 85 2.14.13 UniformDistributedRCModel . ....... 85 2.15 VoltageandCurrentSources . .......... 86 2.15.1 DeviceExpressions ............................ ..... 87 2.15.2 POLYExpressions .............................. 92 2.15.3 TranFunctions ................................ 93 2.15.3.1 Exponential............................. 95 2.15.3.2 GaussianRandom . .. 96 2.15.3.3 Interpolation ............................ 97 2.15.3.4 Pulse ................................ 98 2.15.3.5 PatternGeneration . 99 vi CONTENTS 2.15.3.6 GaussianPulse. .100 2.15.3.7 PiecewiseLinear . .102 2.15.3.8 Single-FrequencyFM . .104 2.15.3.9 AmplitudeModulation . .105 2.15.3.10 Sinusoidal..............................106 2.15.3.11 SinusoidalPulse . .107 2.15.3.12 TableReference . .107 2.15.4 DependentSources ............................. 108 2.15.4.1 Voltage-Controlled Current Sources . 108 2.15.4.2 Voltage-Controlled Voltage Sources . 109 2.15.4.3 Current-Controlled Current Sources . 110 2.15.4.4 Current-Controlled Voltage Sources . 111 2.16 SemiconductorDevices . .........112 2.16.1 JunctionDiodes............................... 112 2.16.2 DiodeModel................................... 113 2.16.3 BipolarJunctionTransistors(BJTs) . ..........115 2.16.4 BJTModels(bothNPNandPNP) . 115 2.16.5 Junction Field-Effect Transistors (JFETs) . ............117 2.16.6 JFETModels(bothNandPChannel) . 118 2.16.7 MESFETs ...................................... 119 2.16.8 MESFETModels(bothNandPChannel) . 120 2.16.9 MOSFETs...................................... 120 2.16.10 MOSFETModels(bothNandPchannel) . 121 2.16.10.1 MOSDefaultValues. .122 2.16.10.2 MOSModelBinning. .122 2.16.10.3 SPICE2/3LegacyModels . .123 2.16.10.4 ImportedMOSModels . .126 2.16.10.5 HSPICE MOS Level 49 Compatibility in WRspice .......128 2.17 SuperconductorDevices . ..........131 2.17.1 JosephsonJunctions . 131 2.17.2 JosephsonJunctionModel . 135 3 The WRspice User Interface 143 3.1 Starting WRspice ........................................143 3.2 EnvironmentVariables ............................ ........146 3.2.1 Unix/Linux .................................... 147 3.2.2 MicrosoftWindows .............................. 147 3.2.3 WRspice EnvironmentVariables . .147 3.3 SparseMatrixPackage ............................. .......151 CONTENTS vii 3.4 InitializationFiles ............................. ..........152 3.4.1 The tbsetup Command ..............................153 3.5 TheToolControlWindow ............................ 153 3.6 TextEntryWindows................................ 157 3.6.1 Single-LineTextEntry . 157 3.6.2 SelectionsandClipboards . 157 3.6.3 GTKTextInputKeyBindings . 158 3.7 TheFileManager .................................. 159 3.8 TheTextEditor ................................... 161 3.9 TheMailClient ................................... 163 3.10 TheToolsMenuToolsandPanels . .........164 3.10.1 TheFontsTool ................................. 164 3.10.2 TheFilesTool................................. 164 3.10.3 TheCircuitsTool .............................. 165 3.10.4 ThePlotsTool ................................. 165 3.10.5 PlotOptionsPanel ............................. 166 3.10.6 PlotColorsPanel .............................. 167 3.10.7 TheVectorsTool