Batch convert CIF to GDS

edited August 2012 in General
Hi

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: http://klayout.de/forum/comments.php?DiscussionID=173&page=1#Item_0

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.

Thanks

Comments

  • 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 = RBA::Layout.new
    ly.read($input)
    ly.write($output)
    

    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,

    Matthias

  • edited November -1
    That works great! Thanks!
  • edited November -1
    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 November -1

    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.

    Matthias

Sign In or Register to comment.