Product Documentation
Virtuoso ADE SKILL Reference
Product Version IC23.1, November 2023

maeGetVar

maeGetVar(
t_varname
[ ?typeName t_typeName ]
[ ?typeValue t_typeValue ]
[ ?session t_sessionName ] 
)
=> t_value / nil

Description

Returns value of the given variable. Use this function to get the global, test-level, or corner value for the given variable.

Arguments

t_varname

Name of variable.

?typeName t_typeName

Type of the variable.

  • test: Specifies that the variable value is to be returned for the given test. This is the default.
  • corner: Specifies that the variable value is to be returned for the given corner.

?typeValue t_typeValue

Name of the corner or test for which the variable value has to be returned.

  • Global: Returns the global value of the given variable. This is the default.
If the value for this argument is set to Global when the type name is set to corner, an error is displayed.
  • TestName: Returns the variable value for the specified test.
  • CornerName: Returns the variable value for the specified corner.

?session t_sessionName

Name of the session.

If not specified, the current session is used.

?expanded g_expandedValue

If the given variable is assigned a swept value or a range, expands and returns a list of values.

The default value is nil.

?resolved g_resolvedValue

If the value of the given variable is an expression, resolves the expression and returns its resulting value.

The default value is nil.

Value Returned

t_value

Value of the given variable.

nil

When the given corner, test, or variable is not found in the setup.

Examples

Returns the value of global variable vdd in a cellview:

sess=maeOpenSetup("opamp090" "full_diff_opamp_AC" "maestro" ?mode "a")
=> "session0"
maeGetVar("vdd") => 2.2 maeGetVar("vdd" ?typeName "test" ?typeValue "Global") => "2.2" maeGetVar("vdd" ?typeName "test") => "2.2"

Expands the swept values for a variable and returns a list.

Vdd = 1:2:10
maeGetVar("vdd" ?expanded t)
=> ("1" "3" "5" "7" "9")

Returns a list of values extracted from the given range for a variable.

Vdd = {From/To}Linear:50u:5u:100u{From/To}
maeGetVar("vdd" ?expanded t)
=> ("50u" "55u" "60u" "65u" "70u" "75u" "80u" "85u" "90u" "95u" "100u")

The scalars, sweeps, and VAR returns the resolved results. The function recognizes the type of the variables (global, test design variable, local override) and returns the corresponding values.

Returns local overridden value of nn in test AC.

nn = VAR("mm")
maeGetVar("nn" ?typeName "test" ?typeValue "AC" ?resolved t)
=> "1"

Returns global value of nn in the setup.

maeGetVar("nn" ?typeName "test" ?typeValue "Global" ?resolved t)
=> "2"

Resolves the value assigned through a variable.

nn = VAR("vdd")
vdd = 1.3 1.4 1.5
maeGetVar("nn" ?resolved t) = "1.3 1.4 1.5"
nn = VAR("myExpr")
myExpr = if(VAR("myNum") == 20 then 1 else 0)
maeGetVar("nn" ?resolved t) = "if(VAR(\"myNum\") == 20 then 1 else 0)"

Resolves the basic arithmetic operations in variable values if the related expressions do not depend on design points.

nn = VAR("mm")+2
mm = 8
maeGetVar("nn" ?resolved t)
=> "10"

Returns original expressions if they depend on the design points generated during simulation.

mm = VAR("nn")+2
nn = 8 9 10
maeGetVar("mm" ?resolved t)
=> "VAR(\"nn\") + 2"
mm = calcVal(Voffset, \"AC\")
maeGetVar("mm" ?resolved t)
=> "calcVal(Voffset, \"AC\")"

Return to top
 ⠀
X