Var()

The Var() function has a slightly different result depending on whether you are running In SIMPLIS or SIMetrix mode.

  • In SIMPLIS mode, the Var() function automatically inserts the following into the F11 window:
    .VAR variablename value
  • In SIMetrix mode, the Var() function inserts .PARAM instead of .VAR into the F11 window as shown below:
    .PARAM variablename value
Note: The VAR() function parametrizes only the top-level circuit and lower levels of the hierarchy remain unaffected.

In this topic:

Var() Syntax

The Var() function has the following syntax:
VAR(variable_name, value)
  • The variable_name is the parameter that you want to change.
  • The value argument indicates the value you want to assign to that variable.

▲ back to top

Inline vs. Header Row Function Behavior

The Var(), GlobalVar(), Change() and Temp() functions behave differently depending on whether they are used inline or in a header row.

  • When used inline, Var(), GlobalVar(), Change(), and Temp() perform the actions described above.
  • When used in a header row, value is interpreted to be the default as listed in the header row and is used if the test has no value in its column.

    For example, the following testplan with a header row performs the actions listed below:

    1 *?@ Var(MAX_Q,1n) GlobalVar(VIN,12) Change(U1.U3.GAIN,1)
    2 2n    
    3   5.0  
    4     0.5
    • The test on line 2 sets the variable MAX_Q  to 2n based on the value in line 2. Because columns 2 and 3 on line 2 are empty, the global variable VIN to 12 and the GAIN property on U1.U3 is change to 1.
    • The test on line 3 sets the global variable VIN to 5.0. Because columns 1 and 3 on line 3 are empty,  MAX_Q  is set to 1n and the GAIN property on U1.U3 is changed to 1.
    • The test on line 4 changes the GAIN property on U1.U3 to 0.5. Because columns 1 and 2 on line 4 are empty, MAX_Q  is set to 1n sets VIN is set to 12.

▲ back to top