Next: Built-In Design Rules
Up: The DRC Menu: Design
Previous: The DRC Menu: Design
Contents
Index
Layer Expressions
Many of the design rules, extraction specifications, and commands make
use of ``layer expressions''. These expressions are used to signify
regions of the layout where certain combinations of layers (or absence
of layers) exist. A layer expression consists of a logical
expression, in the format recognized by the script parser used to
evaluate script files.
The expression may contain layer names, functions from the list below,
operators from the table below, numeric constants, and parentheses to
enforce precedence. In its simplest form, a layer expression is a
layer name, which can be thought of as a list of regions corresponding
to the dark areas (boxes, polygons, and wires) of that layer. A
numeric value of zero represents emptiness, and a nonzero value
represents full coverage.
If the names of any defined layers are numeric values, one must be a
little careful when specifying the equivalent numeric value, since a
layer name interpretation will supersede a numeric interpretation.
For example, in the presence of a layer named ``1'', one could use
``1.0'' to specify the number 1. A four-digit hex number is always
assumed to be a layer name, even if a layer of that name does not
presently exist. This is necessary so that when reading the
technology file, layer expressions can reference layers with numerical
names (likely from GDSII conversion) that have not yet been defined.
Layer names in the ``decimal'' format must be double quoted, e.g.,
"22,0".
The following operators are accepted in layer expressions:
& or * |
intersection |
| or + |
union |
! |
inversion |
^ |
exclusive-or |
- |
and-not, i.e.,
A - B = A&!B |
and |
synonym for & |
or |
synonym for | |
not |
synonym for ! |
Parentheses can be used to enforce precedence.
The expression returns an internal data structure representing those
regions of the current cell where the expression is true, i.e., where
the layers exist with the given logic.
There is a special layer named ``$$'' which logically consists of
boxes covering each of the subcells in the current cell.
The !layer command can create a new layer from a layer
expression, and is therefor a good vehicle for experimenting with
layer expressions.
The tokens are interpreted as they would be in an ordinary expression
involving numbers, thus their precedence might not be quite as
expected in layer expressions. For example
!layer CAA = !CAA & $$
and
!layer CAA = !CAA * $$
are not equivalent. The latter expression is equivalent to
!layer CAA = !(CAA & $$)
since `*' has higher precedence than `&'. The equivalent expression
is
!layer CAA = (!CAA) * $$
(recall that `$$' is the name for an internal layer consisting of
subcell bounding boxes).
The following function calls are supported in layer expressions. Only
the functions listed below are available, and all return a layer
expression object.
- bloat(real incr, layer_exp layer,
int mode)
This expands the features on the layer by incr (in microns),
which may be negative. The effect is similar to the !bloat
command and the BloatZ script function.
- edges(real incr, layer_exp layer,
int mode)
This creates an edge list, similar to the EdgesZ script function.
- manhattanize(real dimen, layer_exp layer)
This converts the representation to a Manhattan approximation. The
first argument is the minimum width or height in microns of rectangles
that are created to approximate the non-Manhattan parts. This is
similar to the !manh command, and to the ManhattanizeZ
script function.
- box(real l, real b, real r,
real t)
This defines a rectangular region from the four real arguments, which
can be used for clipping or construction in layer expressions. The
coordinates are given in microns. This is similar to the BoxZ
script function.
- zoid(real xll, real xlr, real yl,
real xul, real xur, real yu)
This defines a horizontal trapezoid region from the six real
arguments, which can be used for clipping or construction in layer
expressions. The coordinates are given in microns. This is similar
to the ZoidZ script function.
- geomAnd(layer_exp lyr1 [, layer_exp lyr2])
If one argument is given, the result is the overlapping parts of
regions in the internal list corresponding to the argument. This is
only useful if the argument was explicitly constructed with geomCat (see below). With two arguments, this is equivalent to the
intersection operator. The function is similar to the GeomAnd
script function.
- geomAndNot(layer_exp lyr1, layer_exp lyr2)
This is equivalent to the and-not operator, and is similar to the GeomAndNot script function.
- geomCat(layer_exp lyr1, ... )
This takes one or more layer expression arguments and simply
concatenates the regions, without any merging or clipping, similar to
the GeomCat script function.
- geomNot(layer_exp lyr)
This is equivalent to the inversion operator, similar to the GeomNot script function.
- geomOr(layer_exp lyr1, ...)
This takes one or more layer expression arguments and returns the
union, constructed internally so that no two regions overlap. This is
similar to the GeomOr script function.
- geomXor(layer_exp lyr1 [, layer_exp lyr2])
If one argument is given, the return is the set of regions where there
is no overlap between regions represented by the argument. This is
only useful if the user has explicitly constructed the argument using
geomCat. If two arguments are given, the result is the
exclusive-or of the areas, equivalent to the exclusive-or operator.
This function is similar to the GeomXor script function.
Examples:
!layer M2 = M2 & box(100, 100, 200, 200)
This clips M2 to the given box.
!layer M2 = bloat(5, M2)
This bloats the M2 geometry by 5 microns.
Next: Built-In Design Rules
Up: The DRC Menu: Design
Previous: The DRC Menu: Design
Contents
Index
Stephen R. Whiteley
2006-10-23