From 8e6e72fd832b6c7118c96f7ee818621dffe929b9 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Tue, 11 Aug 2026 23:19:25 +0200 Subject: [PATCH] Fixing bug #2416 (two-layer DRC check without merged first input produces separation violations that 0.30.9 does not report) --- src/db/db/dbAsIfFlatRegion.cc | 7 ++++++- src/db/db/dbDeepRegion.cc | 7 ++++++- src/drc/unit_tests/drcSimpleTests.cc | 11 +++++++++++ testdata/drc/drcSimpleTests_152.drc | 25 +++++++++++++++++++++++++ testdata/drc/drcSimpleTests_152.gds | Bin 0 -> 2290 bytes testdata/drc/drcSimpleTests_au152d.gds | Bin 0 -> 5554 bytes 6 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 testdata/drc/drcSimpleTests_152.drc create mode 100644 testdata/drc/drcSimpleTests_152.gds create mode 100644 testdata/drc/drcSimpleTests_au152d.gds diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index 37b1708ee..7ba74217e 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -1237,7 +1237,12 @@ AsIfFlatRegion::run_check (db::edge_relation_type rel, bool different_polygons, different_polygons = true; } - bool needs_merged_primary = (! other && different_polygons) || options.needs_merged (); + // in some cases we need merged primary polygons: + // 1.) isolated check (same layer, but different polygons) + // 2.) options need merged edges (projection limits, rectangle filter, opposite filter) + // 3.) prop_ne constraint - in that case, merge must not be applied internally after properties have been separated + bool needs_merged_primary = (! other && different_polygons) || options.needs_merged () || pc_always_different (options.prop_constraint); + bool primary_is_merged = is_merged (); db::RegionIterator polygons; diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index bb739ed54..ea984a1a8 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -2405,7 +2405,12 @@ DeepRegion::run_check (db::edge_relation_type rel, bool different_polygons, cons // primary input - bool needs_merged_primary = (! other_deep && different_polygons) || options.needs_merged (); + // in some cases we need merged primary polygons: + // 1.) isolated check (same layer, but different polygons) + // 2.) options need merged edges (projection limits, rectangle filter, opposite filter) + // 3.) prop_ne constraint - in that case, merge must not be applied internally after properties have been separated + bool needs_merged_primary = (! other_deep && different_polygons) || options.needs_merged () || pc_always_different (options.prop_constraint); + bool primary_is_merged = false; db::DeepLayer polygons; diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 9928e45de..a4a2b489f 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -2143,3 +2143,14 @@ TEST(151d_edges_from_region_with_properties) { run_test (_this, "151", true); } + +// issue #2416 +TEST(152_sep_with_props) +{ + run_test (_this, "152", false); +} + +TEST(152d_sep_with_props) +{ + run_test (_this, "152", true); +} diff --git a/testdata/drc/drcSimpleTests_152.drc b/testdata/drc/drcSimpleTests_152.drc new file mode 100644 index 000000000..17f0b6af2 --- /dev/null +++ b/testdata/drc/drcSimpleTests_152.drc @@ -0,0 +1,25 @@ +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) + +l2 = input(2, 0, enable_props) +l2.output(2, 0) + +l1.sep(l2, 1.um, props_ne).output(100, 0) +l1.sep(l2, 1.um, props_eq).output(101, 0) +l1.sep(l2, 1.um).output(102, 0) +l2.sep(l1, 1.um, props_ne).output(110, 0) +l2.sep(l1, 1.um, props_eq).output(111, 0) +l2.sep(l1, 1.um).output(112, 0) +l1.space(1.um, props_ne).output(120, 0) +l1.space(1.um, props_eq).output(121, 0) +l1.space(1.um).output(122, 0) + diff --git a/testdata/drc/drcSimpleTests_152.gds b/testdata/drc/drcSimpleTests_152.gds new file mode 100644 index 0000000000000000000000000000000000000000..9835938cd1135478c715f3cb6a1abb704a7c0bd6 GIT binary patch literal 2290 zcmbuAy-HkB6or@9nd4wa9bxXVAhz zNQyjwMQZT@EG#XoQd#5yvKMF8{b7>pN#+*!8`fbK>+G}lJ#dJkEll)8eLqpc1B{`J z;q-5mBDc1(3{-oI_19lstX_P*d)YjHa(cYIiHTy)|D4-=w+<9afE$R=12-4}s8xFH zoq9&U0plltm|AkP{70$g_TGOmr{TZ2Ef;{XD}bC_16qd(r5gj?D*N7zq}#|%Lb|or z1Kn0X0t4RxvTEhnXe5+wjNJ}Cea_kG&=OF-1;~+c%UMn+-5BWh)T+*hWcA-JB$RFp zbZcDuY$UV2F-MWv+UtRC4=;V)NY?GqSwhyWy&mYs-Aq^b240=}eiNk|W4HW%WA&f^ z@~5yg<4-}9Zj9aX&y>|?29lY03ZnFMwtP2MnHflC;wgyIbF)S1IqiC~GH#rlV%1Mj z|DE+(6A+~vaszvQBHW9)W+ht#HgzdeKRH&MFr zAKaLMUCd0p7ewjd*|6Q%z-Tc6#l1^foW2lNO4 literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au152d.gds b/testdata/drc/drcSimpleTests_au152d.gds new file mode 100644 index 0000000000000000000000000000000000000000..71b367404af3d01a1ea3851739fd90655c9d5398 GIT binary patch literal 5554 zcmbtY&r4KM6h1TRbJ7`S0_TTd*dnk<2vbpUW-u|#A5emeh!$B|t*WI;LEHWY3t9vg z)jFfrQTu|HMzv{^QLXEIoqJ~PWq7YQcLe?99KSQ)Ip@3gJ*0q=$@A2oNOpds6m?UP za+I)tr&Kannx7%+ZR@C>x;MV~W@mqLcK5`??F%c^-x0wJf|ax9h}u&`K_*EF3VM=6 zG?Z)OpVn95F;VG0k)o9fj)RdJ3RW*);YtTXs?D?$72gv94=oYR-L9j?8Dmzp$;YhL_g3Zx#M}lR)e&Q@I%+(=ww6!5 zqb*?X_pn2NI14yUiW+CE&8@*9PPLX#mQ!tFTC@S7sd~4L&}Q;6wPE^I?hZJ6QEqZY zjWgD&{of%&N5pR@N&Kd$amFU9K?7V2O?WOSYCOI+bO;SVXqw|{iW-lv4SpMaEl-)L zOY)Ra)Hq|U(`bjlXJd!OZ>R#lDQcWCW;OT?8i1&Rn_N-j@wLHE&;Udg_)Ssck=oYm z`>nK1bl?X+4;TwiSmQf(@3LU#sl+*Nzj-+P>OAvyc#Hf_Q~bbNyd$_UDRGkzqw2Za9?*TsK8_|N1+`Ot?s zL%%&g=ttb-L;2YXzb*Wf9>xX)v46zN#{@Ya$w&YA?#T+`{D6;n067=R$9(YlKzts~ zpY1=B59MP%@GlVl#oWLL!oMbO^RKqJe~0gJe>i-P`@`WIfBfq+rhgp1hkqQt$Nk~( zJ?;;O@3H?I_WnKYABXR8|2TXP|2TZ;Z}R!!@S(rS=ZC}h*k1#`u+!A@)8Tvg@20(f z5C1!SbH6on|26QNynh|OhyNYE$NhWDo}b6(JA9A%JA4oSIeZWQY}oyK+}{r0