Search for min/max dimension in a design

edited February 2013 in Ruby Scripting
Is there a way to find (hierarchically) the min/max dimension of shapes in a design?

Comments

  • edited February 2013

    Hello,

    could you be somewhat more specific?

    Maybe you can explain what information you want to retrieve (i.e. what do you mean by "hierarchically"?) or what kind of functionality you look for (script/interactive etc.)

    Matthias

  • edited 1:47AM
    By "hierarchically," I mean that the minimum (maximum) shape may be in an instance of a cell that is used multiple levels below the top cell (an instance in multiple instances in another multiple instances, etc before reaching the top cell).

    As far as functionality, an RBM script would be fine; or whatever is the simplest and most effective. The returned information I'm looking for is the dimension of the shape, its location, and name of the cell where it's in.

    By extension, is it possible to find the minimum/maximum spacing between two shapes as well?
  • edited February 2013

    Hallo,

    below is some code that might serve as a starting point. To install that script, create a new macro in the Macro Development IDE ("Tools/Macro Development"). Paste the code below into the code window. You can assign some key shortcut using the "Edit Properties" button in the tool bar above the macro code. Or create a menu entry for this macro.

    The macro will take the first selected shape and show it's signature, the cell that this shape is in and the shape's bounding box as seen from the current cell (I assume that is what you mean by "hierarchical").

    There is no efficient way to determine minimum spacings currently. You could iterate over all shapes and check all shapes versus all others. But that will be pretty slow for usual layouts.

    Regards,

    Matthias

    mw = RBA::Application::instance.main_window
    lv = mw.current_view 
    lv || raise("No view open")
    
    msg = nil
    
    lv.each_object_selected do |sel|
      if !sel.is_cell_inst?
        cv = lv.cellview(sel.cv_index)
        bbox = sel.shape.bbox.transformed_cplx(sel.trans) * cv.layout.dbu
        msg = "Shape: " + sel.shape.to_s + "\n"
        msg += "In Cell: " + cv.layout.cell_name(sel.cell_index)
        msg += "Bounding box as seen from top level: " + bbox.to_s
        break
      end
    end
    
    if !msg
      raise("No shape selected")
    else
      RBA::MessageBox::info("Shape Info", msg, RBA::MessageBox::Ok)
    end
    
  • edited 1:47AM

    Edit:

    since version 0.25, "micrometer unit" properties are available. With these, the multiplication with the database unit is no longer required and the code simplifies to:

    mw = RBA::Application::instance.main_window
    lv = mw.current_view 
    lv || raise("No view open")
    
    msg = nil
    
    lv.each_object_selected do |sel|
      if !sel.is_cell_inst?
        cv = lv.cellview(sel.cv_index)
        bbox = sel.shape.dbbox.transformed(sel.dtrans)
        msg = "Shape: " + sel.shape.to_s + "\n"
        msg += "In Cell: " + cv.layout.cell_name(sel.cell_index)
        msg += "Bounding box as seen from top level: " + bbox.to_s
        break
      end
    end
    
    if !msg
      raise("No shape selected")
    else
      RBA::MessageBox::info("Shape Info", msg, RBA::MessageBox::Ok)
    end
    

    Matthias

  • edited June 15

    I also find myself repeatedly manually scouring masks for minimum gaps/widths. New users of our equipment don't know the resolution limits of our machines, so I have to manually drive around their designs looking for the minimum feature, hopefully catching it.

    I do see that this is probably a computationally difficult problem, since it may require flattening first.

    But by eye it's faster - while zoomed out, visually look for close features, then zoom in on potential problem areas. Perhaps an algorithm could be coded up to do something similar - use decimated, "zoomed out" data (large database unit?) and then progressively zoom in on flagged regions.

    Can the DRC interface do this more efficiently @Matthias ?

  • edited June 15

    Sure ... DRC is exactly meant for deriving design rule violations. That's why it's called "design rule check" :-)

    See more here: https://www.klayout.de/doc-qt5/manual/drc.html

    Matthias

  • The DRC check minimum and maximum width, for example for Metal1 :

    Metal1.width(1.0 , euclidian).output("M1_min_width", "Metal1 minimum width : 1.0um")
    Metal1.not(Metal1.width(2.0 , euclidian).polygons).output("M1_max_width", "Metal1 maximum width : 2.0um")
    

    or :

    Metal1.size(-1.0).size(1.0).output("M1_max_width", "Metal1 maximum width : 2.0um")
    
  • Hi sir
    Metal1.size(-1.0).size(1.0).output("M1_max_width", "Metal1 maximum width : 2.0um")
    --->as this DRC command , that will output what the pattern size more than 2.0um , but that can't check what the max. size is in the layout.(3.0um or 50.0um...)

  • As mentioned in the other post: DRC is just a check ("C" is for check), not an analysis tool.

    If you have Manhattan geometry where rounding errors don't accumulate, you can basically do size(-small_step) until the layer is empty. The accumulated size value times two shortly before the layer gets empty will give you the maximum dimension then.

    Matthias

Sign In or Register to comment.