new_title.gif

Extracting layers, flattening, renaming and merging with gdsfilt

The example on this page will show you how to take a complex GDSII file with multiple layers, extract each layer to a new file, flatten the output file, rename the top cell, and merging all the individual GDSII files to a new GDSII output file. The new file will have the same layers and same geometries but each layer will be flat and will be defined in a separate cell.

A user may decide not flatten the file, keep the cell names the same, and offset each layer so the layers will not overlap in the output file.
You can contact us for help in setting up the script file.

The script

We will use our sample file demo5.gds for this example and the script will work if you create it in the gdsfilt examples directory.
You can run the script in another directory but make sure to update the path in the script so it points to the correct location of the gdsfilt engine.

Syntax

../bin/gdsfilt demo5.gds demo5_1.gds = -i1 -explode
../bin/gdsfilt demo5_1.gds 1.gds = -rename 1.lst
../bin/gdsfilt demo5.gds demo5_2.gds = -i2 -explode
../bin/gdsfilt demo5_2.gds 2.gds = -rename 2.lst
../bin/gdsfilt demo5.gds demo5_3.gds = -i3 -explode
../bin/gdsfilt demo5_3.gds 3.gds = -rename 3.lst
../bin/gdsfilt demo5.gds demo5_4.gds = -i4 -explode
../bin/gdsfilt demo5_4.gds 4.gds = -rename 4.lst
../bin/gdsfilt demo5.gds demo5_5.gds = -i5 -explode
../bin/gdsfilt demo5_5.gds 5.gds = -rename 5.lst
../bin/gdsfilt demo5.gds demo5_6.gds = -i6 -explode
../bin/gdsfilt demo5_6.gds 6.gds = -rename 6.lst
../bin/gdsfilt demo5.gds demo5_7.gds = -i7 -explode
../bin/gdsfilt demo5_7.gds 7.gds = -rename 7.lst
../bin/gdsfilt 1.gds output.gds = -merge 2.gds 3.gds 4.gds 5.gds 6.gds 7.gds  
                      -combine TOP_OUTPUT_CELL TOP2 TOP3 TOP4 TOP5 TOP6 TOP7

Sample Rename File

The rename file has two entries per line. The first entry must match (exactly) the name of a structure in the input file. The second entry will be the new name in the output file. In this example we created a rename file for each layer we are extracting. Layer 2 will be saved in a file called 2.gds, and using the rename function, we renamed the top cell name in 2.gds to TOP2.
Here is how the rename .lst file look like.

asmsc37:hagai: $ cat 1.lst
TOP TOP1
asmsc37:hagai: $ cat 2.lst
TOP TOP2

Output

After running the script, we will get a few GDSII files.
We will get a GDSII file for each layer - the files will have the names 1.gds 2.gds 3.gds and so on.
We will also get the merged file which we called top.gds and its top cell name will be TOP_OUTPUT_CELL.