A.7.2 eval()

The Input Deck database can be told to evaluate an expression immediately while parsing. This can be done using the eval() function, e.g.,

ext a = 10;
ext b = 2;
c     = a * b;
d     = eval(c);                // evaluated to 20

In this example the variables a and b are declared as extern (see Section A.3) and can, therefore, be changed by the simulator. Both variables are initialized. The variable c contains a formula calculating the product of the variables a and b. Variable d immediately calculates the result of variable c and, from now on, stores a constant value. In contrast to variable c it does no longer depend on any other variable. Each time variable a or b is changed by the simulator variable c will change automatically while variable d remains unchanged and keeps its initialization value calculated once while parsing.

Robert Klima 2003-02-06