Download and install ngspice

Download ngspice from http://sourceforge.net/projects/ngspice/

Extract the zip file. The ngspice.exe program will be in the ngspice-26_140112/spice/bin/ folder.

It is a good idea to put a shortcut to ngspice.exe on your desktop or attach it to the taskbar.

NMOS circuit netlist (nmos.net)

* Schematics Netlist *

.include "../Models/MOSIS.txt"

VDrain1 _N_3 _N_4 0

.save i(vdrain1)

.param gnd_N_2=0

MN2 _N_4 _N_1 gnd_N_2 gnd_N_2 tsmc0p35nmos W=0.6u L=0.4u

VVSds _N_3 gnd_N_2 DC 2.5

VVSgs _N_1 gnd_N_2 DC 2.5

.dc VVSds 0 2.5 0.1 VVSgs 0 2.5 0.5

.end

Use Notepad++ to create netlist text file called nmos.net that contains the above.

The .include line in the netlist (e.g. mynetlist.net) reads in the MOSIS.txt file, which contains the pmos and nmos transistor models.

This .include line will only find the MOSIS.txt file if it is in a directory/folder named Models that is one level above the directory/folder (e.g. MyNelists) that contains your netlist.

Documents

CoolSpice

Models

MOSIS.txt

MyNetlists

mynetlist.net

.include "../Models/MOSIS.txt"

CoolSpice installion directories

ngspice does not like spaces

Make sure your directory/folder and file names do not have any spaces, since ngspice does not like spaces in a directory/folder or file name.

Run ngspice

  • Create a text file called nmos.net (see slide) in your MyNetlists directory
  • Run ngspice (i.e. ngspice.exe)
  • Read in (i.e. source) your netlist file by typing the following in the entry field at bottom

  • then type run <Enter>
  • then type set color0 = white <Enter>
  • then type set xbrushwidth = 5 <Enter>
  • then type plot i(vdrain1) <Enter>

Run ngspice

When you first run ngspice you should see

Run ngspice

Note: can't find init file.

******

** ngspice-28 : Circuit level simulation program

** The U. C. Berkeley CAD Group

** Copyright 1985-1994, Regents of the University of California.

** Please get your ngspice manual from http://ngspice.sourceforge.net/docs.html

** Please file your bug-reports at http://ngspice.sourceforge.net/bugrep.html

** Creation Date: Jun 1 2018 19:56:07

******

ngspice 1 -> source C:\Users\E151509\Documents\CoolSpice\MyNetlists\temp2.net

Circuit: * source c:\users\e151509\documents\coolspice\mynetlists\temp2.net

Warning: Model issue on line 78 :

.model ibm0p13nmos nmos ( level=49 version=3.1 tnom=27 tox=3.2e-9 xj=1e- ...

unrecognized parameter (saref) - ignored

unrecognized parameter (sbref) - ignored

unrecognized parameter (wlod) - ignored

unrecognized parameter (ku0) - ignored

unrecognized parameter (kvsat) - ignored

unrecognized parameter (kvth0) - ignored

unrecognized parameter (llodku0) - ignored

unrecognized parameter (stimod) - ignored

unrecognized parameter (wlodku0) - ignored

unrecognized parameter (llodvth) - ignored

unrecognized parameter (wlodvth) - ignored

unrecognized parameter (lku0) - ignored

unrecognized parameter (wku0) - ignored

unrecognized parameter (lodeta0) - ignored

unrecognized parameter (lkvth0) - ignored

unrecognized parameter (wkvth0) - ignored

unrecognized parameter (pkvth0) - ignored

unrecognized parameter (stk2) - ignored

unrecognized parameter (lodk2) - ignored

unrecognized parameter (steta0) - ignored

Doing analysis at TEMP = 27.000000 and TNOM = 27.000000

These Warnings, etc are OK

NMOS circuit netlist (nmos.net)

* Schematics Netlist *

* source C:/Users/E151509/Documents/CoolSpice/MyNetlists/nmos.net

.include "../Models/MOSIS.txt"

VDrain1 _N_3 _N_4 0

.save i(VDrain1)

.param gnd_N_2=0

MN2 _N_4 _N_1 gnd_N_2 gnd_N_2 tsmc0p35nmos W=0.6u L=0.4u

VVSds _N_3 gnd_N_2 DC 2.5

VVSgs _N_1 gnd_N_2 DC 2.5

.dc VVSds 0 2.5 0.1 VVSgs 0 2.5 0.5

.end

.control

run

set color0 = white

set xbrushwidth = 5

plot i(vdrain1)

.endc

put a control section directly into the netlist file to save yourself some typing.

put a comment with your source statemen

Installing and using ngspice - Google Slides