next up previous contents index
Next: Examples Up: The Edit Menu: Edit Previous: The Join/Split Button: Join   Contents   Index


The Layer Expression Button: Evaluate Layer Expression

The Layer Expression button in the Edit Menu brings up the Evaluate Layer Expression panel. Layer expressions are logical expressions referencing the geometry on existing layers, with various operators and functions. These evaluate to a pattern, which can be applied to a new or existing layer. Operations include polarity inversion, intersection, union, and many more complex possibilities.

The Evaluate Layer Expression panel allows layer expressions to be applied to the current cell hierarchy, much the same as the text-mode !layer command. The panel allows easy setting of variables which control the expression evaluation, whether initiated from the panel or the !layer command.

Full layer expression evaluation is available in physical mode only, though joining, splitting and copying are available in either mode.

The controls found in the Evaluate Layer Expression panel are described below.

To layer
This entry area requires the name of a layer on which new geometry will be created while the layer expression is evaluated. This is the only control in the panel that requires an entry. If the layer name does not match an existing layer name (as a short or long name), a new layer is created, with a name generated from the given name in the same way as in the technology file layer definitions.

If no expression is given, the To layer is created, if it does not exist. If the layer exists, and one of Joined, Horiz Split, or Vert Split is set, that operation will be performed on the To layer. The result is similar to the corresponding operations as initiated form the Join or Split Objects panel from the Join/Split button in the Edit Menu, or the !join and !split commands. If the To layer did not previously exist, or the Default new object format is selected, layer creation is the only operation performed.

Depth to process
When the layer expression is evaluated, the layer geometry used in the processing is obtained to this level in the hierarchy. If 0, only the geometry in the present cell is considered. If ``all'', the geometry of the complete hierarchy is taken.

Recursively create in subcells
This check box has effect only if the Depth is not zero. When checked, the layer expression is evaluated in the current cell and each subcell to depth, using only the objects from that cell. If this is unchecked, the operation is quite different. In this case, there is no recursion, and all new geometry is created in the current cell, but geometry in cells to depth is considered when creating the new geometry.

Partition Size
To maximize computation speed, the expression evaluation is performed step-wise over a logical grid in the target cell. The grid origin is the lower-left corner of the cell. The partition size is the width of an (assumed square) grid cell. The calculations are performed for each grid square that overlaps the cell area. This can be more efficient than calculating the whole cell in one shot (which might not even be possible due to memory limitations).

The gridding is used only if an actual expression is given, and not simply a layer name (or no expression at all). If the expression consists only of a layer name, processing requires only a simple copy and there would be no reason to use partitioning.

If the None button is pressed, no partitioning will be used.

The default partition size is 100 microns, which can be adjusted for best performance. The size should be large enough to minimize the number of grid cells to evaluate, but small enough to limit the amount of geometry to process on average in each grid, to avoid huge memory consumption and other ill effects of taking too big of a ``bite''.

For simple cells, the grid size can be large, or partitioning can be skipped entirely. Partitioning can be skipped by pressing the None button, or by setting the size to a value larger than the cell bounding box width and height.

This entry tracks the state of the Partition Size variable, which is also used by the !layer command and elsewhere.

Number of helper threads
PRELIMINARY. EXPERIMENTAL!

Multiple threads can be used when evaluating a layer expression over a grid. Evaluation in each of the grid cells can be done in parallel, so these jobs are submitted to the thread pool. This allows processor cores to work simultaneously on different parts of the grid.

Multi-threading will be used if this entry is set nonzero. The value is the number of helper threads that can be called upon to parallelize the operation. The speediest value is probably one less than twice the number of available processor cores, as each Intel core provides two hardware threads. Your results may differ, so one should experiment. One can also experiment with the partition size to get fastest results, larger partitions are more likely to overcome the multi-threading overhead.

This should not be set to a value larger than the number of available hardware threads minus one, but one might wish to try smaller values. If set to a larger value, software threads will be used, which will increase computation time. If set to 0, the operation is single-threaded.

This entry tracks the value of the Threads variable.

Don't clear layer before evaluation
By default, the layer given in the To layer entry is cleared before the expression is evaluated, so that the layer will contain only the result of the operation. It this check box is set, the To layer will not be cleared, new data will appear in addition to existing data.

New object format
This consists of four interlocking ``radio'' buttons which establish the nature of the new objects created by evaluating the layer expression. If Joined is selected, objects will be combined into polygons before being added to the cell. If Horiz Split is selected, objects are added as trapezoids, with a horizontal orientation (maximal width) favored. If Vert Split is selected, objects will also be added as trapezoids, however a vertical orientation (maximal height) is favored.

The Default choice has the same effect as Joined in cases where the layer expression contains more than a layer name, i.e., it contains at least one operator, function, or numeric entry. If the expression consists of a layer name only, the Default choice will read the objects from that layer and add them to the To layer, without modification. The other new object format choices will cause the objects read from the layer to be joined or split before being added to the To layer.

When joining objects, there are several variables which fine-tune the operation. These are most conveniently set from the Join or Split Objects panel brought up by the Join/Split button in the Edit Menu.

Expression
This entry area contains the layer expression to evaluate. This is an expression consisting of existing layer names, operators, and function calls, which will be evaluated. Dark areas will be rendered on the layer given in the To layer entry.

Thus, this provides a means of creating a new layer from geometry on existing layers. Labels are ignored during processing, but all other objects contribute. The same layer name can appear in the To layer entry and in the expression, in which case the contents of that layer is updated with the result of the expression.

There are eight registers which can be used to save and recall layer expression strings, for convenience. The Save and Recall buttons provide access to these registers. Selecting an item in the Save menu will save the current contents of the Expression entry in that register. Selecting an item in the Recall menu will load that text into the Expression entry area.

Use object merging while processing
When this check box is set, new objects created during evaluation of the layer expression will be merged with existing objects, using the same object merging as specified in the Editing Setup panel from the Edit Menu.

If there is no Expression given, or the expression consists only of the same layer name given in To layer, then merging is not performed.

In every other case, the merging enabled from the Edit Menu will be performed as new objects are added to the To Layer. This merging will defeat the purpose of the join and split format choices, so one must consider when merging makes sense. Merging applies to objects initially on the To layer, if not clearing, plus the accumulated objects added as the operation progresses.

Full polygon merging can greatly increase the time and memory required to process a large job. Box clipping has much less overhead.

Fast mode
When set, undo list processing and object merging will be skipped, which reduces memory use and computational overhead to a minimum. However, the operation can not be undone, so this mode should be used with care.

Evaluate
Pressing this button will create the To layer if necessary, evaluate the layer expression, and add the newly created geometry to the current hierarchy.



Subsections
next up previous contents index
Next: Examples Up: The Edit Menu: Edit Previous: The Join/Split Button: Join   Contents   Index
Stephen R. Whiteley 2024-09-29