Simulation - FAQs

I am having problems using a specific PSpice created Model. How do I fix the model?

A specific PSPICE conversion to look for is how PSPICE denotes resistors, capacitors, and inductors in the .model line. PSPICE uses RES, CAP, and IND where Berkeley SPICE uses R, C, and L respectively. For instance, a resistor model in PSPICE will be something like

.model rmod RES ...

whereas Berkeley SPICE will look like

.model rmod R ...

Also, PSPICE's dependent sources can use a VALUE= syntax and then an equation for the voltage or current. SPICE doesn't have this syntax but the conversion for this is to replace the device with a non-linear source, depending on the original PSPICE device type. For instance:

PSPICE:

EFB 12 OUT VALUE={8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)}

SPICE:

BEFB 12 OUT V = 8.822-.4024*V(13,5)+5.250E-3*V(13,5)*V(13,5) -.6667*V(13,5)*V(6,5)

The "VALUE =" is replaced with a "V=" to denote a voltage source because the original device was an "E" voltage controlled voltage source and the "V =" means "voltage equals". If the original device were a current source F or G type device, the instead of "V=", you would use "I =" Also there are simply some model parameters that just have no SPICE equivalent and must be left out. We don't have a complete list of the non-SPICE syntax but our program will let you know if it doesn't recognize a parameter and then ignore it so really nothing has to be done. But it's worth keeping in mind that the effects of the omission are unknown and must be considered.

Some other differences that you will discover in using 3SPICE:

• You can not use expressions inside sources unless it is part of polynomials.
• You need to use the arbitrary source "A" rather than "B".
• The symbol for raising a variable to a power is "^" not "**".
• The Step function is "u" not "stp".
• The opening "{" cannot be followed by two opening "((" , you need to insert a space after the opening brace.

These are the most common problems when trying to convert PSPICE to Berkeley SPICE and there will probably be more specific problems that are not covered here. PSPICE to Berkeley SPICE conversion is as much art as science and there's no set way to convert all cases of PSPICE to Berkeley SPICE. If you have problems, you can always submit it to us for help.

My circuit is not simulating. What's the matter?

Unfortunately, there can be many reasons. You need to first review the check list of things that can go wrong found in the "Simulation Quick-Start Tutorials". It is important to remember that the simulator makes few if any assumptions. It is up to you to explicitly define and check every aspect of the circuit you plan to simulate. The most common mistakes are to forget to provide sources which provide the power and stimulation to the circuit under test. You need to make sure that every schematic symbol you have used is properly linked to an appropriate behavioral model. Many symbols may not contain that needed information. Check the use of reference designators.

Remember the simulation environment is much like a work bench where you would proto-type a circuit. You have to add power, add a stimulus source, and use an oscilloscope to monitor what's going on. The simulation tools are no different.

Lastly, check these things as well....

1. Devices which use sub-circuits or models must start with a "X" for a Reference designator.
2. The project file in its preference needs an "IncludeFile1" specification in the project attributes so that we know what files (i.e., models in this case) are to be included.
3. Also you you need to be sure that models used conform to standard Berkeley SPICE conventions.

Is there a summary of what items go where for simulation purposes?

Chapter 4 in "Simulation Quick-Start Tutorials" has a graphic which shows where things should go. Please be sure to do all the exercises in the QuickStart Guide first. Avoid skipping things because you may miss some important information.

Can I drop Sources automatically from sub-circuits when these sub-circuits are used in other designs?

YES. There is a Flag in the the Voltage and Current sources "NoSubCkt" which when set to "1" will cause them not to be included in subcircuit extractions. This allows the subcircuits to be tested separately and letting them be included without having the remove the sources after the subcircuit is tested.

It seems like I am only able to include four library files in a project. Is this some kind of artificial limit? Can I increase it?

If you open the 3Spice Heirarchical.sxp script you will see that this extraction script is coded for up to 4 include files. This is where the limit comes from. You can modify this script to meet your needs. Be sure to read the manual section about Scripts.

A better solution would be to just include a file which contains all the include statements that you need. This way you won't need to modify the report script.

Why do most source voltage or current settings use 1?

This is not mandatory, its just convenient. Many of the plots that you will be creating are a comparison of say the input versus the output. If the input is already set to one(1) then you actually only have specify the output signal for plotting rather than adding a mathematical expression. You will get the same result because dividing by one (1) does not alter what is being divided. You also get your results faster.

I have files from Motorola with .lib .sp2 .sp3 extensions. What do these mean?

.lib and .mod are standard Berkeley model file extensions. The .sp2 and .sp3 may be model libraries as well but you would have to see the contents of these documents. Typically they may simply be a segregation of models targeted for either SPICE version 3 or 2. Under normal circumstances version 2 will work with 3 but not vice versa.