You are on page 1of 17

CADSTAR Integration Tutorial In this tutorial, you will learn the how to fully utilize the capabilities of B2 Spice

v5’s integration with CADSTAR. With this integration, you will be able to easily open a CADSTAR design up in B2 Spice v5 and run any number of Tests on your design, as well as take full advantage of all of B2 Spice v5’s powerful features. Before we start the tutorial, some things will need to be discussed. • All CADSTAR symbols that are in a design MUST be mapped to a B2 Spice database device or else the CADSTAR, when imported into B2 Spice, will not have a simulation model attached and will not simulation. We have pre-mapped 2500 parts from CADSTAR to B2 Spice. If you have custom libraries or need to map a specific part, you can use the included Database Editor to automate the mapping of your CADSTAR library to B2 Spice parts. However, once mapped, the CADSTAR library will retain this association and only needs to be done once for each CADSTAR symbol used. Sources and grounds will not be imported into B2 Spice. As a result, sources from B2 Spice will need to be used if a simulation is to be performed. Currently, CADSTAR can only export to B2 Spice. CADSTAR cannot import B2 Spice information so there will be no back-annotation. Any changes made in B2 Spice will not be reflected in your CADSTAR design.

• •

Now let us proceed with a simple tutorial to get you acquainted with the procedure for using the CADSTAR-B2 Spice integration. The first thing that will need to be done is to map the required CADSTAR design symbols to a B2 Spice v5 device. We have pre-mapped a large number of CADSTAR parts, but for this tutorial, we will map a part by hand. Again, the mapping for each symbol only needs to be performed once and will persist. GO TO THE END OF THE TUTORIAL TO FIND OUT HOW TO USE THE DATABASE EDITOR TO AUTOMATICALLY MAP ENTIRE LIBRARIES AT ONCE. The finished CADSTAR design is named “Example4.scm” and should be located in the B2 Spice v5 directory. A picture of the final design is below:

or parts can be mapped as they are needed. capacitors. So some planning will be required. and a digital counter. Let’s start by mapping the required 2n2219 resistor. start the B2 Spice Database Editor program that is included with the B2 Spice package.Before arriving at this design. we will need to map the CADSTAR device before drawing out the circuit. From the picture above. You should see a screen like this: . it is clear that we need to map resistors. transistors. To map your CADSTAR symbols.

the Database Editor will then take a few moments to parse the CADSTAR library. Area 5 is the pin matching area. With it you can add. Area 2 is the CADSTAR part’s properties. Area 4 is the list of B2 Spice parts. or delete devices. The second step is to find an equivalent B2 Spice part. You can use area 4 to select a part that will match with CADSTAR. When you select the library that contains the symbols that you wish to attach simulation models to. you will see a dialog that is similar to the following: The area labeled 1 is the list of parts in the CADSTAR library. we will be opening a library entitled “Transistor” which contains … transistors. Once the Database Editor is done parsing the CADSTAR library. To begin the mapping process. This could take a minute or two if the library is especially large. in area 1. which is where the mapping actually takes place. modify. Area 6 is a set of filters to facilitate finding the matching B2 Spice part. locate the CADSTAR part that you wish to map.This is the editor for B2 Spice’s large database of devices. For this instance. The area labeled 3 is the B2 Spice part’s properties. But for this tutorial’s purposes. Click on it and the part’s information will appear in area 2. Go to the Special menu and select “CADSTAR->Attach models to CADSTAR library”. (REQUIRES B2 Map CS) This will give you a standard Windows OPEN dialog that asks you to locate a CADSTAR library. symbols and packages. we will only be mapping CADSTAR library symbols to a simulate-able device in B2 Spice. .

will only display devices with a simulation model attached. PART NAME: will display only parts containing the letters and numbers typed into its field. and Package checkboxes tell the program to automatically try to match the CADSTAR part that is selected. To do so. If they match. click on the B2 Spice part to select it for mapping. Manufacturer. Note that this field is not case-sensitive and only a partial name is needed. the next step to take is try the other filters. it’s ready for mapping. you can click the “<-Auto Map Pins” button to have the program automatically assign the pin mapping. Examine the packages in the CADSTAR area as well as the B2 Spice area. Wildcards can also be used. as opposed to starting with “mc”. The various filters are discussed below: HAS MODEL: when checked. Once you find a match. Category: These are pre-defined fields assigned to each device in our database. You can enable the filter with the checkbox and select the data from the drop-down boxes.To speed up the process of finding an equivalent part. Keywords such as “zener” can be used and if any part of the keyword field matches. it will show all devices starting with mc338. the list will show any device containing “mc” in its name. B2 Spice maps pins by matching CADSTAR’s pins to a B2 spice package pin. Please note that the APPLY FILTER button needs to be pressed after adding or modifying the filter properties. the pin mapping (Area 5) can usually be mapped automatically if the packages are the same. If you had entered “*mc” instead. Once the Transistor library has been opened and processed. This will then try to find an exact name match with the CADSTAR part that you select. make sure the “Automatic Part Title Filter” checkbox is unchecked and then start applying the other filters. This means that B2 Spice will try to associate a CADSTAR package pin with B2 Spice’s own package pin. The next important step to take is to match CADSTAR’s pins with B2 Spice’s pins. Symbol. The Automatic Part. If you type in “mc338”. which also correlates to a model pin. In our case. the device will be displayed. If the packages do not match or wish to apply your own mapping. the filter area. click on the “<-Manual Map Pins” button. the match is indeed exact and the B2 Spice parts list will show the 2n2219a device as an automatic match. This will bring up the following dialog: . you can use the filters in area 6. Package. The easiest way to try to find the right B2 Spice part is to check the “Automatic Part Title Filter” checkbox in Area 6. Keyword: each device has a keyword field that can be used to enter extra information for the device. If the Automatic Part Title Filter fails to find a part (nothing will be display in the B2 Spice parts list). In any case. Scroll down the CADSTAR part list until you find the 2n2219a. Keep in mind that the PART NAME filter takes wildcards and that every modification (or addition) of a filter needs to be applied by pressing the APPLY FILTER button. Pin mapping is critical for simulation purposes because the pins of the CADSTAR part must correlate with a B2 Spice simulation pin or else the simulation will fail or produce incorrect results. Check the box and then click on the 2n2219a part in the CADSTAR list. Symbol.

Once you are satisfied with the matchings. you do not need to match them. Repeat this procedure for the resistors and capacitors in the Discrete. If there are more parts on the CADSTAR library that you want to map. The library will be written with the new B2 Spice mapping information in it. This will bring up a standard Windows Save dialog. you could overwrite the existing library. The resistors and capacitors in B2 Spice’s database are called “resistor” and “capacitor” and by default do not have a package assigned to them. The CADSTAR 74F169 device will match up with B2 Spice’s “74F169 (XSpice)” and will need to be mapped by hand. If you make a mistake. you will have to use the “<-Manual Map Pins” button and match by hand each pin. If there are unconnected pins on a package. If you wish. save the mapped library under a different name. When you are finished mapping parts.lib library. Once the mappings are done. you can then build the CADSTAR circuit so it looks like the picture below: . click the OK button to accept it.You will need to click on a pin from the CADSTAR list and then a matching pin from the B2 Spice pin list. as well as the 74F169 in the Digital. simply click on a new CADSTAR part and then repeat the process. Then click the “Add NewË” button. Do this for all the pins that you wish. When you map such parts. click on the incorrect matching in the “Connections” list and click the “ÁRemove” button. but if you do not want to alter the original library. click on the OK button to save the changes. This will then officially map the pin and list it in the “Connections” list.lib library.

select “Connect to CADSTAR”. It is important that you should only import CADSTAR designs into a blank B2 Spice schematic since importing a CADSTAR design into an existing B2 Spice schematic will result in unexpected and unknown results. Now that the CADSTAR design is finished. Click OK. Otherwise the part will come into B2 Spice as a symbol-only device. From the FILE menu. which should open with a blank schematic. This will bring up the following dialog: This is just a grid size translation factor from CADSTAR to B2 Spice grid coordinates and can usually be left at the default value of 254000. it’s time to import it into B2 Spice. Make sure that CADSTAR is still running before importing the design into B2 Spice Start B2 Spice v5. . with no simulation model and will not figure into the simulation.Make sure that the devices you have used in your CADSTAR design has already been mapped to a B2 Spice part.

and clicking on the “Select Model from Database” button to select the model. but no model will be attached and the symbol will be drawn in red. . the 74F169 Counter was not mapped and the circuit was imported into B2 Spice. If a CADSTAR part had not been mapped to a B2 Spice part and was imported. the symbol will be imported correctly. meaning that this part will not be used in any simulations. This has the advantage of not having to go through the importing process again and is as easy as right clicking on the symbol. and clicking on the “Connect Symbol Pins to Models Pins” button to match up the symbol pins to the model pins. Notice that the symbol is drawn in red and if the part’s properties were examined there will be no model attached. In the screen shot below. There are two ways of fixing this. One is to manually attach a model to the Symbol in B2 Spice. B2 Spice will take a few moments to do the importing as it goes through the CADSTAR design and attaches models from the B2 Spice database to the symbols coming in from the CADSTAR design.B2 Spice will then start the importing process and the cursor will change to the hourglass as it does so. selecting “Edit Part Properties”.

then you will have to do this every time if you select to attach a model after importing the CADSTAR design. In this case. if the part will be used repeatedly in CADSTAR.However. If all parts were mapped correctly and the circuit re-imported. it is better to go ahead and map the CADSTAR part to a B2 Spice part and then re-import the CADSTAR design. the circuit should look like the following: .

. To replace them with actual devices suitable for simulation. go to the ADD PARTS tab at the right side of the B2 Spice window. To do so.All the symbols should look about the same as the CADSTAR design except the symbols should now have models attached. To successfully run a simulation. These will be drawn in red Just drag-select the two symbols and press the DELETE or BACKSPACE key to remove them from the schematic. One important fact to keep in mind is that none of the sources or grounds have been imported. Try double clicking on any of the symbols and a dialog box will appear that will allow you to modify the properties of the models. The connections to grounds and sources have been imported but since in CADSTAR treats power supplies and grounds as virtual connections. there is really no part for B2 Spice to import. delete the symbol-only signals that have been imported as place-holders. grounds and sources will need to be added to the B2 Spice circuit.

This will filter the available devices to show only voltage sources. Place the ground in the following position: . This list still contains symbol-only parts meant for PCB design. go to the top of the ADD PARTS window and click on the SPICE checkbox. you can also go through the ADD PARTS tab. This will pop up a sub-menu displaying the categories below Virtual Instruments. From the list. an easier way to add more common components is by selecting them from the COMMON PARTS menu. select and place the “vcc_analog” so that it looks like the following: To add grounds. To hide these parts and show only devices that actually have simulation models.This will expand the Parts selection tab and allow you to quickly select part from the B2 Spice database. However. You can also right click on a blank area in the schematic and a pop-up menu containing common devices will also appear. The ground can be selected directly from the menu and placed in the schematic. make sure the “Function” tab is active and click on the “Virtual Instruments” button. Follow the sub-menus Virtual Instruments->Voltage Sources and select “Set Filter” under the Voltage Source menu. In the ADD PARTS tab.

To add another probe. only the Tests will be used. B2 Spice has two simulation modes: – – A LIVE mode. Please consult the B2 Spice help file for more information on using the LIVE mode. From the toolbar. you can either go to the Probe button again. For this tutorial. We will now set up the circuit for a Transient Test. Place the first probe to the left of capacitor C1. device parameters cannot be changed. which runs a continuous transient simulation and where parameters can be interactive altered and virtual instruments employed TEST mode.The only steps left is to place meters and output nodes to display results of the simulation. Place the probe on a wire to designate it as a node signal to display in the Transient Test graph. click on the probe button and select “voltage” from the drop down box: This will pull up a voltage probe that will follow the cursor. where different tests can be specified and run. Place 3 more probes so that the circuit will now look like this: . and virtual instruments do not apply. The difference from LIVE mode is that the tests are pre-defined. The first step is to place probes to designate signals to display in the resulting graph. or simply press the space bar to add another of the last part that you added.

Place four more output ports to the last four outputs of the Counter and the circuit should now look like the following: Now that display signals have been designate. From the ADD PARTS tab. we need to set up the actual test and run it.To measure the output of from the F169 Counter. In the filtered list of digital instruments select “Output_Port” and connect it to the output pin of the Counter. click on the “Digital Components->Instruments” sub-category. we also need to place digital output ports. .

This will expand the Test selection and setup window. it is because some simulations options need to be set or refined to allow the simulation engine to correctly process the circuit.Click on the TEST tab at the left edge of the B2 Spice window. Click on the Blue arrow next to the checkboxes to expand the setup window. set it to 200 and click OK to the dialog. If you would prefer a table output instead. This will enable the basic Transient Test. click on the “Convergence” tab. there should be no need to specify the signals. we simply need to select an output window. Go to the “Simulation->Spice Simulation Options” menu. and Step Ceiling to 1u. Now. All that’s left to do is click the RUN button. The other two checkboxes under “Sweep” and “MC” are for multi-level parameter Transient Tests and Monte Carlo transient Tests. Leave the rest of the setup times at their default. B2 Spice will run the simulation and create the following graph: If you wanted to see a longer simulation run. For itl4. For the Start Time. By default. Now try rerunning the Transient Test. The “Preset Graph Plots” button allows you to specify which nodes and signals you would like to see in the output. Graph is checked. check that. . Depending on what options are set. we just need to set up the Test. We will be running a Transient Test so click the first checkbox next to the Transient area. If you received the error message. Consult the help file for B2 Spice v5 if you would like to learn more about these Tests. But since we have already placed probes in the circuit. you might get a graph or an error message saying that “step size too small”. try rerunning the Transient test by setting the stop time to 500m and the step ceiling to 100u. We will not be using them in this example. From there. Set the Stop Time to 10m. Once the Basic Transient has been enabled. enter 0 if it’s not already there.

All colors and lines can be customized by using the various Edit Graph and Edit Plot tabs. If you would like to save your schematic. The Database Editor will then read in the library and present you with the following dialog: The MAP CAPACITORS and MAP RESISTORS sections allow you to map all capacitors and resistors in the library to a generic B2 Spice capacitor and resistor. This will present you with a list of capacitors and resistors. you can from here you can switch back to the schematic. You can also add more probes to add additional signals. go to the Special menu and select “CADSTAR>Attach models to CADSTAR library”. Please refer to the help file for more details about customizing your graph. nothing else needs to be done. However. move the probes around and the signals should update to reflect the new probe signals. The best B2 Spice devices to map to would be . Select the library that you want to map into B2 Spice. (Requires B2 MAP CS) This will give you a standard Windows OPEN dialog that asks you to locate a CADSTAR library.The basic analysis has been performed. or use the EDIT PLOTS tab to custom signals using formulas and signals. you will need to specify the B2 Spice device that the CADSTAR R’s and C’s will map to. If you want to map an entire CADSTAR library. The graph and signals can also be fully customized if you are not satisfied with their appearance. If you are satisfied with the results. Click on the CHOOSE B2 SPICE CAPACITOR/RESISTOR button to do so. Before you proceed with mapping the resistors and capacitors. switch back to the schematic and either click the Save button in the toolbar or go File->Save Project As… ADDENDUM: How to use the Database Editor to automatically map entire libraries.

You can copy and paste these lists to a text file to browse later. This will continue until the Database Editor goes through each of the devices in the CADSTAR library. click on the MAP PARTS BY TITLE button. Once you have specified the resistor and capacitor devices. Alternative methods are described below. that is.the generic “capacitor” and “resistor” devices so select them from the list. If it finds a conflict between assigned packaged. . After the mapping is done. Saying “no” to a mapping will not map the part and place the CADSTAR device in question in a list that you can go over later. a list of successfully mapped parts will appear in the “GOOD MAPPINGS” window and a list of mismatches will appear in the PARTS NEEDING PACKAGES OR PKG PIN MAP window. When the program is done automatically mapping the library. what package CADSTAR has assigned to a device and what B2 Spice has assigned to the matching device. Notes: Integration with CADSTAR requires B2 Spice Professional CS. To map the rest of the library. click on the MAP CAPACITORS and MAP RESISTORS button in turn. This will tell the Database Editor to go through the CADSTAR library and try to match each device with a device of the same name in B2 Spice. Mapping CADSTAR libraries to B2 Spice as discussed in this document requires B2 Map CS a product sold separately. a dialog will appear asking you if you want to make the mapping. a list of successfully mapped devices will appear in the GOOD MAPPINGS window.

an alias for this SOT-23 already exists in the B2 database. i. however. Since the C* Package name DOES match the B2 package.e. in most cases there is no need for the pin name mappings.1) Using the B2 database editor. and the B2 Package Alias does match up. edit. but in this case the C* pins are named. or delete mappings from C* parts to B2 Parts. If the C* and B2 packages match up then there is no need to enter the pin mapping. It allows the user to add. This feature is not as user friendly as the Attach Models… feature described below because it does not read in the entire C* library and thus it does not know the C* part names or C* pin names. Notice that the C* Package Name (sot23) doesn’t match the B2 Package name (SOT-23). 2) Using the C* library editor. the C* pins are named in the C* library editor and identified by name rather than by pad number. It is possible to store attributes the C* libraries that will be used by B2 Spice. or if the packages don’t match up. and . Here is a sample of this feature showing a mapping from the C* BAS19 part to the B2 BAS19 part. Edit CADSTAR-B2 Spice Part and Pin Map This menu item appears on the special menu in the Cadstar sub-menu. then the pins need to be explicity mapped. and these are: @bbmodel <model_name> @bbmodelpinmap (<c*pin1> <bbpin1> <c*pin2> <bbpin 2> …) <model_name> is the name of the model in b2 spice. When the C* pins are named.

http://www. but if the pin has been named within C*. These attributes will be used only if a part mapping for the C* part does not exist in the B2 database. For example. After selecting the . i. they have no model. it will be the pad number. and you can use this to set up the part pins. and there is a button on that form called “Select Model”.<bbpin1> is the name of the model pin in b2 spice that matches the first C* pin. (Usually. you notice that some of the parts are red. there is another button called “Match Symbol pins with Model Pins”. 3) Using B2 Spice After importing your C* schematic into B2 Spice. However. the user will need to be careful to match up the pins correctly.e. and then choose a model for the part. then use the pin name). and <c*pin1> is the name of the first c* pin. if you connect up the diode’s pins incorrectly. Or you can choose Edit Part. You can choose “Select Alternate Model”. There are a few ways to attach a model to the part. Inc.beigebag. then it will block current when you intend it to be conducting and the circuit will not work correctly. Copyright © 2005 Beige Bag Software.