Clipextract - Clip Extraction Library

Clip Extraction with Logical Layer Operations

Recently Artwork was asked about the possibility of adding logical layer operations (AND, OR, XOR, MINUS) to the Clipextract application. The need for such operations is common - process layers may now include two masking where one consists of parallel lines and the second consists of "cuts" across those lines.

So we've added additional code that enables such layer operations.

 

Command Line Syntax

Download

flow for clip and logical operations

1. Start by opening a multi-layer GDSII file and load the layers we wish to process. This only needs to be done once.

2. A call is made to the explode function. We pass it the coordinates of the window we wish to clip out. The exploder extracts all the polygons that cross this window and puts them into memory. Each polygon is "tagged" with its layer.

3. We want to perform a MINUS operation between layers 1 and 2. To do this the polygons belonging to Layer 1 are extracted and placed into an array and the polygons belonging to Layer 2 are placed into a second array. Then the QisBool is called to perform the MINUS operation. The results are stored in a 3rd array (we call INT for Intermediate).

4. Now we want to perform an XOR between the intermediate results (INT) and Layer 3. The polygons for Layer3 are extracted from the exploder's buffer.

5. Now that we have our two input arrays we call QisBool a second time to perform the XOR operation. The results are stored in an array. At this point, the data can be saved as a GDSII file or processed by the client as desired.

To process the next clip, a call is made to the exploder to extract a new set of polygons and the process is repeated.



Example - Extracting 1000 Clips with Layer Operations

We have a source GDSII file called caw_test1.gds that is about 1.4 GByte in size and has quite a few layers. caw_test1.gds - 5350 x 5200 um

Let's suppose that we wish to extract 1000 clips (randomly assigned) of 20 x 20 um. We want to perform the following layer operations:

6 [OR] 17 -> 100

100 [MINUS] 30 -> OUTPUT CLIP


Our computer has 8 CPU cores.


Here is how our command line might look (CR between arguments for clarity only)


clipextract64.exe                  executable

+input:caw_test1.gds               input file to process
 
+outdir:D:\cad\clips               output directory to place clips

+format:POLYS                      output format is polygon (as opposed to bitmap)1

-thrnum:8,1                        8 exploder threads - 1 Boolean thread per exploder2

-layers:6,17,30                    load only data on these layers3 
 
@window:CWH:test:D:\cad\wins.txt   read the file, wins.txt for the clip windows4  

"-lsynth:100:0=6,17-30"            Layer Boolean operations5

-clip                              clip the output polygons to the window6
 
-log:D:\cad\clips\test.log         write to the log file test.log


Notes

1  +format:POLYS will result in synthesized polygons being generated but not written to disk. We do this when testing throughput in order to remove disk IO from the measurement.


2  -thrnum:8,1 will allocate 8 exploder threads, each using only 1 thread for Boolean operations (assuming a machine with 8 logical cores). This setting produced the fastest times as expected. Why? Because the number of polygons that the Boolean needed to process in each clip was relatively low so additional Boolean threads would not have improved the throughput.


3  -layers:6,17,30 instructs Clipextract to only load these 3 layers. By not loading the other layers present in the GDSII file, we reduce the memory footprint and quad tree computations.


4  @window This argument tells clip extract to load a file of clips - the width and height are defined at the beginning of the file and each line thereafter represents a center coordinate of the clip window.


5  "-lsynth:100:0=6,17-30" This argument controls the layer logical operations. The target layer is 100:0 (layer:datatype). This is produced by merging layers 6 and 17 and then subtracting layer 30.

Note that the comma (,) betweeen layers 6 and 17 means that we are merely merging all the polygons onto a single layer and not unionizing them. It would be a waste of computation to unionize them since the next Boolean operation, MINUS, requires an implicit Union.


6  -clipensures that synthesized polygons are clipped to window extents.



Download Documentation Revision History Benchmark Licensing Price