CHECK LAYER MISSING

Hello,

I need verify if ALL layers into the gds file are present into the layer propriety file loaded and vice-versa.
Is possible do it using a script?

Many thanks in advance

Regards

Luciano

Comments

  • edited September 2018

    My problem is that I have created a layer property file with some layer, and I loaded it with a gds file.
    If into the gds file is present a particular layer NOT defined into my property file, I cannot see it into the layout opened with klayout and there is NOT warning that help me to understand which is this layer.

    I need do this check automatically , loading gds file and dedicated layer property files.

    I hope this one clarify my question

    Regards

    Luciano

  • edited September 2018

    Hi Luciano,

    Maybe you don't Need a separate check.

    If you want layer properties files to show all layers, you can add the following wildcard entry into the layer properties file:

     <properties>
      <frame-color>#ff0000</frame-color>
      <fill-color>#ff0000</fill-color>
      <frame-brightness>0</frame-brightness>
      <fill-brightness>0</fill-brightness>
      <dither-pattern>I1</dither-pattern>
      <line-style/>
      <valid>true</valid>
      <visible>true</visible>
      <transparent>false</transparent>
      <width>3</width>
      <marked>false</marked>
      <xfill>false</xfill>
      <animation>0</animation>
      <name/>
      <source>*/*</source>
     </properties>
    
    

    This entry will expand to every "unknown" layer and Show these in bright red.

    Matthias

  • Thanks Matthias, this works fine, but I need a second step.

    I need to know which is the layer NOT defined in my "layer property" file.

    To do it In this moment I need extract the layer's list from the gds file separately with this script

    http://klayout.de/forum/discussion/1066/extract-layer-list-and-top-cell-name-from-gds-file#latest

    and then check the output vs. the "layer property" file to know exactly this layer number.

    Is not possible add this check automatically, with some script?

    Luciano

  • Hi Luciano,

    if you want this, the following script may help. If will check whether all layers of the active layout are visible in the layer list and show a warning if that is not the case.

    Matthias

    # fetch the current layout view
    lv = RBA::LayoutView::current
    
    # fetch the active cellview (the layout)
    cv = lv.active_cellview
    cv_index = lv.active_cellview_index
    layout = cv.layout
    
    # iterate over the layers and collect the layer indexes
    # of all layers shown in the layer views
    in_lyp = []
    li = lv.begin_layers
    while !li.at_end?
      if li.current.cellview == cv_index && layout.is_valid_layer?(li.current.layer_index)
        in_lyp << li.current.layer_index
      end
      li.next
    end
    
    # compress the list of layer indexes
    in_lyp = in_lyp.sort.uniq
    
    # obtain the layers not shown (a list of indexes)
    not_shown = layout.layer_indexes - in_lyp
    
    # print the list of layers not shown (as layer/datatype/names)
    if !not_shown.empty?
      info = "The following layers are invisible:\n"
      not_shown.each do |l|
        info += "  " + layout.get_info(l).to_s + "\n"
      end
      info += "(#{not_shown.size} out of #{layout.layer_indexes.size} layers are not shown)"
      RBA::MessageBox::warning("WARNING: layers not shown", info, RBA::MessageBox::Ok)
    end
    
  • Hi Matthias,

    many thanks for this script.

    How can run this script?

    klayout -r myscript.rbm ?

       Luciano
    
  • Any explanation regarding how run automatically the script?

    Many thanks in advance
    Luciano

  • Hi Luciano,

    this script is for pasting into the macro editor. You can configure it to appear in the menu, so you can run it from there.

    For more details about using macros see here: https://www.klayout.de/doc-qt4/programming/introduction.html

    Matthias

  • Hi Matthias,

    li.current.cellview == cv_index

    hangs up. li is a LayerPropertiesIterator, li.current is a LayerPropertiesNodeRef, and that one doesn't like cellview. :-(

    Thomas.

  • Hi Thomas,

    are you sure?

    LayerPropertiesNodeRef is finally derived from LayerProperties and this one has "cellview" which gives an int.

    What version are you using?

    Matthias

Sign In or Register to comment.