Appendix B - Single Property Parameterization

To download the examples for Module 5, click Module_5_Examples.zip.

In this topic:

What You Will Learn

  • How to pass parameters into subcircuits using the single property method.
  • Parameters can be stored as a space-delimited parameter string and passed as a single property.
  • Why the single property method is not the preferred method for passing parameters into subcircuits.

Getting Started

There are several ways to pass parameters into subcircuits. In the previous topic, 5.0 About Parameters, you used the .GLOBALVAR statement to define a global parameter. A drawback to global parameters is that every instance uses the same parameter value. In this topic, you will learn how to pass parameters through the symbol-to-subcircuit interface, which allows you to pass the same parameter name with different values for each instance.

Single-Property Method

The single property method stores all model parameters on a single property as a parameter string. The individual parameter names and values are concatenated with an equal sign, then the three name-value pairs are joined with a space. The final parameter string is FC=10k R_VAR=1k GAIN=1.

In the first exercise, you will store a parameter string on a single symbol property and pass it into the subcircuit using the SIMPLIS_TEMPLATE property. This is the single-property parameterization method.

Exercise #1: Parameterize Using the Single Property Method

To use the single property method, you will add a PARAMETERS property with the parameter string value: FC=10k R_VAR=1k GAIN=1 and then add a SIMPLIS_TEMPLATE property to pass the PARAMETERS property to the subcircuit as a set of parameters.

  1. Open the schematic 5.3_parametrized_rc_filters_single_prop.sxsch.
  2. To add the PARAMETERS property to the param_rc_single_prop.sxcmp symbol, follow these steps:
    1. Select U1, and then type the keyboard shortcut Shift+S to open the symbol.
      Result: The param_rc_single_prop schematic component symbol opens in the Symbol Editor.
    2. From the Symbol Editor menu, select Property/Pin > Add Property...
      Result: The Add Property dialog opens.
    3. In the Name field, type PARAMETERS.
    4. In the Value field, type the following: FC=10k R_VAR=1k GAIN=1
    5. Check the Selectable and Show name check boxes.
      Result: The configured Add Property dialog should appear as shown below:
    6. Click Ok on the Add Property Dialog.
      Result: The property named PARAMETERS is added to the symbol with the value FC=10k R_VAR=1k GAIN=1.
  3. To add the SIMPLIS_TEMPLATE symbol property, follow these steps:
    1. From the Symbol editor menu, select: Property/Pin > Add Property...
      Result: The Add Property dialog opens.
    2. In the Name field, type SIMPLIS_TEMPLATE.
    3. In the Value field, type the following: <ref> <nodelist> <value> vars: %PARAMETERS%
    4. Check the Hidden check box.
      Result: The configured Add Property dialog should appear as below:
    5. Click Ok on the Add Property Dialog.
      Result: The SIMPLIS_TEMPLATE property is added to the symbol with the value <ref> <nodelist> <value> vars: %PARAMETERS%.
      Note: Hidden properties are preceded with an asterisk, as seen on the SIMPLIS_TEMPLATE property value above. These properties are only visible in the symbol editor.
  4. Press Ctrl+S to save the symbol.
  5. Click Ok on the Save Symbol dialog to save the symbol to the component file, and then close the Symbol Editor window.
  6. To update the instantiated symbols on the schematic, follow these steps:
    1. Select U1.
    2. Press and hold the Ctrl key while selecting U2.
      Result: Both symbols for U1 and U2 are selected:
    3. Right click to bring up the context menu, and select Restore Properties...
      Result: A dialog opens for you to confirm that you want to add the new properties to the instantiated symbols:
    4. Click Ok.
      Result: The schematic instances for U1 and U2 are updated with the new symbol properties PARAMETERS and SIMPLIS_TEMPLATE. The SIMPLIS_TEMPLATE property is hidden from view on the instantiated symbols:
  7. Press F9 to run the simulation.
    Result: The design simulates in SIMPLIS and two gain curves are output, one for each of the two filters. The pole frequency is 10kHz for both filters since the passed parameters are identical for both U1 and U2.
  8. Select U2 and press 5 to open the Edit Properties dialog.
  9. Change the PARAMETERS property to have FC=30kHz. The Edit Property dialog should appear as follows:
  10. Click Ok on both dialogs and run the simulation.
    Result: The blue output curve for the 30kHz filter now reflects the change to the FC parameter.

Discussion: Exercise #1

Using the single property method, you have passed the PARAMETERS property value to the subcircuit using the SIMPLIS_TEMPLATE property. This explicit passing of parameters is a good design practice and makes symbols and models easier to understand.

Advantages and Drawbacks of Single-Property and Multi-Property Methods

The single-property and multi-property methods have several advantages and drawbacks as itemized below:

Attribute Single-Property Multi-Property
Number of properties Only one symbol property needs to be added for any number of parameters. One property per parameter requires more work to define the symbol.
Symbol reusability One symbol can work for multiple models since the number and parameter type can vary. Symbols are customized to a model.
Editing speed with a dialog Fast - one property to define. Slower - multiple properties to define.
Ability to display individual parameters Not possible - all parameters are displayed at once in a long parameter string. Individual parameters can be displayed or hidden, which is a good reason to use the multi-property method.
Ease of manually editing the parameter values Poor - need to search through the string for the correct parameters. Easy - each property holds one parameter.

The multi-property method of parameterization is the recommended approach. Despite the extra work to define a multi-property symbol, the result provides a better user experience since individual symbol properties can be displayed or hidden.

When the number of parameters exceeds 50, the single-property method is recommended since the parameter-editing scripts can save the properties to the symbol faster after the you close the dialog.

Module Evaluation Form

At the end of the module, please fill out the Module # 5 Evaluation form.