From 43a5d8c548bd103ef9d634f48493260f4bdd5f82 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Thu, 9 Jul 2026 23:43:25 +0200 Subject: [PATCH] Fixed issue #2384 Problem was that the magnification was applied twice when running the checks inside compound DRC checks. --- src/db/db/dbCompoundOperation.cc | 12 ++---------- src/drc/unit_tests/drcSimpleTests.cc | 10 ++++++++++ testdata/drc/drcSimpleTests_149.drc | 18 ++++++++++++++++++ testdata/drc/drcSimpleTests_149.gds | Bin 0 -> 287 bytes testdata/drc/drcSimpleTests_au149.gds | Bin 0 -> 660 bytes testdata/drc/drcSimpleTests_au149d.gds | Bin 0 -> 660 bytes 6 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 testdata/drc/drcSimpleTests_149.drc create mode 100644 testdata/drc/drcSimpleTests_149.gds create mode 100644 testdata/drc/drcSimpleTests_au149.gds create mode 100644 testdata/drc/drcSimpleTests_au149d.gds diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index dc9953582..cd4ea75a9 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -1682,13 +1682,9 @@ CompoundRegionCheckOperationNode::computed_dist () const void CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - // consider magnification variants - db::EdgeRelationFilter check = m_check; - check.set_distance (proc->dist_for_cell (cell, check.distance ())); - // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; - db::check_local_operation op (check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); + db::check_local_operation op (m_check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); tl_assert (results.size () == 1); if (results.front ().empty ()) { @@ -1704,13 +1700,9 @@ CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache void CompoundRegionCheckOperationNode::do_compute_local (CompoundRegionOperationCache * /*cache*/, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const { - // consider magnification variants - db::EdgeRelationFilter check = m_check; - check.set_distance (proc->dist_for_cell (cell, check.distance ())); - // TODO: needs a concept to deal with merged/non-merged inputs bool is_merged = true; - db::check_local_operation op (check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); + db::check_local_operation op (m_check, m_different_polygons, is_merged, m_has_other, m_is_other_merged, m_options); tl_assert (results.size () == 1); if (results.front ().empty ()) { diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 2d6db90f1..40fcf0376 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -2113,3 +2113,13 @@ TEST(148_sparse_array_limit) run_test (_this, "148", true); } +// issue 2384 +TEST(149_compound_drc_with_mag) +{ + run_test (_this, "149", false); +} + +TEST(149d_compound_drc_with_mag) +{ + run_test (_this, "149", true); +} diff --git a/testdata/drc/drcSimpleTests_149.drc b/testdata/drc/drcSimpleTests_149.drc new file mode 100644 index 000000000..d08836713 --- /dev/null +++ b/testdata/drc/drcSimpleTests_149.drc @@ -0,0 +1,18 @@ +source $drc_test_source +target $drc_test_target + +if $drc_test_deep + deep +end + +deep + +metal2_drawn = polygons(36, 0) +metal2_slot = polygons(36, 3) + +metal2_drawn.output(36, 0) +metal2_slot.output(36, 3) + +violations_enclosed = metal2_slot.drc(enclosed(metal2_drawn) < 10.um) +violations_enclosed.output(100, 0) + diff --git a/testdata/drc/drcSimpleTests_149.gds b/testdata/drc/drcSimpleTests_149.gds new file mode 100644 index 0000000000000000000000000000000000000000..a1d4e0d451d81326d9c4a7827f639b406347ce99 GIT binary patch literal 287 zcmV+)0pR{0iwFP!000001AWmkOT$1E2k?Jil9wo#P)l^sfQ#TFSkS49*IE%FXod>? z0`4v%nlB(Iegi?oRgsR)x;yBuj^ZwEK6@S~X!@34_;dffg9C%8kE}-F8$yg>3Mr!B z--w9wjSi4{!Ag4gvVNVGt;vJa*XBtJSy0_m%$;_3buG^UKLR)=%z+bvhlRQamG7ck zYU4!#)zeO!i~fZ4LyX)NG559#IX4cdhTF^2HApfO=%wK-LuG-+&nUTto#B>$Zb=_c zhzHtuTL*paIBh=A)&0F2B=e8P#Y@n>cG_J0+lT3Io+CbP8lU^1vm>X?#mfG}y*c-- l^t{W(o+)U2%kTK#{qkP!AVAcEU!w9m${4~JW>6hm!zK}}wgJzuTHgNa z%9WQiNB5538b?j|Rr>;?!mb*t`|Ag9imzkR4%qP0^vhYcvc^gt&Ea5Qz!Ec74lGe0GJ#^hzr z)bH;X`rO~eo$Bvye1MV|Kh!yM(BD+A+@C+`z@4h`f4BG^9y8W2_&c00bTab3^7)lb F6W>qqVq5?K literal 0 HcmV?d00001 diff --git a/testdata/drc/drcSimpleTests_au149d.gds b/testdata/drc/drcSimpleTests_au149d.gds new file mode 100644 index 0000000000000000000000000000000000000000..0bc742300ba5e2b90ddd418f9a0dbc82e206dfd6 GIT binary patch literal 660 zcmaKpF-yZh6vzL4Nv=^Yp-M!k0TG0P2rVcMT^egdgrF%@=m*fW(o+)U2%kTK#{qkP!AVAcEU!w9m${4~pW>6hm!zK}}wgJzuTHgNa z%9WQi$M%lj8b?j|Rr>;?!mb*t`|Ag9imzkR4%qP0^vhYcvc^gt&Ea5Qz!Ec74lGe0GJ#^hzr z)bH;X`rO~eo$Bvye1MV|Kh!yM(BD+A+@C+`z@4h`f4BG^9y8W2_&c00bTab3^7)lb F6W`M*VweB` literal 0 HcmV?d00001