GlobalVar()

In both SIMetrix and SIMPLIS mode, the GlobalVar() function allows you change parameter values. When you place a GlobalVar() function in a testplan, the variable statement is automatically written to the simulator command (F11) window.

Important: The GlobalVar() function parametrizes at all levels of the hierarchy. While this feature of the function is convenient, it can be dangerous. Global variables take precedence over any variables defined locally at the hierarchical component level. If you use the GlobalVar() function, make certain the variables being defined are not overwriting any local variables.

In this topic:

GlobalVar() Syntax

The GlobalVar() function has the following syntax:
GLOBALVAR(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