ngspice 44.2 precompiled for 64-bit 24.04 Ubuntu & Ubuntu-based Linux. If you are interested in compiling from the source, instructions in Compiling and Installing Ngspice should help.
- http://ngspice.sourceforge.net
- NGSpice is a open source spice simulator for electric and electronic circuits.
- NGSpice Reference Manual: Complete reference manual in HTML format.
-
Change directory
cdto install directory <INSTALL_DIR> e.g./home/user/cad -
To download from the
gitrepository:git clone https://github.com/silicon-vlsi-org/eda-ngspice
-
Change directory to the installed ngspice directory eg.
cd eda-ngspice -
Checkout the desired version: eg.
git checkout v44.2.1- To make sure you are on the right version type
git branchand your output should have a line like this : * (HEAD detached at v44.2.1)- NOTE The revision history is maintained in VERSIONS.md
- To make sure you are on the right version type
-
Add the following environment variables in your
~/.bashrc($CAD_DIR must be set in .bashrc)
export SPICE_LIB_DIR=$CAD_DIR/eda-ngspice/glnxa64/share/ngspice
export SPICE_EXEC_DIR=$CAD_DIR/eda-ngspice/glnxa64/bin
export PATH=$PATH:$SPICE_EXEC_DIRNOTE The file bashrc-ngspice in this repo can be sourced in .bashrc
Use the apporpriate locations for CentOS-7
There is a initialization script in $SPICE_LIB_DIR/scripts/spinit. You can overwrite any of the initilization by adding commands to a local ~/.spiceinit .
IMPORTANT NOTE : In order to avoid ngspice ake a long time checking the model files each time you start the sim, put the following two lines in .spiceinit
set ngbehavior=hsa
set ng_nomodcheck
The Spice model files are located in the https://github.com/silicon-vlsi-org/eda-technology repository.
- To quickly get started, there are few simple spice examples in
<INSTALL_DIR>/eda-ngspice/examples/getStarted - There is suggested order in README based on difficulty that you can follow.
- You can copy the examples to a local directory and start
ngspicein that directory. - Source/run the spice netlist in the spice command prompt:
spice-1> source l1-res-div.sp - You can continue running spice commands in the spice command prompt ie.
ngspice-x > - To quit simply type
quit() - You can also run ngspice is in batch mode:
ngspice -b -r filename.raw -o filename.log input.sp
ngspice offers a variety of writing simulation results into a file. The simplest format to output a plot to a file is SVG.
- The following two lines can be added in the
.controlsection to output a plot in theSVGfomat:
.control
RUN
set hcopydevtype = svg
hardcopy plot_1.svg v(vout) title 'title' xlabel 'Vin(V)' ylabel 'Vout(V)'
.endc- The output file
plot_1.svgcan simply be opened in a web browser. - The location of the file can be found using a
File Explorerby navigating toLinux -> home -> ... - The location can be copied from the navigation bar and pasted in a web browser to view the plot in a web browser.
All technology files maintained in the https://github.com/silicon-vlsi-org/eda-technology
- NOTE The revision history is maintained in VERSIONS.md