Spice Helper Page

Outline of Page


Examples

Click on these to read them.

Can I get spice for my computer?

  1. If you run Windows, you can use Pspice. (any others people like?) I think that there is a student version available at their web site
  2. If you run Linux (I have redhat-7.1), here is an rpm package of a reasonable version (right-click to download):
    http://www.engr.trinity.edu/~knickels/src/spice-3f4-4.i386.rpm
  3. For MacOS X, there is a port of ng-spice in MacPorts (or DarwinPorts). This is actually the version that we run on the engineering servers now. For more information, see http://ngspice.sourceforge.net

How to run spice - Linux Workstations

  1. Log into one of the Linux workstations in the core room.
  2. Open up a terminal window (on this host) by either right-clicking on the background and choosing "Open Terminal" or by selecting Applications, then Accessories, then Terminal from the Menu Bar
  3. Make a new directory for networks by one of the following methods:
    1. typing
      mkdir networks
      in the terminal window, then change into it by typing
      cd networks
      in the terminal window.
    2. Calling up the file manager by clicking on the "User's Folder" icon then choose File/ Create Folder from the menu, as shown below

      Type in "networks" then double-click this folder in the file manager.
  4. Create a new file by right-clicking in the "networks" window, and choosing Create Document, then Empty Files. Rename it to "vdiv" (by clicking once on the file name, and open a text editor (gedit) by double-clicking on this file.
  5. Type in the text input file for spice. Don't forget the title line at the top. Our example (voltage divider) input is:
    # Voltage Divider
    v1 2 0 10
    r1 2 1 4.7k
    r2 1 0 3.3k
  6. Save the text file from the text editor in the networks directory. j
  7. In the terminal window, type cd networks. In the terminal window, type spice3. It should print this in the terminal window:
    > spice3
    Program: Spice, version: 3f5
    Date built: Mon Oct 16 14:13:49 CDT 1995

    Type "help" for more information, "quit" to leave.

    Spice 1 ->
  8. Now you are ready to give spice commands. Tell it to read in the text file:
    Spice 1 -> source vdiv

    Circuit: # Voltage Divider


  9. Now tell spice to do an Operating Point analysis.
    Spice 2 -> op
    Spice 3 ->

  10. Now print the results to the screen.
    Spice 3 -> print all
    v(1) = 4.125000e+00
    v(2) = 1.000000e+01
    v1#branch = -1.25000e-03
    Spice 4 ->


How to run spice - SUN Workstations

  1. Log into one of the Sun workstations in the core room.
  2. Once everything is started up, you'll see a button bar on the bottom of the screen:

  3. Open up a terminal window (on this host) by clicking on the symbol
  4. Make a new directory for networks by one of the following methods:
    1. typing
      mkdir networks
      in the terminal window, then change into it by typing
      cd networks
      in the terminal window.
    2. Calling up the file manager by clicking on the "Home Folder" icon then choose File/New Folder from the menu, as shown below

      Type in "networks" then click this folder in the file manager.
  5. Open up a text editor by clicking on the "Text Note" symbol on the button bar or on the Applications menu shown below.
  6. Type in the text input file for spice. Don't forget the title line at the top.
  7. Save the text file from the text editor in the networks directory.
  8. In the terminal window, type cd networks. In the terminal window, type spice3. It should print this in the terminal window:
    > spice3
    Program: Spice, version: 3f5
    Date built: Mon Oct 16 14:13:49 CDT 1995

    Type "help" for more information, "quit" to leave.

    Spice 1 ->
  9. Now you are ready to give spice commands. Tell it to read in the text file:
    Spice 1 -> source vdiv

    Circuit: # Voltage Divider


  10. Now tell spice to do an Operating Point analysis.
    Spice 2 -> op
    Spice 3 ->

  11. Now print the results to the screen.
    Spice 3 -> print all
    v(1) = 4.125000e+00
    v(2) = 1.000000e+01
    v1#branch = -1.25000e-03
    Spice 4 ->


How to run spice on a workstation while you sit in front of another computer (remote access)

  1. Telnet into one of the Sun workstations in the core room.
    On WinNT, for example, you can go to the Start Bar, go to Run, then type "telnet newton.engr.trinity.edu", and you'll get a telnet window. On Linux, just type the same thing in a terminal window.
  2. Edit the spice input file using your favorite editor. Be sure to save it as text. Move it to the workstations somehow. (Rex is now available in Network Neighborhood/ENGR, that ought to simplify this. Full directions available at http://www.engr.trinity.edu/~paul/sun/samba.html). For non-Windows users or off-campus users, use ftp to joule.engr.trinity.edu.
  3. Make a new directory for networks by typing
    mkdir networks
    in the terminal window, then change into it by typing
    cd networks
  4. In the telnet window, type "spice3". (Without the quotes). It should print this in the terminal window:
    > spice3
    Program: Spice, version: 3f5
    Date built: Mon Oct 16 14:13:49 CDT 1995

    Type "help" for more information, "quit" to leave.

    Spice 1 ->
  5. Now you are ready to give spice commands. Tell it to read in the text file:
    Spice 1 -> source vdiv

    Circuit: # Voltage Divider


  6. Now tell spice to do an Operating Point analysis.
    Spice 2 -> op
    Spice 3 ->

  7. Now print the results to the screen.
    Spice 3 -> print all
    v(1) = 4.125000e+00
    v(2) = 1.000000e+01
    v1#branch = -1.25000e-03
    Spice 4 ->


How to save output from spice

Method 1: using cut and paste

  1. Open a blank document in the text editor (text note).
  2. Use the first mouse button to highlight the text you want in the terminal window. It'll look something like this:
    ,
  3. Choose Edit/Copy from the menu. Click on the text editor and choose Edit/Paste to paste the text. Now save or print the file.

Method 2: using a script file

  1. In a terminal window, type
    script
    Script started, file is typescript

  2. Now, everything you type or anything the computer (or spice) prints out goes into the file "typescript". Follow the directions above to run spice in the same terminal window.
  3. After you exit spice, type exit once more to exit the "script" program. It'll remind you once more where the script is:
    exit
    Script done, file is typescript

  4. Now you can edit the file "typescript" in the text editor, or print it out, or whatever!

Comments are welcome! Feel free to e-mail direct to the maintainer of this page:
Kevin Nickels, <knickels@engr.trinity.edu>