Merging Multiple GDSII files using GDSFILT

Artwork's GDSFILT utility can be run directly from a command line on UNIX, Linux and Windows. This note demonstrates how to merge multiple files into one. Combining two or more GDSII files requires a certain care and understanding of the hierarchy since cell (structure) name collisions could cause undesirable effects in the output file.

Example 1

Merging two Different Files with No Offset

Consider the case where we have two different GDSII files and we wish to combine them and we do not need or desire to modify or transform the coordinates in any way.

Input  1     CHIP_D123.GDS
Top Cell      D123
Layers        1 = Well
              2 = Active
             

Input  2     DRACULA_OUTPUT.GDS
Top Cell      OUT_D123
Layers        50 = P+ 
              51 = Poly
              53 = Contact
              54 = M11


Output       CHIP_D123_FINAL.GDS
Top Cell      D123_FINAL containing
              place D123     at 0,0
              place OUT_D123 at 0,0

Here is the command line you will need to use with the "add" option. The command line is shown with breaks for clarity on this web page but there are no breaks in the actual command line. Text in italics is not part of the command line


gdsfilt                                executable

 CHIP_D123.GDS                         input file

  CHIP_D123_FINAL.GDS                  output file

   D123                                top structure of input

    -add DRACULA_OUTPUT.GDS            file to be added

      -combine D123_FINAL OUT_D123     use combine mode to place
                                       OUT_D123 under D123_FINAL
                                       

Here is the command line but using the -merge instead of -add


gdsfilt                                executable

 CHIP_D123.GDS                         input file

  CHIP_D123_FINAL.GDS                  output file

   D123                                top structure of input

    -merge DRACULA_OUTPUT.GDS            file to be merged

      -combine D123_FINAL OUT_D123     use combine mode to place
                                       OUT_D123 under D123_FINAL
                                       

Difference Between add, blend and merge

The difference between "merge", "add", and "blend" is significant.

    With the -add option the input cell names are going to be appended with _0, the cell names in the second file will be appended with _1. In the final output file the cell data from all input files added is preserved; There is no "collision" between cell names.

    The -merge option works under the assumption that if cells have the same name, the data in them is the same. There is no renaming of cells in the output file. Since there can be only one definition per cell, the initial input file's defintions will be used if the merged files contain duplicate definitions.

    The -blend option works under the assumption that if cells have the same name, the same cell data will be blended in the output file. There is no renaming of cells in the output file. For example, if cell A contains 5 polygons in file1 and same cell A contains 10 polygons in file2, then cell A in the output file will have 15 polygons.



Example2

Merging Multiple Files With an Offset

Consider the case where you have a GDSII file and you wish to create a 2 x 2 array (say for creating a reticle). We will use one of Artwork's standard demo files (demo1.gds) and step it into a 2 x 2 array. In order to do this we must introduce an offset into each placement in the final output file.

desired array for reticle ...

The output file name will be "reticle.gds" and the top cell in the output file will be called "2X2ARRAY". Under 2X2ARRAY will be 4 instances of the data in DEMO1.GDS.

demo1.gds showing data extents

Calculating the Offsets

    Some fancy math (OK, some simple arithmetic) is needed to calculate the desired insertion point for each instance of demo1.gds since it is not centered about 0,0. The reticle extents should be centered at 0,0 and the center of demo1.gds is at 115.25,138.75.

    Therefore the insertion points, taking into account a street width of 30 um are:

    Quadrant   Center of Quad     After demo1.gds offset
    --------   ---------------    ------------------------
      I         148.75, 153.75       33.50,  15
     II         148.75,-153.75       33.50, -292.50
    III        -148.75,-153.75     -264.00, -292.50
     IV        -148.75, 153.75     -264.00,  15

    Here is the command line. Once again, it is all one line but broken here so it can be annotated. Text in italics is not part of the command line but a short explanation of the line's argument.


 gdsfilt                                   gdsfilt exec

  demo1.gds                                input gdsii file

   reticle.gds                             output gdsii file name

    LG1W0R1S0                              top cell name of demo1.gds 

     -merge demo1.gds demo1.gds demo1.gds  merge these files with 
                                           input file

      -combine 2X2ARRAY                    combine using this as top level 
                                           cell in output

       LG1W0R1S0 LG1W0R1S0 LG1W0R1S0       top cells of the merged files

        -offset 36,7.5                     offsets used for each insertion
                36,-285
               -256.50,-285
               -256.50,7.5

If you have done everything correctly you should have a reticle as shown below:




Example3 - Merging files with -prefs : Secondary file includes cell defintions.

In this example the main file (first on the command line) includes the top level data with cell insertion points but no cell definition in the main file.
The merged files (second and after) include the cell definitions which we want to add to the top level data file.
To do that we will still use the -merge option but we will add also the -prefs option.
This option will preserve the references in the main file and redefine the empty definitions in the top level file with the definitions in the secondary files.


GDSFILT Page   |   Download   |   Revision History   |   Price


ARTWORK CONVERSION SOFTWARE, INC.       Company Profile
417 Ingalls St., Santa Cruz, CA 95060    Tel (831) 426-6163     Fax 426-2824    email: info@artwork.com