From 93c43d049a80334242006ca32c91c3017641d9e6 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 20 Jul 2026 01:09:47 +0200 Subject: [PATCH] Bugfix: Region#edges wasn't working properly in deep mode with properties - edges are not separated according to polygon properties --- src/db/db/dbRegionLocalOperations.cc | 17 ++++++++++------- src/drc/unit_tests/drcSimpleTests.cc | 10 ++++++++++ testdata/drc/drcSimpleTests_151.drc | 14 ++++++++++++++ testdata/drc/drcSimpleTests_151.gds | Bin 0 -> 1702 bytes testdata/drc/drcSimpleTests_au151.gds | Bin 0 -> 2156 bytes testdata/drc/drcSimpleTests_au151d.gds | Bin 0 -> 2156 bytes 6 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 testdata/drc/drcSimpleTests_151.drc create mode 100644 testdata/drc/drcSimpleTests_151.gds create mode 100644 testdata/drc/drcSimpleTests_au151.gds create mode 100644 testdata/drc/drcSimpleTests_au151d.gds diff --git a/src/db/db/dbRegionLocalOperations.cc b/src/db/db/dbRegionLocalOperations.cc index feaabf569..f60484eb6 100644 --- a/src/db/db/dbRegionLocalOperations.cc +++ b/src/db/db/dbRegionLocalOperations.cc @@ -2381,8 +2381,11 @@ PolygonToEdgeLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell db::properties_id_type prop_id = shapes_by_prop_id->first; + ep.clear (); + + size_t p = 0; for (auto s = shapes_by_prop_id->second.first.begin (); s != shapes_by_prop_id->second.first.end (); ++s) { - ep.insert (**s); + ep.insert (**s, p++); } db::property_injector > results_with_properties (&results.front (), prop_id); @@ -2395,7 +2398,6 @@ PolygonToEdgeLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell } else { - // @@@ that's not correct, isn't it? // With intruders: to compute our local contribution we take the edges without and with intruders // and deliver what is in both sets @@ -2407,18 +2409,19 @@ PolygonToEdgeLocalOperation::do_compute_local (db::Layout * /*layout*/, db::Cell ep.clear (); - for (auto s = interactions.begin_subjects (); s != interactions.end_subjects (); ++s) { - ep.insert (s->second); + size_t p = 0; + for (auto s = shapes_by_prop_id->second.first.begin (); s != shapes_by_prop_id->second.first.end (); ++s) { + ep.insert (**s, ++p); } - for (auto i = interactions.begin_intruders (); i != interactions.end_intruders (); ++i) { - ep.insert (i->second.second); + for (auto s = shapes_by_prop_id->second.second.begin (); s != shapes_by_prop_id->second.second.end (); ++s) { + ep.insert (*(s->second), ++p); } std::vector edges2; db::EdgeContainer ec2 (edges2); ep.process (ec2, op); - // Runs the boolean AND between the result with and without intruders + // Runs the boolean AND between the result with and without intruders - this identifies outside edges db::box_scanner scanner; scanner.reserve (edges1.size () + edges2.size ()); diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index ab6532d72..9928e45de 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -2133,3 +2133,13 @@ TEST(150d_optimized_separation) { run_test (_this, "150", true); } + +TEST(151_edges_from_region_with_properties) +{ + run_test (_this, "151", false); +} + +TEST(151d_edges_from_region_with_properties) +{ + run_test (_this, "151", true); +} diff --git a/testdata/drc/drcSimpleTests_151.drc b/testdata/drc/drcSimpleTests_151.drc new file mode 100644 index 000000000..154464951 --- /dev/null +++ b/testdata/drc/drcSimpleTests_151.drc @@ -0,0 +1,14 @@ +source $drc_test_source +target $drc_test_target + +if $drc_test_deep + deep +end + +deep + +l1 = input(1, 0, enable_props) +l1.output(1, 0) + +l1.edges.output(100, 0) + diff --git a/testdata/drc/drcSimpleTests_151.gds b/testdata/drc/drcSimpleTests_151.gds new file mode 100644 index 0000000000000000000000000000000000000000..9750b94685f1dcdfec01c4be19fbc3a446a681ce GIT binary patch literal 1702 zcmb7^u}%U(6h-eYunPzVqR|3AfCLgtLt}!{7)`Vw(O7BX&)8dNY%EN)(4H@_(!?IW zz=}`s-5K7@EQSROa>?Div-iDyGe{7}=V(W9`hyf3*hU|n@IT6Na(uWCY!*s;gPYx> z_vdMUINo`DxEP^b%Bf3|(a9-LECWeBMucQN2GDC1fNBSbdREJKK>Za^RbMpenz~*x z5KeOeE0q_phDyfT*sJ=hvSb!0eFIcx3V-U0x?D1sg}KP!`>D)Tx%8@jm@AK!egU<% z^eEc+u(?##7j?M~mgHg$bCFS!mt z(tK2t%RYCkxgN8uS#O5%Ih&WNXRpNK4)Fa{GxImE>gUYsPp(?a_7>C{w)0zlUU@yH z>1^*sxnH{f?mXD%uE)7El*tv=mhWw^PCa`i7U#tMrkXP?^HNnm-1}v@qOR>Ns5NZo zcm2HbSllZzsLaOQP*p$7HFq8}^9pP0(jPfaJ=@JIkHuQvErtKVxqp*jNZ!_yPF>D+@os zFR;od_-?Xqb{&%JI0nL92IlOY_wKxfg)vv?*G&426g||CV88r~%-HkOW1yEbj)r#! zXYVi5!_j2#>G67ueq+TxYsVLtKs^I&+X&fi7yyG#0`*w}C9G6lz&%tl)+UAOdMHb3fyNg=rKj>=*F~K#smoGdWbpk|`fA=3s_SK6t61qL zu-=z5igrHczEpKx)cHE8@Wnm!MMi5{sIG^yy7$uDXMoDOZ@m_(>!QxrDEHNzXW}-` zgxxkU$TlSz^6P0rG!deXph>7Ec$tbIc!`Q2uqNzvp3w+`mqbU-NnT!ABfhS-k^U2{ngy+G_rXz%(!b^Dsf!)+QCU?&f^uAX2g11!(i*9K(fgW_0 zNmZSP@I-Nvt(suf9@tHKASo`B-t=;(2(KhPu#)*~jU<$&a0G#;&`Or4TzD_Mub=Y} belPMK%z7bS9N`Zhet(r5L3@$P)UV?Q*T$C* literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au151d.gds b/testdata/drc/drcSimpleTests_au151d.gds new file mode 100644 index 0000000000000000000000000000000000000000..75622fd4b8d7fe57f06e71df38c4c7fd209168a9 GIT binary patch literal 2156 zcmbuAu}T9$6h&`lli5u)nn18hV<#A}5yVD_rV#}#Qizp>KVxqp*jNZ!_yPF>D+@os zFR;od_-?Xqb{&%JI0nL92IlOY_wKxfg)vv?*G&426g||CV88r~%-HkOW1yEbj)r#! zXYVi5!_j2#>G67ueq+TxYsVLtKs^I&+X&fi7yyG#0`*w}C9G6lz&%tl)+UAOdMHb3fyNg=rKj>=*F~K#smoGdWbpk|`fA=3s_SK6t61qL zu-=z5igrHczEpKx)cHE8@Wnm!MMi5{sIG^yy7$uDXMoDOZ@m_(>!QxrDEHNzXW}-` zgxxkU$TlSz^6P0rG!deXph>7Ec$tbIc!`Q2uqNzvp3w+`mqbU-NnT!ABfhS-k^U2{ngy+G_rXz%(!b^Dsf!)+QCU?&f^uAX2g11!(i*9K(fgW_0 zNmZSP@I-Nvt(suf9@tHKASo`B-t=;(2(KhPu#)*~jU<$&a0G#;&`Or4TzD_Mub=Y} belPMK%z7bS9N`Zhet(r5L3@$P)UV?Q*T$C* literal 0 HcmV?d00001