WeSpice Analysis Manager
Lindentree Software
How To
- Run simulation - Press RUN. The netlist is created from the local schematic and the chosen "Include" file, and the simulator starts.
The progress bar only monitors transient simulations (the others are usually very short).
- Stop simulation - Press STOP. The simulation should stop in 1-2 seconds.
Partial results will be available for viewing with the Results Browser.
For a simulation that doesn't stop or other abnormal simulator behavior, there is a "Kill" function in the overflow menu.
- Check the generated netlist - Press SAVE and open Spice.sim with the Text Editor.
- Run a stand-alone netlist - Put the netlist in an empty circuit folder (no schematic), choose it as "Include" file, and RUN.
- Include more files - Put your ".include" statements in the file you define as "Include".
The simulator has the current working directory in the local folder, so local files need no path in ".include" statements.
Files in other folders can be accessed using relative paths (ex: "../othercircuit/somefile.cir").
- Use SPICE init file - The usual "spinit" or ".spiceinit" files are replaced by "spinit.txt" in the local folder.
Use with care - it can give unpredictable behavior for settings incompatible with the implementation.
- Set simulation options - Menu > Simulator Options. All well-known options are present (the .OPTION card).
There is also a RAMPTIME option which ramps independent sources (V,I) and initial conditions of C,IND code models, for transient simulations.
- Read about NGSPICE - Everything about NGSPICE, including manuals, is here.
See also the implementation details below.
- Tune performance
- Threads. Define the number of threads in the Settings menu.
Run a large simulation with BSIM transistors (at least one minute simulation time, ex: adder_bsim*.cir in /samples/simtests) on different settings.
Monitor CPU time in the output listing (will increase with number of threads) and elapsed time in the log window (will decrease with number of threads).
The best should be threads = number of cores. More threads will just use more CPU time (drain the battery) with no improvement in elapsed time.
The moving bar graph in the action bar (top-right) is monitoring the activity of the CPU cores in real time (total activity, not only from WeSpice).
- Bypass. Many circuits benefit from the bypass option.
It can be set from the general Settings menu or per circuit, in the Simulator Options.
- Accuracy. There are many parameters in the Simulator Options that will tune the tradeoff between accuracy and simulation time.
Usual targets are ABSTOL, RELTOL, VNTOL. These settings are very dependent on the circuit.
- Run simulation in background - This happens all the time. Once launched, you can continue playing with WeSpice or any app.
The simulation will continue when you exit WeSpice and even when you turn off the tablet screen.
WeSpice will keep a notification showing the progress and allowing you to jump back to WeSpice.
- Run parametric DC simulation - Enable the SWEEP line from the DC line and define the parameter - it can be (as the main variable) a voltage or current source, resistor, or temperature.
- Pick items from schematic - Press the search button next to the specific field.
Push into a sub-circuit by double-tapping it and return with Back button or WeSpice icon.
- Enable SOA checks - Set simulator option WARN=1 and define SOA parameters in the model (see NGSPICE manual).
Files
- The defined simulations, options and corners are saved in "Analysis.sys" when you press SAVE or RUN or you leave the module.
- The netlist "Spice.sim" is created from the local schematic and the chosen "Include" file is included at the end of it.
It is overwritten every time you press RUN or SAVE.
- The default "Include" file is "Spice.cmd".
- The simulator creates:
- Output listing "Spice.out". View the contents with INFO.
- Errors file "Spice.err". View the contents with INFO.
- Raw file with all simulation results "Spice.raw". This is a text file that is used by the Results Browser.
It can be "Accurate" - standard spice 15-digit precision, or "Compact" - 8-digit precision, half the size on disk.
For most uses "Compact" is more than enough.
- Some other log files.
Simulation Error Codes
- 0 - OK.
- 1 - Error detected by the simulator. Info should be available in Spice.err and/or Spice.out - just press INFO.
- 11 - Cannot change directory.
- 12 - Cannot open Spice.out.
- 13 - Cannot open Spice.err.
- 21 - Simulator crashed. This can happen for different reasons, including:
not enough memory, bad netlist not correctly interpreted by the simulator, other bugs.
- 22 - WeSpice internal error.
- 23 - Simulator killed.
- 24 - Simulator load failed.
- 31 - WeSpice internal error.
NGSPICE implementation
- The simulation engine in WeSpice is NGSPICE release 26, running in batch mode.
- The full analog simulator and the XSPICE option are implemented, with all the features and models.
- Analyses: OP, DC, AC, TRAN, DISTO, NOISE (with GUI), PZ, SENS, TF (netlist only).
- MOS models: MOS1-3, MOS6, MOS9, BSIM1, BSIM2, BSIM3 (all up to 3.3.0) BSIM4 (all up to 4.7.0), BSIMSOI (3.3 and 4.4), SOI3, HiSIM
- Not implemented (yet): TCLSPICE, CIDER.
- Multi-threading is implemented in the models: BSIM3 (3.3), BSIM4 (4.6.5 and 4.7), BSIMSOI4.
- Safe operating area (SOA) checks are available for resistors, capacitors, diodes, BJTs and BSIM MOS.