Batch convert CIF to GDS

edited August 2012 in General

I have a large number of CIF files which I need to convert to GDS. I can open each one and File > Save As > ___.gds, but would like to do this in batch mode.

I found this description of how to open GDS files and save as DXF, in batch manner:

However the script that Matthias gives there doesn't seem to work for GDS->DXF, let alone for CIF->GDS. (I get an error message saying it can't open the GDS file, however it is a valid and simple GDS file.

Can anyone tell me how to batch convert CIF -> GDS? I'm a newbie so please go easy.



  • edited September 2012

    Hallo David,

    there may be numerous reasons why the script is not working which I can't figure out without details.

    However the the CIF->GDS conversion there is a simple solution if you work on Linux: if you build KLayout, it will create a couple of executables, mainly intended for test purposes. One of them is "strm2gds" which converts any format known by KLayout to GDS:

    strm2gds input.cif output.gds

    On Windows, these binaries are not included into the installation kit yet. You can however use a very simple script to perform the conversion

    ly =$input)

    Save these three lines to a file, i.e. called convert.rb and run KLayout as the execution engine for the script, defining $input and $output on the command line to contain the file names:

    klayout -rd input=input.cif -rd output=output.gds -r convert.rb

    The script will determine the output format from the output file name (i.e. ".gds" will give GDS). Basically it does exactly what "strm2gds" does.

    Best regards,


  • edited 12:17AM
    That works great! Thanks!
  • edited 12:17AM
    Note to future readers: Just remove the ./ from the final line of Matthias's command above, for it to work on a Windows environment
  • edited 12:17AM

    Hi David,

    thanks for that hint. I just copied and pasted my command line, but of course the binary usually is located in the path. I already edited my comment.


Sign In or Register to comment.