Skip to content

silicon-vlsi-org/eda-ngspice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NGSPICE

Current distribution version 44.2.1

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.

Downloading & Setting Up Ngspice

  • Change directory cd to install directory <INSTALL_DIR> e.g. /home/user/cad

  • To download from the git repository:

    • 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 branch and your output should have a line like this :
    • * (HEAD detached at v44.2.1)
    • NOTE The revision history is maintained in VERSIONS.md
  • 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_DIR

NOTE 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 .

The Spice model files are located in the https://github.com/silicon-vlsi-org/eda-technology repository.

Quick Start Guide

  • 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 ngspice in 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

Helpful Tips

Output plot to a file

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 .control section to output a plot in the SVG fomat:
.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.svg can simply be opened in a web browser.
  • The location of the file can be found using a File Explorer by navigating to Linux -> home -> ...
  • The location can be copied from the navigation bar and pasted in a web browser to view the plot in a web browser.

Technology

All technology files maintained in the https://github.com/silicon-vlsi-org/eda-technology

Release History

  • NOTE The revision history is maintained in VERSIONS.md

About

NGspice compiled binaries

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •