next up previous contents index
Next: Technology File Global Variables Up: Technology File Macros Previous: The Set Keyword: Variable   Contents   Index

The eval Keyword: Expression Evaluation

An expression involving integers or floating point numbers can be evaluated as the file is read, with the result inserted into the line at the place of evaluation. This facilitates, for example, the use of design rules based on the lambda concept. In this type of rule set, design rules are specified in terms of a minimum dimension lambda. The lambda may vary between different process implementations. In the technology file, lambda is defined as a macro, and inputs to the design rule specifications is evaluated in terms of lambda.

The syntax for expression evaluation is eval(expression). This construct can occur anywhere in the text, although it makes sense only where a number is expected. The result of the evaluation is substituted into the text replacing the eval construct, before that line of the technology file is interpreted. The expression is interpreted by the parser otherwise used for interpreting command scripts, and the full complement of operations and functions is available. Macros are expanded before the expression is parsed.

Example:

Set lambda = .6
...
PhysLayer BASE
MinWidth eval(2*$(lambda)) #Minimum width of the BASE layer is 2*lambda

In this example, the parameter lambda is defined to ``.6'' with the Set keyword. Elsewhere in the file, design rules can be specified as functions of lambda using the eval construct, as shown.

Example:

Set lambda = .6
Define L(x) eval($(lambda)*x)
...

PhysLayer BASE
MinWidth L(2) #Min width of BASE layer is L(2)

In this example, the macro L(x) is used to hide the call to the evaluation function, simplifying syntax.

If the technology file is updated to disk using the Save Tech command button, only the macros used in the design rule keywords will be preserved in their original macro form in the new file. Elsewhere, the written lines will contain the expanded quantity. All of the Set and Define lines will be preserved. Thus, the use of macros should be restricted to the design rule keywords, unless the user is willing to hand edit the new files produced with the Save Tech command.


next up previous contents index
Next: Technology File Global Variables Up: Technology File Macros Previous: The Set Keyword: Variable   Contents   Index
Stephen R. Whiteley 2024-09-29