next up previous contents index
Next: Examples Up: Layout Editing Previous: The !array Command: Manipulate   Contents   Index


The !layer Command: Generate Layers

Syntax: !layer [join|split|splitv] [-j | -s[h] | -sv] [-d depth | -da] [-r] [-c] [-m] [-f] layer_name [=] [expression]
This command produces new geometry on a new or existing layer, by applying a layer expression which takes as input geometry from the same or other layers, from the current cell or from other cells in memory. The Layer Expression button in the Edit Menu provides a panel which duplicates the functionality of this command.

This new geometry can appear as an assemblage of trapezoids if either of the split or splitv keywords is given, or alternatively as a minimal number of complex polygons if the join keyword is given instead. If splitv is given, a vertical orientation is favored for the decomposition, whereas similarly split will produce a decomposition favoring a horizontal orientation. The default is the joined form if none of these optional keywords is given, except when simply copying from another layer in which case the default is to copy objects without change. The keyword ``splith'' is a synonym for ``split''. The options -j, -s or -sh, and -sv are equivalent to giving the join, split, and splitv keywords.

The !layer command, when using boolean operations, uses gridding to improve efficiency for large data sets. Internally, a square grid with origin at the lower-left corner of the cell bounding box is logically defined. The calculations are performed for each grid square that overlaps the cell area, and the results are combined. This can be more efficient that calculating the whole cell in one shot.

The default grid size is 100 microns square, which can be changed with the PartitionSize variable. This can be set to an alternate grid size in microns, as a floating-point number. The cell lower left corner is on the grid boundary. The operations are performed piecewise in each grid area that intersects the cell.

If this variable is set to ``0'', no grid is used, and operations will be performed over the entire cell at once.

The PartitionSize variable can be set with a control in the Evaluate Layer Expression panel from the Layer Expression button in the Edit Menu, or with the !set command.

When joining objects, there are several variables which fine-tune the operation. See the description of the !join command (19.13.13) for information.

If layer_name does not exist in the layer table, it will be created. Otherwise, the layer_name is the short or long name of an existing layer. If a new layer is created, its name is generated from the given name in the same way as in the technology file layer definitions.

The expression, if given, involves layer names and operators as in the DRC layer expressions (see 15.1). The result of the expression is created on layer_name. Thus, this command provides a means of creating a new layer from geometry on existing layers. It operates on the physical part of the current cell. Labels are ignored. The same layer_name can exist on both sides of the expression, in which case the contents of the layer_name is replaced with the result of expression. The equal sign between layer_name and expression is optional.

If no expression is given, the new layer will be created if necessary, which will be the only effect if done. If the layer_name already exists, and one of the split, splitv, or join keywords is given, the operation will be applied to that layer, much like the !split and !join commands.

If the expression consists of a layer name only, the objects on that layer will be copied to layer_name, and split/joined if the keywords are given. When simply copying and/or joining/splitting, no grid partitioning is used.

Copying and splitting/joining are available in electrical mode. Other operations require running the !layer command in physical mode, and apply to physical data.

There are several option flags which can be given. These must appear before layer_name in the command line. The options can be given separately as shown in the syntax example above, or grouped, e.g., ``-dmf depth'' is equivalent to ``-d depth -m -f''. Any combination of grouped or single flags can be used. If a group contains `d', the token that follows must be the depth.

-j
Equivalent to giving the join keyword.

-s or -sh
Equivalent to giving the split keyword.

-sv
Equivalent to giving the splitv keyword.

-d depth, -da
The depth is a non-negative integer indicating the depth into the cell hierarchy to process. It can also be a word starting with the letter `a' to indicate all levels. If 0 (the default) only objects in the current cell are processed. If ``all'', all objects in the hierarchy may be used to generate the new objects, effectively flattening. The -da variation is equivalent to ``-d all''.

-r
This applies when the depth is larger than 0. When given, the expression is evaluated in all cells in the hierarchy to depth, using only objects in that cell and creating objects in that cell. This is very different from the behavior without this flag given, which is to create all objects in the current cell.

-c
By default, layer_name is cleared before the expression is evaluated, so that the layer contains only the result of the operation on command completion. If this flag is given, the layer will not be cleared, so that the original objects will be retained on the layer.

-m
When this flag is set, objects added to layer_name will be merged with existing objects, using the same merging as established with the Merge new boxes and polys with existing boxes/polys and Clip and merge new boxes only, not polys check boxes in the Editing Setup panel from the Edit Menu, or the corresponding variables. Use of full polygon merging can greatly increase processing time, simple box clipping/merging has much lower overhead. Merging may reduce the object count in the layout.

The merging will defeat the purpose of the split keywords, so the user should consider whether merging is appropriate. Merging includes the initial objects on the layer_name if it is not cleared, and the accumulated objects as evaluation takes place.

-f
This flag indicates ``fast'' mode, where undo list generation and any merging (other than a join operation) are skipped. This operation is not undoable, so this option should be used with care. It speeds processing and reduces memory use.

The user will be prompted to confirm before the operation is actually initiated.



Subsections
next up previous contents index
Next: Examples Up: Layout Editing Previous: The !array Command: Manipulate   Contents   Index
Stephen R. Whiteley 2022-05-28