# DRC : via spacing within a array of vias / Number of gate contacts

edited January 2014
Hi,

Does anyone has an idea on how to code the DRC rule :
via spacing within an array of (at least) 3x3 vias spaced by less than 0.5um ? This rule has a maximum of 0.3um.

I also have another difficulty to code :
minimum of 2 contacts between a poly polygon and a metal1 poygon

Thanks, Best regards,

Laurent

• edited January 2014

Hi Laurent,

counting functions are missing yet - but if performance does not count, it's fairly simple to add a custom method to select polygons by their number of holes:

``````# Define a new custom function that selects polygons by their
# number of holes:
# It will return a new layer containing those polygons with
# min to max holes. max can be nil to omit the upper limit.
class DRC::DRCLayer
def with_holes(min, max)
new_data = RBA::Region::new
self.data.each do |p|
if p.holes >= (min || 0) && (!max || p.holes <= max)
new_data.insert(p)
end
end
DRC::DRCLayer::new(@engine, new_data)
end
end

# here's how it can be used to approximately solve problem #1
via = ... # the via layer
metal = ... # top or bottom metal

# join rectangular via arrays with a spacing of <=0.5 um into
# single patches using over/undersize
merged_via = via.sized(0.25.um).sized(-0.25.um).extents.inside(metal)

# punch out the original vias as holes (sizing by 1 DBU makes
# sure there is some rim left) and use our new "with_holes"
# method to select those with more than 9 vias (it's not
# exactly 3x3, but maybe catching the intention ...)

# select the original via inside that array

... now do the spacing check on "selected_via"
``````

I think that this new function can also be used to solve problem #2 in a similar way.

Regards,

Matthias

• edited January 2014

Thanks Matthias,

You method unfortunatly also detects arrays of 2x3 or 2xmany, so I improved with a function :

``````Merged_via = Via.sized(0.25.um).sized(-0.25.um).with_bbox_min(1.6.um).extents.inside(Metal)
``````

Where 1.6=0.2+0.5+0.2+0.5+0.2 assuming that 0.2um is the via size and 0.5um is the via spacing for the array.

Best regards,

Laurent

• edited November -1

Hi Laurent,

I'm not sure - 2x3 should not be detected, because "with_holes(9, nil)" should detect all clusters with at least 9 vias. However, in the case of 2x5 for example you're right - since those are more than 9 vias, a 2x5 array will be detected.

Matthias