In order to facilitate customization of the technology file to different variations, in particular to support scalable technology, a macro facility is provided, along with an expression evaluator. Macros can be used to simplify or clarify the constructs used in the technology file, and facilitate portability by effectively customizing the technology file to different environments.
The macro capability makes use of the generic macro preprocessor provided in Xic, which is described in 18.1. The reader should refer to this section for a full description of the preprocessor capabilities. The preprocessor provides a few predefined macros used for testing (and customizing for) release number, operating system, etc. The keyword names, which correspond to the generic names as described for the macro preprocessor, are case-insensitive and listed in the following table.
Keyword | Function |
---|---|
Define | Define a macro. |
If | Conditional evaluated test. |
IfDef | Conditional definition test. |
IfnDef | Conditional non-definition test. |
Else | Conditional else clause. |
Endif | Conditional end clause. |
A macro definition can appear anywhere in the technology file. Throughout the technology file, each line is macro expanded. The actual arguments replace the formal arguments (if any) in the substitution text, which replaces the macro reference. The macro is recognized as a text token.
Example:
Define mytext(x) this is rule number x
...
MinWidth 2 # mytext(1.2)
The MinWidth line expands to
MinWidth 2 # this is rule number 1.2
The conditional keywords provide tests which can be used to select which lines of the technology file are actually read, based of the settings of existing macros and/or expression evaluation. The logic is explained in the description of the generic macro preprocessor.
Example:
Define TightRules
...
Layer M1
IfDef TightRules
MinWidth .4
Else
MinWidth .8
Endif
In the example above, commenting out the Define line
#Define TightRulesreconfigures the technology file.
When the technology file is updated with the Save Tech command, only the lines that were actually processed are written, i.e., the IfDef, etc. lines and unused blocks are stripped.