Displaying net name in a DEF

Hi,
I am able to read a DEF+LEF successfully in klayout. To display the net name, I can select the net, press Q, then press the button "User Property". I don't want to see all the net names displayed. Just the name of the one that is selected, eventually with a press of a key
I've tried to assign the letter W to the function "cell_user_properties" using the setup dialog (in Customize menu) , but nothing happens.
What is the best/quickest way to display the net name in a window after a keypress (or in the bottom of the main window) for a selected net ?

Thank you

Ronan

Comments

  • edited June 2023

    Hi Ronan,

    there is no such feature yet as user properties are rarely used in the GDS2 world that KLayout stems from. After all, KLayout is not a LEF/DEF viewer, but a mask layout tool.

    It is possible to install a callback through a script that tracks the selection and displays a specific user property as the net name in the status bar (this will hide the selection information). Here is some sketch:

    # NOTE: this method needs to be run once to install the 
    # callbacks. This is done automatically if you configure
    # the script as "autorun".
    
    # TODO: change to the property key you used when importing LEF/DEF
    net_property_key = 1
    
    def selection_changed():
      cv = pya.LayoutView.current()
      net = None
      if cv is not None:
        for o in cv.each_object_selected():
          if not o.is_cell_inst():
            net = o.shape.property(net_property_key)
            if net is not None:
              break
        if net is not None:
          pya.MainWindow.instance().message("Net: " + str(net), -1)
    
    def current_view_changed():
      cv = pya.LayoutView.current()
      if cv is not None:
        cv.on_selection_changed += selection_changed
    
    mw = pya.MainWindow.instance()
    mw.on_current_view_changed += current_view_changed
    current_view_changed()
    

    Please note the TODO comment.

    Matthias

  • Thank you. I'll try that asap

  • Could you elaborate on the use-case ?
    On top of layout viewing, openroad -gui also has netlist and timing browsers ...

  • Plus they are in touch with me to optimize their viewer :)

  • Use case: quickly debug DRC errors related to Non Default Rule (NDR) routing - Using a DEF can be much more effcient to identify the net(s) causing the issues

Sign In or Register to comment.