spacing check performance improvement

Hello @Matthias, I've been working on a DRC deck for skywater pdk, it could be found here. We had an issue that the li1 spacing check (li.3) was too slow when used with deep mode, so we thought of tiling it, but then we found out that we could change the polygons to edges and not do any tiling, and it would make the spacing check much faster. We were wondering if there's an explanation for the performance improvement after changing the shape? Also, we found out that when we changed the shape to edges and there's an error in the outside routing of a sub-circuit repeated multiple times, it's going to flag it once, but when used with polygon shapes it's going to flag it multiple times.


  • @marwaneltoukhy Thank you for bringing this up.

    This maybe is related to this discussion here:

    I should also say that 0.27.5 should be somwhat faster here.

    Basically performance is heavily dependent on the test case and if you have one you can share I will be happy to take a look. The width/space checks suffer from one implementation problem which is that all regions are merged before they are put into the space check. This is required to apply projection filters over the full length of an edge. For example for power bars stretching along a line of gate cells this leads to complex polygons which bounding-box interact with many other polygons. This slows down computation considerably and induces manifold cross-hierarchy interactions.

    I investigated the problem, but did not have the time yet to develop a solution, although I have some ideas where to start. I know this is an issue and I like to spent more effort on that if only time allowed.

    Provided I was guessing correctly: The edge solution works better because it does not generate complex polygons from the power lanes. Instead, single (potentially long) edges are derived which much less complexity and cross-hierarchical interactions. That is why this solution is faster. But it lacks some features and for example there is no "notch" method that works on edges.

    If the edge solution is a workable one, please use it for now. I need to ask for a little patience though as KLayout is a spare time project of mine and I can't work full steam on it.

    Best regards,


Sign In or Register to comment.