Knowledge Base - Installing Models

Versions 4.0 to 5.2 (see Installing models (5.3) for version 5.3)
Products All
Platforms Windows, Linux
Released 19 March 2005

 

 

"Thanks for the lightning fast reply and thank you very much for creating the best spice product on the market"

Contents

Overview

What is a Model File

Obtaining Model Files

Installing the Model in SIMetrix

Providing a Schematic Symbol for a Model

Associating Models and Symbols

Troubleshooting and Common Problems

 

Overview

SIMetrix is able to import simulation models from many sources. In particular, most device manufacturers provide SPICE models for their components and the vast majority of these are compatible with SIMetrix.

This article describes the procedure required to install models and also some of the problems that are commonly experienced with models. The article assumes you are using the Windows version of SIMetrix. The basic procedures are the same for Linux, but of course you will need to make appropriate substitutions when we refer to Windows programs such as Internet Explorer and notepad and also for file and directory naming.

Note that this article does not cover the installation of models from process foundries used for integrated circuit design. For this, see Using Models from Process Foundries

What is a Model File

Simulation models consist of a number of lines of text providing a definition of the electrical characteristics of the device. The lines will reside in a file which may also contain other models. Often however, the file will contain just one device model. Typically the files have the extension .CIR, .MOD, .SPI or .LIB, but this is by no means always the case. Note that SIMetrix doesn't care what the file extension is.

Model files will always have either lines beginning .SUBCKT or lines beginning .MODEL and quite commonly you will see both. If there are no lines that start with either of these two words, then the file is not a SPICE model file and will not be useable by SIMetrix.

Obtaining Model Files

The exact procedure for obtaining the model file varies from one manufacturer to another. Commonly, manufacturers provide a link to a SPICE model on their data sheet page.

Unfortunately, its difficult to give detailed instructions on exactly what you do with this link as this varies between sites - and sometimes between different pages on the same site. But the following are, we hope, useful guidelines.

On most sites, you should not click on the link directly, but instead "Save Target As..." (right click pop up menu in Internet Explorer) and select a suitable location to save to on your hard disk. A default file name will usually appear and if this has the extension .MOD, .CIR, .SPI or .LIB, then you can be reasonably confident that you are saving a correctly formatted model. (These aren't the only file extensions used - they are just the most common. )

If the file has the extension .HTML or .HTM then you shouldn't save it, but cancel and then click on the link in the normal way. You will then be directed to a new web page which may have more links on it. In the case of Analog Devices, for example, you will be presented with a legal agreement that you have to agree to first. When you press the "I agree" button, the browser is then directed to display the text of the model. In this case you should now save the page that is displayed. But, and this is important, you must save the page as plain text. The default with Internet Explorer is to save as an HTML file and this will not work as a model. To save as plain text in IE, select "Text file (*.txt)" in the "Save as type" drop down box. You will get a file with the extension .TXT, but that's OK, SIMetrix will handle it. (But you may prefer to change it to some more suitable extension.)

The end result that you want is a text file that contains lines starting with things like ".SUBCKT", ".MODEL" and ".ENDS". It should definately NOT contain lines containing <HTML>, <HEAD>, <META .... >. The latter are HTML tags and if your file has these in it then it means that it has been saved as web page. You should instead save it as text file - see above.

Installing the Model in SIMetrix

With SIMetrix, all you need to do to install a model is pick up the model file or model files or directory containing model files and drop them in the SIMetrix command shell. That is all you need to do to install the electrical model itself. It may not be all you need to do to use the model in the schematic editor, but we will cover that issue later.

Here is the drag and drop procedure in detail:

  1. Start SIMetrix if you haven't already. Make sure the command shell window is clearly visible.
  2. Open a windows explorer window then navigate to the folder where you saved the SPICE model file. Below we show a folder that contains just a single file. In this case its a model for an Analog Devices opamp:

  3. Pick up the file by selecting it then pressing the left mouse button. Keep the left button pressed then move the mouse so that the icon image of the file is placed over the message window of the SIMetrix command shell. See diagram below:

  4. You will now see a message asking you to confirm that you would like to install the file. Select OK.

That is all that is needed to install the electrical model.

But, the process doesn't necessarily end there. If you want to use the model with the schematic editor, you will also need a symbol to use with the model. So far we have installed an electrical definition of the device, but we have not provided any information on how it should be represented on a schematic.

In many cases you don't need to provide this information. SIMetrix does its best to figure this out for itself and if successful, you will find the new model listed in the parts browser. To find out, read the next section.

Providing a Schematic Symbol for a Model

As explained above, we need a schematic symbol for the device as well as its electrical model. We don't usually need to create a new symbol, but instead we link an existing symbol with the model. This linking process is known as "association".

Sometimes, SIMetrix is able to perform the association process automatically and you don't need to do anything. To find out if the association is already done, follow these steps after you have installed the model as described in the above section.

  1. Open a schematic sheet
  2. Select menu Place | From Model Library...
  3. In the filter box at the bottom, type the part number of the device you are interested in. For our example shown above the part number is OP1177. Note that the part number is the number inside the model file and is unrelated to its file name. You can use wildcard characters '*' and '?' if you are not sure of the complete part number. (e.g. OP11*)
  4. Select the *** Unknown *** category. If the part you installed is listed here then it means that SIMetrix has not been able to associate the part on its own and we must now do this. If that is the case, proceed to Associating Models and Symbols below. If its is not listed, then proceed to step 5
  5. Select the * All Devices * category. If the part is listed here (and wasn't listed in *** Unknown *** in step 4), then the new part is already associated. If you select the part and press OK you can place the part on the schematic. You don't need to do anymore work, your new part is fully installed.

    If the part is not listed here then it means that the installation of the model failed. There are a number of possible causes. Click here for assistance.

If you install the model used as an example above - the OP1177 - in SIMetrix 4.5 or later, you would find that SIMetrix was able to associate the part for you without you needing to any further work.

Associating Models and Symbols

The process of association tells SIMetrix what symbol to use with a particular model. To explain the process we will use the model file supplied with SIMetrix as part of Tutorial 3. You will find this in the Examples folder at Tutorials\tutorial3.mod. The following assumes the model is already installed using the procedure descibed in Installing the Model in SIMetrix.

  1. Select the command shell menu File | Model Library | Associate Models and Symbols.... You will see this box:

  2. Now select the part you wish to associate. In the above example this is our SXOA1000 device. This is what you should now see:


    Note that the text of the model definition appears in the "Electrical Model" window at the bottom of the box.
  3. First we must choose an appropriate category for the part. This controls in which category the part will be listed in the parts browser. (Menu Place | From Model Library... ). To select the category, use the drop down box at the top right, the one that shows "* Not cataloged *" in the above picture. We will select "Op-amps" for our SXOA1000 device.
  4. Now select an appropriate symbol. SIMetrix will display the names of symbols that have the correct number of pins for the part that is selected. The SXOA1000 model has 5 connections: 'Non-inv input', 'Inverting input', 'Output', 'Positive supply' and 'Negative supply'. So as this part has 5 connections, only symbols with 5 pins will be displayed.

    This is what you will see if the 'Operational Amplifier - 5 terminal' symbol is selected:

  5. We must now check the pin order. The box labelled "Pin order" shows the names of the symbol's pins. The order of these pins must match the order of the equivalent connections in the electrical model. Usually, the electrical model contains comment lines that describe each connection and the above example is typical. The first connection is called 'VINP' and is the 'Non-inv input'. The second is 'VINN' and is the 'Inverting input' and so on. These correspond to the symbol pins 'inp' and 'inn' respectively.

    However, in the example, the remaining three connections do not match the symbol's pins. The connection 'VOUT' should map to the pin 'out', but as it stands it maps to 'vsp' (positive supply). So we need to change the pin order. To do this, select the pin you wish to change then use the up and down arrow buttons on the right to move it. We only need to move the 'out' pin in the above example so that the order reads 'inp', 'inn', 'out', 'vsp', 'vsn'.
  6. Press "Apply Changes" then "OK" to close the box. The association is now complete.

Troubleshooting and Common Problems

Model seemed to install OK, but cannot find part listed

  1. Check that you are looking for the right part. The part name listed will be the name given in the model definition, not its file name. To find this out, you will need to open the model file in a text editor such as notepad. The part's name is the name immediately after its ".SUBCKT" or ".MODEL" line.
  2. Check the file you installed is a valid SPICE model. Open the file in a text editor and look for lines beginning .SUBCKT or .MODEL. If no such lines exist then the file is not a valid model file. Also every .SUBCKT line must have a matching .ENDS line. There exist models in the public domain where the .ENDS line has either been missed completely or instead a .END line is used. Neither is valid.

    .SUBCKT and .MODEL must start the line. If other words or character sequences preceed it then the line will be ignored. This happens if the file is saved as HTML - you will see things like <HTML> and <HEAD> at the start of the line.
  3. Check that the file uses ASCII coding and not UNICODE or other. To check, open the file in notepad, then select File | Save As... . If the Encoding box says anything other than "ANSI", then select ANSI and save. Then select SIMetrix menu File | Model Library | Re-build Catalog - this will tell SIMetrix to rescan the file.
  4. The model name clashes with an existing model. If there are duplicate model names, only the first one found in the search will be available. To find if there is a duplicate, select Place | From Model Library... then select the * All Devices * category. Type the expected model name in the Filter box and press Apply. If the device is listed, select it. You should see the file location of the model displayed at the bottom of the window. If this isn't the device you installed, then you should rename your model. Note that you must rename the name within the file, not the file itself. To do this, open the file in a text editor and change the name immediately after the .SUBCKT or .MODEL keyword. We suggest you append some suitable suffix e.g. a '-' followed by your initials or maybe an acronym of the manufacturer's name. When you have renamed the model, select menu File | Model Library | Re-build Catalog.

Successfully installed and associated model, but it doesn't work

  1. Check the pin order. You can do this with the associate models dialog box. Open the box (File | Model Library | Associate Models and Symbols...) then under Select Devices select the category which you gave the part. (Op-amps in our example). Locate the part in the list below.

    Now carefully check the pin order against the electrical model. You might like to open the symbol in the symbol editor so that you can see which pin is which.
  2. The symbol you are using does not have a REF property. If you created a new symbol for the model, you should use the symbol editor's Property/Pin | Add Standard Properties... menu to add the standard properties needed for simulation symbols.
  3. Did you place the device using the Place | From Model Library... menu? If you used the alternative Place | From Symbol Library... to place, for example, a new symbol that you created, it might not work as it may not have the correct properties assigned. Place | From Model Library... automatically adds the necessary properties (except REF - see 2. above)

Cannot find a suitable symbol for association

  1. The associate models dialog box will only list symbols with the correct number of pins. So if the model is a 5 terminal opamp, then only symbols with 5 pins will be listed. But there are a very small number of erroneous models in existence that have additional text at the end of the .SUBCKT line that SIMetrix thinks are additional connections.  Here is an example taken from a real model:

    .SUBCKT LF347 1 3 2 4 5 (analog)

    The "(analog)" on the end of this line should not be there. The designers probably meant it as a comment, but nearly all SPICE based simulators including SIMetrix will treat it as an additional connection. The best solution here is to edit the model and remove the extra text.

When I dropped the file into the command shell I got the message 'Unknown file type'

  1. This can happen if the file in in Apple MAC format. UNIX, DOS/Windows and Apple MAC all use a different sequence of characters to represent a new line. SIMetrix is compatible with DOS/Windows and UNIX formats but not Apple MAC.

    Otherwise the message means that the file is not a recognised SPICE model file. Note that this is not related to the file extension. SIMetrix opens the file and has a look inside to determine if it is a model file. It doesn't care what the file extension is.
  2. To convert a MAC file to DOS/Windows, download this utility - u2d.exe - and run from a command prompt:

    u2d filename

    Replace filename with your model file.