Instructions for using Spice (Spice3)

Before starting, run the "typescript" command. This way you will have a log of your work. Make any changes in another window, and comment what you are doing with the "echo" command.

  1. start magic. Load the circuit to check, and make any changes (e.g. from the returned homework). Be sure your inputs and outputs are labelled. Do not use "input" as an input name. Also label "Vdd!" and "GND!".

  2. type ":extract" and quit magic. This step creates a file with a ".ext" extension, such as "inverter.ext". See the note below if you have problems.*

  3. type "ext2spice -f spice3 filename"
    (e.g. replace filename with "inverter"). This step takes the .ext file and makes it a .spice file. All of these files are text files, so you can examine them if you like (using "vi" or "more" or "cat").

  4. Use the following .cir file

    Change the file to include your spice file (about line 4) as needed.

    You do not need to understand everything about this file. Most of it instructs the simulation software how to deal with the n-type and p-type transistors.

    Any line that begins with an asterisk "*" is a comment.

    Change the last few lines to correspond to the inputs. Every input should have a line specifying what it is. You can use 0 or 5 volts DC (like in the GND / Vdd lines), but a PULSE lets you see more possibilities. You may also need to alter the "Vin" line to reflect the label you used.

  5. run the command "spice3"
    The main commands to know are below. Typically, you would type these in the order given.
    • source filename.cir
      This loads your file.
    • run
      To run the simulation.
    • plot signal1 signal2 ...
      This plots the signals you want (typically inputs and output).

Troubleshooting

If you have problems, here are some things to check.


See the following link for an example of running Spice3.

* Note: I've seen some strange things happen when the materials used are incorrect. Specifically, magic does not handle using pwc and nwc in place of pdc and ndc, respectively. The "extract" command generated a warning, but the warning was not specified. Also, the p-mos transistor turned black! If you see strange behavior like this when you try to "extract" your design, double-check the materials used.

For More Information:

  1. http://carmaux.cs.gsu.edu/~mweeks/csc4250
  2. http://tuttle.merc.iastate.edu/ee333/spice/pspicetutorial/basics/pspicebasics.htm
  3. http://www.ee.siue.edu/faculty/adgrego/classes/ece326/PSPICEtutorial.pdf
  4. http://www.ece.arizona.edu/~ece507/
  5. http://people.msoe.edu/~meier/tutorials/spicehow-to.html