Working with the Parts Database & Device Manager

From Emagtech Wiki
Jump to: navigation, search
Rfspice banner.png

Back icon.png Back to RF.Spice A/D Wiki Gateway

Tutorial icon.png RF.Spice A/D Tutorial Gateway

An Overview of RF.Spice A/D Parts & Devices

Your RF.Spice A/D circuit is made up of one or more parts that are connected to one another using wires. Resistors, capacitors, transistors, voltage and current sources, etc. are all RF.Spice A/D parts. A part consists of a simulation model and a symbol. The simulation model determines the circuit behavior of the part. Simulation models usually have the standard SPICE "Netlist" format. The part's symbol, on the other hand, is used to include it into your circuit's schematic. The part's symbol may have one or more pins. These pins are mapped onto the terminals or nodes of the part's simulation model. A part's pins are also used to connect it to the other parts in your schematic.

RF.Spice A/D comes with a very large "Parts Database" containing thousands of passive, active and virtual devices. Some of these parts are generic SPICE or XPICE parts such as the Resistor (R), the Capacitor (C) or the Generic NPN-Type Bipolar Junction Transistor (Q). Many of the database's parts are actual devices from particular semiconductor device manufacturers, such as the switching diode BA582 or the NPN-Type BJT, BFR193, both manufactured by Siemens.

The new RF.Spice A/D has adopted a terminology that differentiates between the terms "Part" and "Device". In this terminology, a "Part" is an instance of a "Device" that you insert in your circuit. Devices are stored in RF.Spice's Parts Database. They have certain simulation models and symbols with a set of parameters, which may have default values. Devices are saved in the database and remain unchanged unless you alter them using RF.Spice A/D's Device Editor. When you place a new part like a resistor R1 in your schematic, RF.Spice A/D indeed pulls the device type from the database and creates an instance of it with a default name and default parameter value(s). In this case, you have resistor R1 with a default value of 1K. You can change the name of your resistor or change its value to anything else. Now if you place a second resistor in your schematic, it will appear with the default name R2 and a default value of 1K. Your two resistors have the same device type, but they are two instances of the "Resistor" device given two different names and possibly two different values. You can change the names and values of your parts at any time and save them with your circuit project.

RF.Spice A/D Device Editor.

Three Types of Device Models

RF.Spice A/D features three different types of simulation models:

  • Process (Technology) Models
  • Subcircuit Simulation Models
  • S-Parameter Models

Many of RF.Spice's generic devices have process models, also known as technology models. These are standard SPICE or XSPICE models that have been hard-coded into RF.Spice A/D. A process models has a fixed preset number of parameters. Some examples are Resistor, Capacitor, Inductor, Diode, BJT, JFET, MOSFET, MESFET, Voltage- or Current-Controlled Switch, to name a few. When you open the property dialog of a part with a process model, you usually see a list of the device parameters with their default values as well as edit fields for changing their values.

Subcircuit simulation models are usually in the form of a standard Netlist code starting with the ".SUBCKT" command and ending with the ".ENDS" command. The Netlist subcircuit determines the number of the device's terminals or pins. Some simulation models may not have editable parameters. Their simulation model simply executes the given Netlist code during a simulation. On the other hand, RF.Spice A/D offers "Parameterized Subcircuit Models". These models can have an arbitrary number of parameters, which appear in the device's property dialog very similar to the process models. You can change the values of these parameters at any time and save their values with your circuit project.

The third model type is in the form of a table of scattering (S) parameters, and is typically used for high frequency devices such as RF diodes and transistors.

Working with the Device Manager

RF.Spice's Device Manager is a separate, independent application that is installed on your computer at the time of installation of RF.Spice A/D. You can use the Device Editor for the following purposes:

  • Changing the name, simulation model, symbol, default parameter values, or other editable attributes of an existing database device
  • Creating a new device, a new simulation model or a new symbol
  • Importing simulation models from text files
  • Deleting a device
  • Emptying the current database or merging an external database with it
  • Creating a database patch file from existing devices and applying a patch to the current database

To open the Device Editor, go to the File Menu of Schematic Editor and select "Open Device Editor...", or simply use the keyboard shortcut "Ctrl+D".

Attention icon.png RF.Spice's parts database file is called "parts.mdb" and is located in the "Documents > b2spice" folder on your C Hard Drive. A copy of your original parts database is also supplied in the RF.Spice A/D installation directory for future references. Sometimes, when trying to open up the Device Editor, you may get a message asking you to locate the parts database. Please make sure you set the correct path in the "Documents" folder.
Edit Device Dialog.

Device Editor has a simple user interface with a menu at the top of the screen and a side panel with the following items:

  • Devices
  • Process Models
  • Simulation Models
  • Symbols
  • Packages
  • Categories
  • Manufacturers

The side panel acts as a quick access menu. Double-clicking on each of the above items opens a "Select" dialog that allows you to choose a device, model, symbol, etc. to edit. On the left side of the "Select" dialog there is a list of all the available choices. You can scroll the list and select an item in it. Or you can use the filters in the dialog and search for a particular item, e.g. based on a keyword or partial name. Once you select an item from the list, a device, a model or a symbol, you can edit it or delete it. You can edit the contents of the models as well as symbols.

You can use the Device Editor to delete devices, process and simulation models as well as symbols. You can do this from the Edit > Delete Menu, too. If you delete a device, the Device Editor will assume that you wish to delete every component of that device, including its symbol and process/simulation model. But the program will ask for a confirmation before deleting each component so that you can keep a symbol if you don't wish to delete it. Also, if the component is being used by another device, then you will receive an error message if you try to delete that component.

You should make a copy of the database before modifying it just in case you mess up some devices. Also, you could use an empty database as your database for custom parts. In both the workshop and Device Editor, it's easy to set the database back and forth among several different databases as you use the program.

Editing Models in the Device Manager

You can edit the contents and various aspects of both process models and subcircuit simulation models. This can be done either from the side panel's quick access menu by opening the "Select Model" dialog, or from the Edit Menu of the Device Editor by selecting "Edit Process Model..." or "Edit Simulation Model...". Browse the model list in either case, select the desired model to be edited and click the "Edit..." button of the dialog. This opens the "Edit Model" dialog. This dialog typically has two tabs. The first "General" tab contains the general attributed of the model including it name, type, category, description, etc. The second tab typically contains a list of the model's parameters including their default values. In case the model does not involve any parameters, the second tab is labeled "Simulation Guts". In that case, the tab contains the text of the Netlist subcircuit code. This is displayed in a text editor, where you can change the contents of the code as you wish. A Netlist subcircuit code has the following format:


.subckt subcircui_name < list of pins (terminal nodes) >

...

SPICE commands

...

.ends


If your model has one or more parameters, you can select each parameter individually by clicking the appropriate row in the table. Then you can type a new value in the value field. For logical parameters, you have to choose between True and False values from a drop-down list. If you don't want to specify the field, leave it blank or type in "x", or uncheck the checkbox labeled "Given". If you enter a value in the box, accepting it will automatically make it given. When you are done specifying a parameter, click the "Accept" button to store it and go to the next parameter.

Process models are based on the internal and standard models of SPICE or XSPICE. They are typically defined as a text line with the following format:


.model model_name model_type < list of parameters and values >


The general tab of a process model's Edit Dialog contains a button labeled "Edit As Text...". Click this button to open a text editor where you can edit the model's text and modify it parameter values.

Edit Model Dialog.

Modifying and Saving Devices from Schematic Editor

Instead of opening the Device Editor and changing devices through it, RF.Spice A/D provides another convenient way of altering devices right from the Workshop. Select a part in your circuit using the Select (arrow) tool. Right-click to open the contextual menu or go to the Edit Menu of the Schematic Editor and select "Edit Device..." to open the device's property dialog. This is identical to the device property dialog that you would open if you selected the same device type from the Device Editor. From this property dialog, you can change the device's simulation model by clicking the "Edit Model..." button or you can modify its symbol in RF.Spice's integrated Symbol Editor, if you click the "Edit Symbol..." button. Once you complete your edits and changes, you can close the device property dialog and return to your schematic. If you save your circuit projects, all the changes you made to the device, whether to its model or symbol or both, will be saved with your circuit. The next time you open the same circuit project, you will notice your changes, although they were saved locally in the project file and not globally in the database.

However, in the right-click contextual menu of the modified part you are presented with three options:

  • Store Device to Database
  • Store Simulation Model to Database
  • Store Symbol to Database

If you choose one of the above three options, your changes to the device model and/or its symbol will be committed and saved to RF.Spice's Part Database permanently.

Scope of Database Changes

Any changes you make to the Parts Database using the Device Editor are not retroactive. This means that any part already in a previously created circuit will not be affected by any changes you might have made to the same device in the database. This also applies to the device's simulation model, process model, symbol, etc. If you want your changes to apply to a part previously in a circuit, you will have to delete and replace that part in the circuit.

Adding a New Category

If the category you want is not on the list you will need to run the Database Editor and open the Edit List of categories dialog box. Double click on the Categories quick access item. You can also open the Edit List box by choosing New Category from the File Menu or Edit Category from the Edit Menu.

To add a new category, click on the Add... button and the Category Entry dialog box will appear. Type in the name of your new category and then click either the Analog or Digital sub-category and they will appear in the Parent box. Click OK to accept the addition.

Adding a Manufacturer

If the name of the manufacturer is not on the list you will need to add it. To add a new manufacturer go to the Edit menu of the Database Editor and select Edit Manufacturer or double click on the Manufacturer quick access. This will open the Edit List of manufacturers. Click Add and typ be in the new manufacturer.

Repairing the Parts Database and Creating & Merging Database Patches

There are times when you may inadvertently damage your parts database. The RF.Spice A/D installation folder contains a copy of the original parts database. You can always recover the original database by copying this ".MDB" file from the installation folder to the "Documents > b2spice" folder and changing its name to the default database file "parts.MDB". Every time you install a new version of RF.Spice A/D, it will also install the newest version of the parts database. This is necessary because lots of new parts are constantly added to RF.Spice's standard parts database with every new release.

In the meantime, you may also have added your own devices, models and symbols to the parts database. When you install a new release or try to recover the original parts database, you also want to keep your own device entries to the database. You can do this in two different ways: by merging databases or by creating database patches. In the first method, you can make a copy of your current database and rename it to something different than "parts.mdb". After you install the new release with the new updated parts database, you can merge the new current database with your previously saved database. To do so, go to the Special Menu of the Device Editor and select "Merge External Database into Current Database...". This opens up the standard Windows Open Dialog, with the file extension set to ".MDB". Browse your folders to find the your previously save old database file and click the Open button to complete the merge process.

Attention icon.png Merging databases may take a considerable amount of time depending on the their size.
Creating a database patch in RF.Spice A/D Device Editor.

The second method of recovering old devices involves creating database patches. A database patch is a collection of devices, models and symbols that are stored together in a database file. If you keep track of the devices that you create and add to the parts database over time, then you can bring them together and save them as a database patch. Every time you install a new database, then you can merge the database patches into "parts.MDB". In this way, you can preserve your own devices. To create a database patch, go to the Special Menu of the Device Editor and select "Create Database Patch File...". A large dialog opens up, which allows you to select devices, models and symbols from the current parts database. Click on each Add button and the respective Select Dialog opens up. Browse the list and choose and add as many items as you like. Once your lists are complete, click the OK button. This opens up the standard Windows Save Dialog, with the file extension set to ".PAT". Choose a name for your new database patch and save it. To merge an existing database patch file to the current parts database, go to the Special Menu of the Device Editor and select "Apply Patch to Database...". The standard Windows Open Dialog opens up, with the file extension set to ".PAT". Browse your folders to find the desired database patch file and click the Open button to complete the merge process.

 

Tutorial icon.png RF.Spice A/D Tutorial Gateway

Back icon.png Back to RF.Spice A/D Wiki Gateway