Drc spacing based on layer connectivity

It is common to have rules that depend upon the layer connectivity. Very common is NWELL spacing based on same net or different net.
Does Kayout support this check ?

Comments

  • There is a "nets" function in the drc engine. Here's a link to the reference document and example:
    https://www.klayout.de/doc/about/drc_ref_layer.html#h2-1998

    As for a specific connectivity option for spacing, I don't believe there is one (I didn't check the reference doc too thoroughly, though).
    But here is a drc example that seems to do what you want:


    As you can see the far right net is breaking the spacing drc (assume 2.5um min space)

    Here's the drc script:

    #input layers
    nwell = input(3,0)
    via = input(2,0)
    metal1 = input(1,0)
    
    #connectivity
    connect(nwell, via)
    connect(via, metal1)
    
    #grab nwell nets
    nwell_all_nets = nwell.nets   
    
    #notch only checks spacing per polygon (same net)
    nwell_all_nets.notch(2.5).output("space_same_net")
    
    #isolate only checks spacing against other polygons (diff nets)
    nwell_all_nets.isolated(2.5).output("space_diff_net")
    

    After running the drc deck you can see the two different errors:

    One thing to note is if the net breaks into multiple polygons then this will give incorrect results. You can also mess with the net data directly with something like:

    ...
    nwell.nets.data.each {|net|
    ...
    }
    ...
    

    Hope this helps.

  • edited March 12

    Hi @blueman_44 and @alto,

    You're almost there :)

    Some magic already happens in nwell.nets. This method will select nets, but more importantly, it assigns the net names as properties to the shapes it delivers (and it also brings hierarchical subnets to the top level).

    The second feature we need is property sensitivity in the DRC functions (BTW: there is also property sensitivity in booleans).

    In order to check space between same nets, you have to add the "props_eq" option to "space":

    nwell_all_nets.space(2.5, props_eq).output("space_same_net")
    

    and "props_ne" for different nets:

    nwell_all_nets.space(2.5, props_ne).output("space_different_nets")
    

    Same polygons have same properties, so "space" with "props_eq" implies "notch".

    Matthias

Sign In or Register to comment.