Changes

Creating New Devices and Models

392 bytes added, 14:59, 10 November 2016
/* Setting & Matching Device Pins */
[[File:rfspice_banner.png|right|640px]]
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D | Back to RF.Spice A/D Wiki Gateway]]'''
 
[[Image:Tutorial_icon.png|40px]] '''[[RF.Spice_A/D#RF.Spice_A.2FD_Tutorials | RF.Spice A/D Tutorial Gateway]]'''
==Importing a New Simulation Model==
Both process models and subcircuit models can be imported from simple plain text files with a ".TXT' file extension. Importing a simulation model from a text file is a very simple and straightforward procedure. Under the File Menu of the Device EditorManager, choose "Import Simulation Model from Text File...". An "Open" dialog box will appear for you to locate the model text file. Locate the file and click OK. Follow the program prompts to choose a category, enter a description and keyword and choose a manufacturer for the new model to be imported. These fields may be left blank and filled out later through the Edit Model Dialog. Click OK when you are done. A message will indicate that you have loaded your (subcircuit or process) model file, and that a simulation model was created assuming that it was successfully loaded. The program will then fix the polynomial controlled sources, if any, and notify you of encountered problems. Click OK after each message box. When your model is loaded successfully, the program will notify you of the completion of the import process.
If your file does not load, make sure the source file is not open in another application. Your model text file can contain the ".model" lines or Netlist subcircuit codes for several different models. All of these models can be imported together in a single process. In that case, the program will guide you through the same process for each individual model.
==Resolving SPICE Language Incompatibilities==
E1 1 2 poly(3) (3,0) 1 0 0 3
The SPICE line above means a voltage-controlled voltage source where the voltage across nodes 1 and 2 is determined by the function: v(1,2) = 1 + 0 + 0 + 3* v(3)^3. SPICE 3, on which [[B2RF.Spice A/D]] is based , supports a more general form of controlled source which includes polynomial controlled sources as a subset. This new "device" is the nonlinear dependent source with the following general Form:
Bxxx N+ N- < I=EXPR > < V=EXPR >
E1 1 2 poly(3) (3,0) 1 0 0 3
the corresponding SPICE 3 (and B2[[RF.SpiceA/D]]) implementation is:
BE1 1 2 V= 1 + 3 * V(3)^3
===Incompatible Model Types===
Some Netlist languages such as that from Pspice use models that are either not in B2RF.SpiceA/D or are defined with a different set of [[parameters]]. When you edit a subcircuit model in the Device Editor, you can check for incompatible models using the appropriate button. In addition, there is a button you can use to fix these models wherever possible within the subcircuit. ==Creating a New Device from Scratch==
A device consists of a simulation model and a symbol. The device's simulation model can be either a process model or a subcircuit model. The model may have one or more nodes or terminals. Accordingly, the device's symbol may have one or more pins. These pins are mapped onto the terminals or nodes of the part's simulation model. In order to create a new device from scratch, you must already have a simulation model and a symbol. You can use the existing models and symbols in the Parts Database, or you can create entirely new models or draw your own new symbols from the ground up. Here we assume that you are using an existing model and an existing symbol. Creating new models and drawing new symbols will be discussed later separately. == Importing RF Device Models ==
From the File Menu of the Device Editor choose "New DeviceMultiport Network device, i.e..". The "Edit Device" dialog opens up. Fill in the "Device Name" field and specify the categoryone-ports, manufacturertwo-ports, three-ports and description to help identify the devicefour-ports, are all modeled based on their frequency-domain S-parameters. These fields Most active and passive RF devices can be left blankmodeled as multipart networks. The description For example, RF diodes can be modeled as one-ports, while RF transistors (BJTs, JFETs, MOSFETs, and keywords are helpful for searching MESFETs) can be modeled as two-ports. Many semiconductor manufacturers publish S-parameter data sets for the devicetheir RF devices. To choose The manufacturer data sheets usually contain S-parameters in Mag/Phase format tabulated as a function of frequency expressed in GHz. On the simulation other hand, you can modelmany passive devices such as filters, click on the "Select Modeldirectional couplers, hybrids, etc.as multiport structures using full-wave electromagnetic simulators like [[EM.Cube]]." button. This will bring up The port characteristics of such devices are typically written into data files as a list function of simulation frequency. A particular case of interest is transmission line components with complex geometries or material composition, for which [[RF.Spice A/D]] does not provide any database models that you can choose from. Choose as an example, consider the symbol from the list case of symbols in a similar manner by clicking on the "Select Symbol...Finline" buttontransmission line. In a finline-based circuit, you may need one of more of the following general transmission line components:
For the part to be valid, the pins (terminals) of the simulation model must match up with the pins on the symbol. If you let the program automatically create a symbol for an existing simulation model, then there is a guaranteed match. However, there will be cases when you need to specify the pin names on the simulation model so that they match up with those of the symbol. The button labeled "Connect Symbol Pins to Model Pins" is provided for this very purpose. See the next section on Setting & Matching Device Pins for more details.* Open End
==Setting & Matching Device Pins==* Bend (right-angled or mitered)
[[File:b2MAN_Fig45.png|thumb|400px| "Connect Symbol Pins to Model Pins" Dialog.]]When creating a new simulation model as will be discussed later, you can also instruct the Device Editor to create a default (simple and basic) symbol for a it. Normally, if you have already set the simulation model pin or terminal names, the symbol pins will automatically match the model pins. In many other cases, you may create the models and symbols separately and independently. In such cases, you need set and match the symbol pins with the corresponding model pins. * Step Junction
In the "Edit Device" dialog* Tee Junction (symmetric or asymmetric, click the button labeled "Connect Symbol Pins to Model Pins". A new dialog opens up. The pin names for the simulation model will appear on the left side of dialog. The default pin names will be the same as the pin numbers if this is possibly with a subcircuit model; otherwise, they will be the default pin names for built-in simulation model types. The next table to the right shows a list of symbol pin name. A select/highlight a model pin and then select/highlight the corresponding symbol pin. Click the button labeled "Add New ==>" to move the pair to the "Connections" window on the right side of the dialog. This window shows all the pin mappings. You can reassign the pin at any time by selecting a row from the Connections Window and clicking the "Remove <==" button. This will return the selected model and symbol pin pair back to the origin tables, whereby you can change and redefine the pin associations. notch)
It is important to match up the pins correctly because the simulator will need this information to be correct to simulate the part correctly. Limit pin names to 10 characters or less. For spaces use underscore * Cross Junction ( _ symmetric or asymmetric). Dashes are not accepted. Click OK when all the pins have been matched up correctly.
==Creating RF. Spice currently does not provide any models for finline components. However, you can use [[EM.Cube]] to analyze various finline structures over a New Part from Your Circuit== frequency range of interest and generate S-parameter data sets for them.
[[RF.Spice A/D]] allows you to take a circuit and turn it into import S-parameter-based models of RF devices from text files. Before describing how to import S-parameter data files, let us first discuss the format of the data files in more detail. S-parameter data files must have a "reusable.TXT" partfile extension. In other wordsThese files must start with a ".model", it converts your circuit into a device that is saved ".symbol" statement, and added to a format statement starting with the Parts Databasecharacter "#". Almost any circuit The model text file can have any number of comment lines at the beginning of the file or elsewhere. Comment lines are preceded by "*" or "!". All the text after these characters on the rest of the line will be turned into a database device with just a few stepsignored.
<b>Step 1 - Setting Up the Circuit for Part Creation</b>Format:
Using Workshop, create or Open a circuit that you wish to turn into a part. model <model_name>
For Mixed Mode circuits, the first thing you will need to do is to insert Markers into the circuit to designate where pins for the new part should go. Markers can be found under the Devices menu or the Virtual Devices menu in the Parts Chooser.symbol <symbol_name>
Once the markers are placed, double click on each one and type in a name in the Part Title field. This will be the name of the pin once the circuit is turned into a part. Then in the same dialog box, check the Use as Subcircuit Port box. This lets Workshop know that this marker is to be used as a port in the new part. The Marker Properties box should look similar to the one below.&#35;<frequency_units> &nbsp; s &nbsp; <complex_data_format> &nbsp; r &nbsp; <reference_impedance_value>
For Digital circuits, Input and Output ports take the place of Markersfreq &nbsp; &nbsp; s11 s21 s31 ... &nbsp; &nbsp; s12 s22 s32 ... &nbsp; &nbsp; s13 s23 s33 .. You can simply double click on the Input/Output port, name it, and check the "Use as Subcircuit Port" checkbox.
<b>Step 2 - Creating the Part</b>Example:
Once the Markers, or Input/Output ports in Digital mode, are in place and set up correctly, go to the File menu and choose Create Part from Circuit. The program will then prompt you for a name. Enter the name you wish for the new part and click OK. Then the program will ask if you would like it to create a symbol for your part. If you already have a symbol ready, click NO and Workshop will then ask you to select a symbol from the Parts Database. Otherwise, click YES and Workshop will create a generic box symbol to be used with your part. The new part ! This is now in the database and you're ready to customize the partan example of an RF BJT model based on measured S-parameters.
<b>Step 3 - Modifying the New Part</b>.model MyNewRFBJT
Run the Database Editor and select Edit Simulation Model under the Edit menu. Select the part that you just created in the Workshop and click Edit. symbol bjt_npn
For Mixed Mode parts, Click on the Set Model Pins and you should see the dialog box below: &#35;ghz &nbsp; s &nbsp; ma &nbsp; r &nbsp; 50
If all the parts in your circuit are pure analog parts, then you should check the pins over to see if they're correct.! GHz &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG
If your circuit contained XSpice parts, you will have to designate whether the pin is digital or analog0. If the pin is Digital, then you must also designate whether it is an Input or Output pin500 &nbsp; 0. If the pin is Analog, then input and output direction designation do not apply6943 &nbsp; -122. Click accept when you're done with each pin1 &nbsp; 4. Click OK when you're done setting the pins977 &nbsp; 105. 7 &nbsp; 0.0901 &nbsp; 33.0 &nbsp; 0.6170 &nbsp; -37.8
For Digital parts, Select and edit the [[Digital Simulation|digital simulation]] model you just created1. In the Edit Simulation Model dialog box, click the Edit Pin Properties button to access the list of digital pin000 &nbsp; 0. You should set each pin's direction, state, and propagation delay6470 &nbsp; -169. Click the Accept button to accept changes and move on to the next pin7 &nbsp; 2. Refer to the Database Editor Menu's Edit simulation model section for more information820 &nbsp; 76.8 &nbsp; 0.0975 &nbsp; 23.3 &nbsp; 0.4862 &nbsp; -45.5
Once you're done setting 1.500 &nbsp; 0.6586 &nbsp; 162.9 &nbsp; 1.959 &nbsp; 57.6 &nbsp; 0.0978 &nbsp; 25.6 &nbsp; 0.4468 &nbsp; -54.5 2.000 &nbsp; 0.6854 &nbsp; 142.0 &nbsp; 1.481 &nbsp; 41.5 &nbsp; 0.1055 &nbsp; 32.2 &nbsp; 0.4315 &nbsp; -65.1 2.500 &nbsp; 0.7070 &nbsp; 128.1 &nbsp; 1.246 &nbsp; 30.1 &nbsp; 0.1175 &nbsp; 37.7 &nbsp; 0.4261 &nbsp; -75.5 3.000 &nbsp; 0.7449 &nbsp; 110.9 &nbsp; 0.985 &nbsp; 15.5 &nbsp; 0.1475 &nbsp; 41.9 &nbsp; 0.4218 &nbsp; -93.3 The model statement specifies the pin propertiesname of your RF device model, close all in this case, MyNewRFBJT. The symbol statement determines the dialog boxesdevice type and schematic symbol. All that remains The symbol_name can only be one of the choice given in the table below. The frequency units can be hz, khz, mhz or ghz. "s" implies the s-parameters. If the complex_data_format is to alter left blank, the symbol if you want S-parameters are interpreted to rearrange have Mag/Phase format, with the symbol pins magnitude on a linear scale and exit phase expressed in degrees. The other options for complex_data_format are "ma" for magnitude expressed in dB, or "ri" for Real/Imag format. The last part specifies the Database Editorreference impedance value, which must come after letter "r". In the Workshop pull up your new part above example, the reference impedance is 50 Ohms.  [[Image:Info_icon.png|40px]] Click here to see a '''[[An_Overview_of_RF_Circuit_Simulation#List_of_Standard_Imported_RF_Devices | List of Standard Imported RF Devices]]'''. == Using Device Manager for Importing S-Parameter Data == The Device Editor of RF. Spice A/D lets you import S-parameter text files in a variety of ways. There are three menu items for this purpose: * Import S-Parameter Model from Text File... * Create New Generic Multiport from S-Parameter Text File... * Create New RF Device from S-Parameter Text File... * Create New Generic T-Line Discontinuity from S-Parameter Text File... The first item in the above list simply lets you import an S-parameter ".TXT" file and saves it as a simulation model in [[RF.Spice A/D]]'s parts database. You can use this model later to build a new device or share it like any among several devices. The next three items in the above list create new devices complete with simulation models and schematic symbols. The newly create devices are permanently stored in your [[RF.Spice A/D]] parts database and can be used as new parts in your RF circuits. For example, an imported RF BJT device has the same BJT symbol with the same pin map as the other partBJT devices of [[RF.Spice A/D]]. The main difference is that instead of a technology process models or a Netlist subcircuit model, the RF BJT is modeled by its imported, measured S-parameters. In a similar manner, you can import Multiport Network devices or T-Line Discontinuity models from S-parameter text files that are generated at the end of full-wave simulations of such structures using an electromagnetic modeling tool like [[EM.Cube]].
==Creating a New Simulation Model from Scratch==
If your model type is a SUBCIRCUIT the simulation guts will be blank. You will need to enter the subcircuit text for this part into the empty text field. If you already have this text in another file, you can copy and paste the subcircuit text.
If your model type is other than a Subcircuit you will need to set [[parameters]] for the device. If you need help with this, see the section on entering [[parameters]].
Some devices or parts require that a process model be set. To set the process model click on the ellipsis button, and then select a process model from the list that appears. If the process model for your simulation model is not in the list, then you need to add a new process model.
==Creating a New Device from Scratch== A device consists of a simulation model and a symbol. The device's simulation model can be either a process model or a subcircuit model. The model may have one or more nodes or terminals. Accordingly, the device's symbol may have one or more pins. These pins are mapped onto the terminals or nodes of the part's simulation model. In order to create a new device from scratch, you must already have a simulation model and a symbol. You can use the existing models and symbols in the Parts Database, or you can create entirely new models or draw your own new symbols from the ground up. Here we assume that you are using an existing model and an existing symbol. Creating new models and drawing new symbols will be discussed later separately.  From the File Menu of the Device Editor choose "New Device...". The "Edit Device" dialog opens up. Fill in the "Device Name" field and specify the category, manufacturer, and description to help identify the device. These fields can be left blank. The description and keywords are helpful for searching for the device. To choose the simulation model, click on the "Select Model..." button. This will bring up a list of simulation models that you can choose from. Choose the symbol from the list of symbols in a similar manner by clicking on the "Select Symbol..." button.  For the part to be valid, the pins (terminals) of the simulation model must match up with the pins on the symbol. If you let the program automatically create a symbol for an existing simulation model, then there is a guaranteed match. However, there will be cases when you need to specify the pin names on the simulation model so that they match up with those of the symbol. The button labeled "Connect Symbol Pins to Model Pins" is provided for this very purpose. See the next section on Setting & Matching Device Pins for more details. ==Setting & Matching Device Pins== When creating a new simulation model as will be discussed later, you can also instruct the Device Editor to create a default (simple and basic) symbol for a it. Normally, if you have already set the simulation model pin or terminal names, the symbol pins will automatically match the model pins. In many other cases, you may create the models and symbols separately and independently. In such cases, you need set and match the symbol pins with the corresponding model pins.  In the "Edit Device" dialog, click the button labeled "Connect Symbol Pins to Model Pins". A new dialog opens up. The pin names for the simulation model will appear on the left side of dialog. The default pin names will be the same as the pin numbers if this is a subcircuit model; otherwise, they will be the default pin names for built-in simulation model types. The next table to the right shows a list of symbol pin name. A select/highlight a model pin and then select/highlight the corresponding symbol pin. Click the button labeled "Add New ==>" to move the pair to the "Connections" window on the right side of the dialog. This window shows all the pin mappings. You can reassign the pin at any time by selecting a row from the Connections Window and clicking the "Remove <==" button. This will return the selected model and symbol pin pair back to the origin tables, whereby you can change and redefine the pin associations.  It is important to match up the pins correctly because the simulator will need this information to be correct to simulate the part correctly. Limit pin names to 10 characters or less. For spaces use underscore ( _ ). Dashes are not accepted. Click OK when all the pins have been matched up correctly. <table><tr><td> [[File:b2MAN_Fig45.png|thumb|left|720px| "Connect Symbol Pins to Model Pins" Dialog.]]</td></tr></table> 
==Creating a New Device from an Existing Simulation Model==
Your new symbol will be named the same name as your model name. If you create a new symbol by clicking on the Create Symbol button you will be notified that a symbol has been created successfully.
==Creating a Parameterized New Part from Your Circuit==  [[RF.Spice A/D]] allows you to take a circuit and turn it into a "reusable" part. In other words, it converts your circuit into a device that is saved and added to the Parts Database. Almost any circuit can be turned into a database device with just a few steps. <b>Step 1 - Setting Up the Circuit for Part Creation</b> Using Workshop, create or Open a circuit that you wish to turn into a part.  For Mixed Mode circuits, the first thing you will need to do is to insert Markers into the circuit to designate where pins for the new part should go. Markers can be found under the Devices menu or the Virtual Devices menu in the Parts Chooser. Once the markers are placed, double click on each one and type in a name in the Part Title field. This will be the name of the pin once the circuit is turned into a part. Then in the same dialog box, check the Use as Subcircuit Port box. This lets Workshop know that this marker is to be used as a port in the new part. The Marker Properties box should look similar to the one below. For Digital circuits, Input and Output ports take the place of Markers. You can simply double click on the Input/Output port, name it, and check the "Use as Subcircuit Port" checkbox. <b>Step 2 - Creating the Part</b> Once the Markers, or Input/Output ports in Digital mode, are in place and set up correctly, go to the File menu and choose Create Part from Circuit. The program will then prompt you for a name. Enter the name you wish for the new part and click OK. Then the program will ask if you would like it to create a symbol for your part. If you already have a symbol ready, click NO and Workshop will then ask you to select a symbol from the Parts Database. Otherwise, click YES and Workshop will create a generic box symbol to be used with your part. The new part is now in the database and you're ready to customize the part.  <b>Step 3 - Modifying the New Part</b> Run the Database Editor and select Edit Simulation Model under the Edit menu. Select the part that you just created in the Workshop and click Edit.  For Mixed Mode parts, Click on the Set Model Pins and you should see the dialog box below:  If all the parts in your circuit are pure analog parts, then you should check the pins over to see if they're correct. If your circuit contained XSpice parts, you will have to designate whether the pin is digital or analog. If the pin is Digital, then you must also designate whether it is an Input or Output pin. If the pin is Analog, then input and output direction designation do not apply. Click accept when you're done with each pin. Click OK when you're done setting the pins.  For Digital parts, Select and edit the digital simulation model you just created. In the Edit Simulation Model dialog box, click the Edit Pin Properties button to access the list of digital pin. You should set each pin's direction, state, and propagation delay. Click the Accept button to accept changes and move on to the next pin. Refer to the Database Editor Menu's Edit simulation model section for more information. Once you're done setting the pin properties, close all the dialog boxes. All that remains is to alter the symbol if you want to rearrange the symbol pins and exit the Database Editor. In the Workshop pull up your new part and use it like any other part. == Creating a Parameterized Subcircuit Device ==
Parameterized Subcircuit Parts are parts whose behavior can be modified with one or more [[parameters]]. In some cases, you will want to turn your subcircuit defined parts into parameterized subcircuits.
In this example, we will be creating a battery as a Parameterized Subcircuit Model part.
This should bring up the dialog box shown below. In the Model Type Name, enter the name you would like to identify your new model by, making sure that there are no spaces in the name.
Then click on the [[Parameters]] tab. In the Parameter Name field, enter the name of the 1st parameter that you will be using, in this case, Voltage. In the data type, select the type of data of the parameter. Usually this will be a real or integer. In this example, the Data Type will be Real. Units and defaults are optional. Make sure the Use For Input box is checked. Leaving it unchecked will cause the parameter to not show up in other dialog boxes. The "Is Required" checkbox is for when you want Workshop to specifically use this parameter. If you check the box, then you also must enter a Default Value.
Click Accept when you're finished with the particular parameter. Note that you must click New Parameter to enter and edit a new parameter. Not doing so will overwrite the parameter that happens to be highlighted.
Then click on the Subcircuit Text tab. This is where you will be entering the actual subcircuit that you will be using your [[parameters]] in.
If you know what you're doing, you can start entering your subcircuit starting with the .SUBCKT statement and ending the .ENDS statement. This subcircuit will need to be in Berkeley Spice 3f5 format with XSpice extensions. Otherwise, copy and paste a subcircuit into the window. You can get the subcircuit text for an existing simulation model by editing the simulation model and copying its text.
Now all you have to do is incorporate your own [[parameters]] into the subcircuit. Enter your [[parameters]] in the form of a parameter or formula. All custom [[parameters]] must go in between the curly brackets {}. For example, if you had two [[parameters]] called X and Y and wish to have them added together in a subcircuit, the formula would be {X + Y}. Or getting fancier, you add X and Y and then multiply by 2. The formula would look like this: {(X + Y) * 2}. All standard mathematical operations are supported (+,-,/,*), power of (^), and any other operation supported in the graphing plot expression module of the Workshop. In the example below, note that the {voltage} has replaced the regular voltage number.
Once you're satisfied that everything is correct, click OK and continue to the next step.
the Set Model Pins... button allows you to edit the pins in your simulation model, if wish. The Create Symbol will create a new generic symbol using the pins in your subcircuit for symbol pins and named the same as your Simulation Model
Click on the "[[Parameters]]" tab, you can enter values for the [[parameters]] that you specified earlier. Or you can leave them blank for now and change it once you have the part in the schematic. For this example, we'll enter a default voltage of 10. Enter 10 in the Value box and click Accept. The window should look like the window below. Once you're done editing the simulation model, click OK to accept it.
<b>Step 3 - Create a new Part with the simulation model</b>
Click OK to accept the part.
And that's it. To access your new part in the Workshop, go to Devices->Choose Part by Name and type in the name of your part. Pull your part up in the Workshop and double click on it to change your custom [[parameters]]. The [[parameters]] will be evaluated automatically as you run a simulation.
You can assign packages and pairings by using the drop down box to select a package, typing in how many parts come in a package, and then clicking on the Connect Part Pins to Package Pins button. More information about Packages can be found in the PCB tutorial.
== Importing RF Device Models ==<p>&nbsp;</p> Multiport Network device, i.e. one-ports, two-ports, three-ports and four-ports, are all modeled based on their frequency-domain S-[[parameters]]Image:Tutorial_icon. Most active and passive RF devices can be modeled as multipart networks. For example, RF diodes can be modeled as one-ports, while RF transistors (BJTs, JFETs, MOSFETs, and MESFETs) can be modeled as two-ports. Many semiconductor manufacturers publish S-parameter data sets for their RF devices. The manufacturer data sheets usually contain S-[[parameterspng|40px]] in Mag/Phase format tabulated as a function of frequency expressed in GHz. On the other hand, you can model many passive devices such as filters, directional couplers, hybrids, etc. as multiport structures using full-wave electromagnetic simulators like [[EM.Cube]]. The port characteristics of such devices are typically written into data files as a function of frequency. A particular case of interest is transmission line components with complex geometries or material composition, for which '''[[RF.Spice]] does not provide any database models. as an example, consider the case of a "Finline" transmission line. In a finline-based circuit, you may need one of more of the following general transmission line components: * Open End * Bend (right-angled or mitered) * Step Junction * Tee Junction (symmetric or asymmetric, possibly with a notch) * Cross Junction (symmetric or asymmetric) Spice_A/D#RF. Spice currently does not provide any models for finline componentsSpice_A. However, you can use [[EM.Cube]] to analyze various finline structures over a frequency range of interest and generate S-parameter data sets for them.  [[2FD_Tutorials | RF.SpiceA/D Tutorial Gateway]] allows you to import S-parameter-based models of RF devices from text files. Before describing how to import S-parameter data files, let us first discuss the format of the data files in more detail. S-parameter data files must have a ".TXT" file extension. These files must start with a ".model", a ".symbol" statement, and a format statement starting with the character "#". The model text file can have any number of comment lines at the beginning of the file or elsewhere. Comment lines are preceded by "*" or "!". All the text after these characters on the rest of the line will be ignored. Format: .model <model_name> .symbol <symbol_name>  &#35;<frequency_units> &nbsp; s &nbsp; <complex_data_format> &nbsp; r &nbsp; <reference_impedance_value> freq &nbsp; &nbsp; s11 s21 s31 ... &nbsp; &nbsp; s12 s22 s32 ... &nbsp; &nbsp; s13 s23 s33 ... Example: ! This is an example of an RF BJT model based on measured S-[[parameters]]. .model MyNewRFBJT .symbol bjt_npn &#35;ghz &nbsp; s &nbsp; ma &nbsp; r &nbsp; 50 ! GHz &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG &nbsp; MAG &nbsp; ANG'''
0.500 &nbsp; 0.6943 &nbsp; -122.1 &nbsp; 4.977 &nbsp; 105.7 &nbsp; 0.0901 &nbsp; 33.0 &nbsp; 0.6170 &nbsp; -37.8
 
1.000 &nbsp; 0.6470 &nbsp; -169.7 &nbsp; 2.820 &nbsp; 76.8 &nbsp; 0.0975 &nbsp; 23.3 &nbsp; 0.4862 &nbsp; -45.5
 
1.500 &nbsp; 0.6586 &nbsp; 162.9 &nbsp; 1.959 &nbsp; 57.6 &nbsp; 0.0978 &nbsp; 25.6 &nbsp; 0.4468 &nbsp; -54.5
 
2.000 &nbsp; 0.6854 &nbsp; 142.0 &nbsp; 1.481 &nbsp; 41.5 &nbsp; 0.1055 &nbsp; 32.2 &nbsp; 0.4315 &nbsp; -65.1
 
2.500 &nbsp; 0.7070 &nbsp; 128.1 &nbsp; 1.246 &nbsp; 30.1 &nbsp; 0.1175 &nbsp; 37.7 &nbsp; 0.4261 &nbsp; -75.5
 
3.000 &nbsp; 0.7449 &nbsp; 110.9 &nbsp; 0.985 &nbsp; 15.5 &nbsp; 0.1475 &nbsp; 41.9 &nbsp; 0.4218 &nbsp; -93.3
 
The model statement specifies the name of your RF device model, in this case, MyNewRFBJT. The symbol statement determines the device type and schematic symbol. The symbol_name can only be one of the choice given in the table below. The frequency units can be hz, khz, mhz or ghz. "s" implies the s-[[parameters]]. If the complex_data_format is left blank, the S-[[parameters]] are interpreted to have Mag/Phase format, with the magnitude on a linear scale and phase expressed in degrees. The other options for complex_data_format are "ma" for magnitude expressed in dB, or "ri" for Real/Imag format. The last part specifies the reference impedance value, which must come after letter "r". In the above example, the reference impedance is 50 Ohms.
 
[[Image:Info_icon.png|40px]] Click here to see a '''[[List of Standard Imported RF Devices]]'''.
 
== Using Device Manager for Importing S-Parameter Data ==
 
The Device Editor of RF. Spice A/D lets you import S-parameter text files in a variety of ways. There are three menu items for this purpose:
 
* Import S-Parameter Model from Text File...
 
* Create New Generic Multiport from S-Parameter Text File...
 
* Create New RF Device from S-Parameter Text File...
 
* Create New Generic T-Line Discontinuity from S-Parameter Text File...
 
The first item in the above list simply lets you import an S-parameter ".TXT" file and saves it as a simulation model in [[RF.Spice]]'s parts database. You can use this model later to build a new device or share it among several devices. The next three items in the above list create new devices complete with simulation models and schematic symbols. The newly create devices are permanently stored in your [[RF.Spice A/D]] parts database and can be used as new parts in your RF circuits. For example, an imported RF BJT device has the same BJT symbol with the same pin map as the other BJT devices of [[RF.Spice A/D]]. The main difference is that instead of a technology process models or a Netlist subcircuit model, the RF BJT is modeled by its imported, measured S-[[parameters]]. In a similar manner, you can import Multiport Network devices or T-Line Discontinuity models from S-parameter text files that are generated at the end of full-wave simulations of such structures using an electromagnetic modeling tool like [[EM.Cube]]
 
<p>&nbsp;</p>
[[Image:Back_icon.png|40px]] '''[[RF.Spice_A/D | Back to RF.Spice A/D Wiki Gateway]]'''
28,333
edits