Klayout Hierarchy DRC, output data not showing up where I want...

edited November 2014 in General
Hello Everyone,

I am new to Klayout and I am working on writing a DRC script to help find and remove small lines and spaces from a layout. My thought was to scale the artwork down by a set value and then scale it back up by that same value. The reverse order can be done to remove small spaces. I believe the code to do this is fairly straigh forward, but I run into a problem when I try to run on Hierarchy. If my layout is merged and flattened then I can do these operations without much issue, but when I tried to do it on a hierarchy system I ran into two issues. First is when I get data on the output it is centered in the middle of the layout, instead of overlaying where the actual data came from. The other issue I am running into is that when I try to do a multi step operation like I described above, I get output for the first step but nothing for the second. I have some sample code listed below.

active_layout = RBA::CellView::active.layout
active_layout.top_cell.each_child_cell do |current_cell_index|
current_cell = active_layout.cell(current_cell_index)

#active_layout.cell(current_cell_index).each_layer do |current_layer_index|
source(current_cell)
data = source.input(2)
#data.sized(-0.75.micron).output(100,current_cell_index,"ShrunkData")
data.sized(-0.75.micron).output(100,0)
#shrunk = input(100,current_cell_index,"ShrunkData" )
shrunk = source.input(100,0 )
#shrunk.sized(0.75.micron).output(101,current_cell_index,"CleanData")
shrunk.sized(0.75.micron).output(101,0,"CleanData")

end

The other issue I have is one of looping over the layers. Do I have to merge all the layers for this to work? or can I loop over the layers just like the cells and build out an output. Ideally I would like to preserve hierarchy and layer names into my output. The output can either go to this file or a different file.

Thanks so much for any help!
Ben

Comments

  • edited November -1

    Hi Ben,

    your approach is valid, but true hierarchical processing is a fairly complex topic and in general cannot be solved efficiently while maintaining the hierarchy.

    you approach will work in certain configurations but you will not be able to correct features across two child cells of your layout.

    To solve the first issue, you'll have to tell the script also to deliver output to the local cell:

    output_cell(current_cell.name)
    

    Regarding the second topic: you can iterate over the layers too:

    active_layout.layer_indices do |li|
      info = active_layout.get_info(li)
      ...
      data = input(info.layer, info.datatype)
      ...
    end
    

    You should be able to overwrite the original layer with the output.

    Matthias

Sign In or Register to comment.