Cadence techfile import script

edited June 2011 in KLayout Support

Hi all,

triggered by several recent requests I have started to implement a Cadence techfile import script.

The script can be found here. It can be saved as import_tf.rbm into KLayout's installation folder (on Unix don't forget to set $KLAYOUTPATH to that folder).

It will install a new menu item in the "File" menu (above "Load Layer Properties"): "Import Cadence Techfile". When run, this function will first ask for the file name of the Cadence ASCII techfile and then try to locate a *.drf file there. If that fails, it will ask for the path to the *.drf file.

The script clears the layer list and creates a new one from the tech file settings. Only layers with a stream layer and datatype mapping are produced currently.

The script is just a first try. Please give feedback (preferably by mail) if you have problems reading your techfiles.

Best regards,

Matthias

Comments

  • edited 3:11AM
    Hi Matthias,

    Thanks for your effort on developing the Cadence techfile import script, I tried to save this script to a directory and load it when klayout startup, it responsed a Ruby error message "no such file to load -- stringio", the detail command messages are as follow:

    > klayout test.gds
    *** ERROR: /usr/local/klayout/rb/import_tf.rbm:2: Ruby error: 'no such file to load -- stringio' (LoadError)

    The system is RHEL4.

    Best Regards,
    --
    chhung
  • edited July 2011
    Hi Matthias,

    Finally we found that problem was caused by the different dist, the binary was made on Mandrake, and we tried to run it on RHEL4.

    We dirty solved it via "ln -s /usr/lib64/ruby/1.8/x86_64-linux-gnu /usr/lib/ruby/1.8/x86_64-linux" and can't make sure if it would cause other problems, at least it works fine now.

    Best Regards,
    --
    chhung
  • edited 3:11AM

    Hi chhung,

    I had one installation of ruby 1.8 where there was no 64bit version of stringio.so and I had a similar issue myself. Because I did not find a 64bit version, I was solving that problem by switching to ruby 1.9 but your solution is probably a valid one as well.

    Thank you for that hint and best regards,

    Matthias

  • edited 3:11AM
    Hi Matthias,

    Thanks for the code, in my case there is a crash
    (eval):7380: syntax error
    "techId", =, [ "techGetTechFile", "tcCellView", ],
    ^
    (eval):7380: syntax error
    "techId", =, [ "techGetTechFile", "tcCellView", ],
    ^' (SyntaxError)

    Not sure if this is something easy to solve, or if I am doing things not the proper way.

    Nick
  • edited July 2011

    Hi Nick,

    I guess your tech file contains some code like this one:

    techId = techGetTechFile( tcCellView )
    

    Unfortunately the import script does not understand Skill code, neither can it execute these functions. It expects are pure list and converts it into a Ruby expression. That's the reason for the strange error message. It's probably possible to adjust the script so it reads over that piece of code but I doubt the results make much sense then.

    One possible solution may be to export an ASCII techfile. That one should not contain Skill code then.

    Best regards,

    Matthias

  • edited 3:11AM
    Hi Matthias,

    Thanks for your reply. Indeed it contains skill code. At least its now clear to me that skill isn't supported with your function. I will try to see if any pure ascii version is available or if I can create that.

    Regards

    Nick
  • edited 3:11AM

    Hi Nick,

    I have uploaded a new version of the script in which I have tried to make the parsing somewhat more robust against Skill expressions.

    In any case, these expressions are still not evaluated. If they appear in sections which are ignored this may be acceptable however.

    Best regards,

    Matthias

  • edited August 2011
    Hi Matthias,

    I am new user of Klayout, and i try to use your script for importing cadence tech file.
    Here is the flow I followed.
    Run Klayout on window (64 bit), open a gds file, copy paste your ruby script on console.
    So now I have acces to import cadence file menu, select this menu and put the path to my tech file.

    After that, Klayout crashes with this message:
    "klayout a cesse de fonctionner" -> klayout stopped abnormally.

    So I would to know what information are necessary on tech file because i would like to try to create a simple tech file to import it correctly
  • edited 3:11AM

    Hi Nicolas,

    it's somewhat hard to tell - I noticed that on Windows, KLayout quits on Ruby errors in some cases. Bascially, the message means that some Ruby runtime error occured. I admit that is not quite helpful.

    I have just downloaded a new version of the script (using the same location), which is somewhat more robust against certain Skill syntax features. If that fails, maybe it's possible to reduce the techfile and thus localize the problem. If it is possible, you can also send to techfile including the .drf file to the contact mail address and I will have a look at it.

    The basic problem is that technically the Techfile is not a simple file but Skill code. That is hard to read without a Skill interpreter. The script tries to convert the Skill list including all the expressions and pick out the interesting parts. That fails if the techfile makes use Skill, for example to dynamically fill the interesting lists. Also, some techfiles come without stream layers (that is part of the PIPO setup) in which case there is no way to correlate the techfile entries with GDS layers.

    Best regards,

    Matthias

  • CMCM
    edited October 2011

    Hi Matthias,

    I wanted to report this following error when reading in a techfile.

    -------------------------------------BEGIN-------------------------------------

    Ruby module loaded '/cad/software/klayout/0.21.13/userware/import_tf.rbm'

    Loading file: 2.2.gds
    Loading file: 2.4.gds

    /cad/software/klayout/0.21.13/userware/import_tf.rbm:227: Ruby error: '(eval):1183compile error
    ( eval ):1183: syntax error
    [ "gate_core1", 10012, [ "gate", 'not", "OD2", ], ],
    ^
    ( eval ):1183: syntax error
    [ "gate_core1", 10012, [ "gate", 'not", "OD2", ], ],
    ^' (SyntaxError)
    /cad/software/klayout/0.21.13/userware/import_tf.rbm:227
    /cad/software/klayout/0.21.13/userware/import_tf.rbm:195:in 'eval'
    /cad/software/klayout/0.21.13/userware/import_tf.rbm:227
    /cad/software/klayout/0.21.13/userware/import_tf.rbm:195:in 'call'´
    /cad/software/klayout/0.21.13/userware/import_tf.rbm:36:in `triggered' (class SyntaxError)

    -------------------------------------END-------------------------------------

    Additional info:

    • CDS version IC6.1.3.500.8
    • Section of techfile where problem occurs: techDerivedLayers

    Please let me know if you need further information.

  • edited 3:11AM

    Hi CM,

    I think the problem is the layer expression for gate_core1. It is not parsed correctly. Maybe you can give the original line from the techfile, so I can have a look at it.

    It may help to export the techfile to an ASCII techfile in CDS. It may be a different format which can be parsed by the script.

    Best regards,

    Matthias

  • CMCM
    edited 3:11AM

    Hi Mathias

    This is the line which is reporting the problem:

    techDerivedLayers(
    ....
    ....
    ( gate_core1 10012 ( gate 'not OD2 ))
    ....
    ....

    )

    Best regards
    CM

  • edited 3:11AM
    Hi Matthias,
    I'm very new to Klayout, so please exuse my (maybe) stupid questions.
    I'm trying to create a (preferably) batch procedure that will import a cadence tech file/display.drf and create .lyp file. I want this procedure to be ran each time we update our Cadence tech file (adding new layers) so that .lyp file will always correspond the cadence's one.
    Is there a easy way to create such a script?
    Thanks,
    Yulia
  • edited April 2014

    Hi Yulia,

    I have provided another version of the import script at http://178.77.72.242/svn-public/klayout-resources/trunk/scripts/import_tf_standalone.rb which can be used in batch mode.

    Instructions how to use the script together with KLayout can be found in the header. Basically, you call KLayout in batch mode (non-GUI, option -z) and pass the script with the -r option. It requires two variables which tell the script where to find the techfile and where to write the output. Both variables are defined with KLayout's -rd option.

    Please note that if there are multiple .drf files, the script will prompt to select one of them. Hence it's not really "batch" mode.

    Best regards,

    Matthias

  • edited 3:11AM
    Hi Matthias,
    Thank you very much, this was very helpful. I just changed the script so that is receives display.drf name as external params ( pretty easy) and it fetched perfectly into our flow

    Regards,
    Yulia
  • edited 3:11AM
    Hi,
    Was giving the convert script a try.

    Tried -->
    klayout-r802/bin.linux-64-gcc-release/klayout -z -rd tf_file=in_tf_ascii -rd lyp_file=out_lyp -r import_tf_standalone.rb

    I get the following error-->
    *** ERROR: Unknown option: -rd

    Any feedback on what could be the reason for this>
    Thanks for your help
  • edited 3:11AM

    Hi new2klayout,

    did you compile KLayout with Ruby support?

    Matthias

  • edited 3:11AM
    Hello,

    Thanks very much for your excellent program. I was able to install the program on a Windows 7 machine and view a few gds files. I am now particularly interested in using the script to convert a Cadence techfile to a layer property file (lyp). Following the instructions (at the head of import_tf_standalone.rb ), I inserted the command

    klayout.exe -z -rd tf_file=display2.drf -rd lyp_file=display.lyp -r import_tf_standalone.rb

    in a simple .bat file. The batch file is executed in a command window of the directory that hosts klayout. Into that directory I placed the cadence files display2.drf and the layermap file soi12s0.layermap. The script produces the file display.lyp, but the contents are of the type
    ``<line>....*.....*....*....*.....*....*</line>
    </pattern>
    <order>11</order>
    <name>vZigZag</name>
    </custom-dither-pattern>
    <custom-dither-pattern>
    <pattern> `` . That is, the script does not produce a working lyp file. Is there something that I am missing? The required file 'stringio' is in a sub directory.
  • edited April 2014

    Hello,

    I guess you are missing the actual tech file.

    Basically you need three files: the cadence tech file (preferably exported text), the drf file (can be called anyname.drf, but there has to be one *.drf file) and a layers file. The layers file is optional if you have included the correct stream layers in your tech file.

    To the "tf_file" variable you have to pass the name of the tech text file, not the drf file. The script will then try to locate a *.drf file and a *.layers file at the place where the tech file is stored.

    Matthias

  • edited 3:11AM
    Hi Matthias ,

    The revised script works! And as expected, loading the Layer Properties makes a significant difference in the image of the gds file. Thanks! Like others, I will continue to praise your program.
  • edited 3:11AM
    Hello,

    I recently tried to use this script, but got results like SteveG, except I am passing it the techfile, not the display.drf. I've looked at my Cadence tech.db, and it's binary. I found something in Cadence to dump the file, and have done so. However, whether I pass import_tf_standalone.rb binary or text form of the tech.db, I basically get only dither definitions. Looking at my text-format techfile, it's pretty much a hunk of skill code, so doesn't appear to be the ASCII techfile called for earlier.

    I'm running Virtuoso 12.1, and I'm not that well-versed in Cadence, having mostly used a different toolset. Can someone tell me how to get an ASCII techfile exported? I know we use "compiled context files", so I suspect it can't all come out in cleartext, but I would hope that at least some can.

    Dale
  • edited 3:11AM

    Hi Dale,

    The last time I was using Cadence Design Framework we had version 5 - I don't recall the Virtuoso version employed within that version. There was still a function called "ASCII tech file export", but maybe Cadence changed that part substantially.

    Matthias

  • Update: the techfile script now is a KLayout Package: the name is "tf_import".

Sign In or Register to comment.