I'd like to select shapes (or even maybe edges) of a layer which "straddle" another layer, i.e. shapes that that cross over edges of the other layer (not just touching).
Yes, just getting to grips with KLayout's DRC... In general it seems pretty fast at doing conditional selection (as above) or single layer dimension checks, but very slow at doing layer-to-other-layer dimension checks - is that what you expect?
I'd expect record-breaking, unmatched performance of course :-)
No frankly - performance was not the ultimate goal in the DRC engine. It uses a pretty simple flat approach and the main targets are small to medium sized layouts. And I admit there is room for improvement.
In contrast to the conditional selection operations, the dimension checks perform a merge step before determining the violations. This step removes overlaps and touching edges and joins long edges. This step is not necessarily slow but it adds some overhead. I assume this is causing a slow execution in your case. You can test that by explicitly merging the layers, i.e.
# instead of
l1.overlap(l2, 1.0.um)
# you can write
l1.merged.overlap(l2.merged, 1.0.um)
If the layers are already merged, the overlap check should not merge again and you can derive the run times for the separate steps from the log file.
if you happen to have a good testcase that you could send me, I can have a look at the performance. Maybe there is a bottleneck that is easy to remove.
Comments
checkedLayer.interacting(otherLayer).not_inside(otherLayer)
Hi Brendan,
very good ... that's what I would have suggested anyway :-)
Best regards,
Matthias
Yes, just getting to grips with KLayout's DRC... In general it seems pretty fast at doing conditional selection (as above) or single layer dimension checks, but very slow at doing layer-to-other-layer dimension checks - is that what you expect?
Cheers,
Brendan.
Hi Brendan,
I'd expect record-breaking, unmatched performance of course :-)
No frankly - performance was not the ultimate goal in the DRC engine. It uses a pretty simple flat approach and the main targets are small to medium sized layouts. And I admit there is room for improvement.
In contrast to the conditional selection operations, the dimension checks perform a merge step before determining the violations. This step removes overlaps and touching edges and joins long edges. This step is not necessarily slow but it adds some overhead. I assume this is causing a slow execution in your case. You can test that by explicitly merging the layers, i.e.
If the layers are already merged, the overlap check should not merge again and you can derive the run times for the separate steps from the log file.
if you happen to have a good testcase that you could send me, I can have a look at the performance. Maybe there is a bottleneck that is easy to remove.
Best regards,
Matthias