Work with layout thru Ruby

edited February 2012 in General
Hi Matthias,

I want to create (try at least) plug-in for Klayout (Rubi module) that allows to work with loaded topology. Could you please answer to my question. If I loaded any GDS2 and it is instantiated in base topology window, can I select and make highlighted any shape in this window? Or create a new shape above? Can I retrieve coordinates of the selected shape(s)? And all above should not affect source gds2 file. That is to say can I do all above using Rubi module and insert it into Klayout?

Artem Mikhmel


  • edited 6:02PM
    There, now, in details.

    I have got 2 files in input: GDS2 file and SP netlist file. The last file contains info about nets, devices and its coordinates. I am building some database like
    Next step is creation of GUI form with 2 listboxes: the 1st for nets and the 2nd for devices. This GUI appears and mapped on top after loading GDS2 and SP netlist. All net names will be present at the 1st listbox field. If I select some net name in this list then according device(s) name should be selected and highlighted in the 2nd listbox and highlighted in the layout, and vice versa.

    i.e. if I selected shape in layout, according device and net should be selected and highlighted in listboxes.

  • edited 6:02PM

    Hi Artem,

    the first problem you have to solve is how to build a GUI of your own. It can be done pretty easily using the qtruby package (see for a description of how to bring together qtruby and KLayout).

    That approach is however limited to the Linux platforms because there you usually find packages for qtruby which nicely align with the ruby/gcc combination for that distribution. On Windows, there are only very few qtruby packages available and I have not succeeded yet in building one for the Ruby/VC++ combination I am using.

    Once you have managed to set up you GUI, the rest is fairly easy: all you need to do is to instantiate markers for the shapes in the net you want to highlight. These markers will be shown above the layout. The object for the highlight markers are of class RBA::Marker. When you change the net, you need to destroy the previous markers using Marker.destroy and create new markers for the new net.

    Hopefully this helps somewhat.

    Best regards,


Sign In or Register to comment.