diff --git a/src/db/db/dbCompoundOperation.cc b/src/db/db/dbCompoundOperation.cc index 1a8c68732..0efbde07a 100644 --- a/src/db/db/dbCompoundOperation.cc +++ b/src/db/db/dbCompoundOperation.cc @@ -1299,12 +1299,30 @@ CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db:: } void -CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::polygon_ref &p, std::vector &res) const +CompoundRegionProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const { std::vector poly; - mp_proc->process (p.obj ().transformed (p.trans ()), poly); - for (std::vector::const_iterator p = poly.begin (); p != poly.end (); ++p) { - res.push_back (db::PolygonRef (*p, layout->shape_repository ())); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), poly); + + if (! poly.empty ()) { + db::ICplxTrans tri = tr.inverted (); + for (std::vector::const_iterator p = poly.begin (); p != poly.end (); ++p) { + res.push_back (db::PolygonRef (tri * *p, layout->shape_repository ())); + } } } @@ -1349,9 +1367,31 @@ CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db:: } void -CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const { - mp_proc->process (p.obj ().transformed (p.trans ()), res); + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } } // --------------------------------------------------------------------------------------------- @@ -1473,9 +1513,31 @@ CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const } void -CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const +CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const { - mp_proc->process (p.obj ().transformed (p.trans ()), res); + size_t n = res.size (); + mp_proc->process (tr * p, res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } +} + +void +CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const +{ + size_t n = res.size (); + mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res); + + if (res.size () > n) { + db::ICplxTrans tri = tr.inverted (); + for (auto p = res.begin () + n; p != res.end (); ++p) { + p->transform (tri); + } + } } // --------------------------------------------------------------------------------------------- diff --git a/src/db/db/dbCompoundOperation.h b/src/db/db/dbCompoundOperation.h index 04872fa9e..d9cbf840f 100644 --- a/src/db/db/dbCompoundOperation.h +++ b/src/db/db/dbCompoundOperation.h @@ -1138,7 +1138,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1160,23 +1161,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; @@ -1575,7 +1569,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1597,23 +1592,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; @@ -1656,7 +1644,8 @@ private: void processed (db::Layout *, const db::Polygon &p, std::vector &res) const; void processed (db::Layout *layout, const db::PolygonRef &p, std::vector &res) const; - void processed (db::Layout *, const db::polygon_ref &p, std::vector &res) const; + void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector &res) const; + void processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector &res) const; template void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions &interactions, std::vector > &results, const db::LocalProcessorBase *proc) const @@ -1678,23 +1667,16 @@ private: const std::map &vv = proc->vars ()->variants (cell->cell_index ()); tl_assert (vv.size () == 1); const db::ICplxTrans &tr = vv.begin ()->first; - processed (layout, tr * *p, res); - - if (! res.empty ()) { - db::ICplxTrans tri = tr.inverted (); - for (auto r = res.begin (); r != res.end (); ++r) { - results.front ().insert (tri * *r); - } - } + processed (layout, *p, tr, res); } else { processed (layout, *p, res); - results.front ().insert (res.begin (), res.end ()); - } + results.front ().insert (res.begin (), res.end ()); + } } }; diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 3851b72ec..01254fabf 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -1566,3 +1566,54 @@ TEST(70d_props) { run_test (_this, "70", true); } + +TEST(80_deep_with_mag_width) +{ + run_test (_this, "80", true); +} + +TEST(81_deep_with_mag_space) +{ + run_test (_this, "81", true); +} + +TEST(82_deep_with_mag_cop_width) +{ + run_test (_this, "82", true); +} + +TEST(83_deep_with_mag_cop_space) +{ + run_test (_this, "83", true); +} + +TEST(84_deep_with_mag_edge_width) +{ + run_test (_this, "84", true); +} + +TEST(85_deep_with_mag_edge_space) +{ + run_test (_this, "85", true); +} + +TEST(86_deep_with_mag_size) +{ + run_test (_this, "86", true); +} + +TEST(87_deep_with_mag_size_aniso) +{ + run_test (_this, "87", true); +} + +TEST(88_deep_with_mag_cop_size) +{ + run_test (_this, "88", true); +} + +TEST(89_deep_with_mag_cop_size_aniso) +{ + run_test (_this, "89", true); +} + diff --git a/testdata/drc/drcSimpleTests_80.drc b/testdata/drc/drcSimpleTests_80.drc new file mode 100644 index 000000000..9946545a8 --- /dev/null +++ b/testdata/drc/drcSimpleTests_80.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.width(0.4).output(100, 0) +l1.width(0.9).output(101, 0) +l1.width(1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_80.gds b/testdata/drc/drcSimpleTests_80.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_80.gds differ diff --git a/testdata/drc/drcSimpleTests_81.drc b/testdata/drc/drcSimpleTests_81.drc new file mode 100644 index 000000000..a8e887744 --- /dev/null +++ b/testdata/drc/drcSimpleTests_81.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.space(0.4, projection).output(100, 0) +l1.space(0.9, projection).output(101, 0) +l1.space(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_81.gds b/testdata/drc/drcSimpleTests_81.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_81.gds differ diff --git a/testdata/drc/drcSimpleTests_82.drc b/testdata/drc/drcSimpleTests_82.drc new file mode 100644 index 000000000..7ef6bbfc1 --- /dev/null +++ b/testdata/drc/drcSimpleTests_82.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(width < 0.4).output(100, 0) +l1.drc(width < 0.9).output(101, 0) +l1.drc(width < 1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_82.gds b/testdata/drc/drcSimpleTests_82.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_82.gds differ diff --git a/testdata/drc/drcSimpleTests_83.drc b/testdata/drc/drcSimpleTests_83.drc new file mode 100644 index 000000000..a7cd252ed --- /dev/null +++ b/testdata/drc/drcSimpleTests_83.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(space(projection) < 0.4).output(100, 0) +l1.drc(space(projection) < 0.9).output(101, 0) +l1.drc(space(projection) < 1.1).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_83.gds b/testdata/drc/drcSimpleTests_83.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_83.gds differ diff --git a/testdata/drc/drcSimpleTests_84.drc b/testdata/drc/drcSimpleTests_84.drc new file mode 100644 index 000000000..09b92ff10 --- /dev/null +++ b/testdata/drc/drcSimpleTests_84.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.edges.width(0.4, projection).output(100, 0) +l1.edges.width(0.9, projection).output(101, 0) +l1.edges.width(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_84.gds b/testdata/drc/drcSimpleTests_84.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_84.gds differ diff --git a/testdata/drc/drcSimpleTests_85.drc b/testdata/drc/drcSimpleTests_85.drc new file mode 100644 index 000000000..3e687fd35 --- /dev/null +++ b/testdata/drc/drcSimpleTests_85.drc @@ -0,0 +1,14 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.edges.space(0.4, projection).output(100, 0) +l1.edges.space(0.9, projection).output(101, 0) +l1.edges.space(1.1, projection).output(102, 0) + diff --git a/testdata/drc/drcSimpleTests_85.gds b/testdata/drc/drcSimpleTests_85.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_85.gds differ diff --git a/testdata/drc/drcSimpleTests_86.drc b/testdata/drc/drcSimpleTests_86.drc new file mode 100644 index 000000000..bbd8c275c --- /dev/null +++ b/testdata/drc/drcSimpleTests_86.drc @@ -0,0 +1,13 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.sized(0.2).output(100, 0) +l1.sized(-0.2).output(101, 0) + diff --git a/testdata/drc/drcSimpleTests_86.gds b/testdata/drc/drcSimpleTests_86.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_86.gds differ diff --git a/testdata/drc/drcSimpleTests_87.drc b/testdata/drc/drcSimpleTests_87.drc new file mode 100644 index 000000000..b62b98fc5 --- /dev/null +++ b/testdata/drc/drcSimpleTests_87.drc @@ -0,0 +1,15 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.sized(0.2, 0.0).output(100, 0) +l1.sized(0.0, 0.2).output(101, 0) +l1.sized(-0.2, 0.0).output(102, 0) +l1.sized(0.0, -0.2).output(103, 0) + diff --git a/testdata/drc/drcSimpleTests_87.gds b/testdata/drc/drcSimpleTests_87.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_87.gds differ diff --git a/testdata/drc/drcSimpleTests_88.drc b/testdata/drc/drcSimpleTests_88.drc new file mode 100644 index 000000000..3511ba220 --- /dev/null +++ b/testdata/drc/drcSimpleTests_88.drc @@ -0,0 +1,13 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(sized(0.2)).output(100, 0) +l1.drc(sized(-0.2)).output(101, 0) + diff --git a/testdata/drc/drcSimpleTests_88.gds b/testdata/drc/drcSimpleTests_88.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_88.gds differ diff --git a/testdata/drc/drcSimpleTests_89.drc b/testdata/drc/drcSimpleTests_89.drc new file mode 100644 index 000000000..88bfc5616 --- /dev/null +++ b/testdata/drc/drcSimpleTests_89.drc @@ -0,0 +1,15 @@ + +source $drc_test_source +target $drc_test_target + +deep + +l1 = input(1, 0) + +l1.output(1, 0) + +l1.drc(sized(0.2, 0.0)).output(100, 0) +l1.drc(sized(0.0, 0.2)).output(101, 0) +l1.drc(sized(-0.2, 0.0)).output(102, 0) +l1.drc(sized(0.0, -0.2)).output(103, 0) + diff --git a/testdata/drc/drcSimpleTests_89.gds b/testdata/drc/drcSimpleTests_89.gds new file mode 100644 index 000000000..e75eba2b2 Binary files /dev/null and b/testdata/drc/drcSimpleTests_89.gds differ diff --git a/testdata/drc/drcSimpleTests_au80d.gds b/testdata/drc/drcSimpleTests_au80d.gds new file mode 100644 index 000000000..ab0ede5cf Binary files /dev/null and b/testdata/drc/drcSimpleTests_au80d.gds differ diff --git a/testdata/drc/drcSimpleTests_au81d.gds b/testdata/drc/drcSimpleTests_au81d.gds new file mode 100644 index 000000000..f77e37607 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au81d.gds differ diff --git a/testdata/drc/drcSimpleTests_au82d.gds b/testdata/drc/drcSimpleTests_au82d.gds new file mode 100644 index 000000000..9dafc2419 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au82d.gds differ diff --git a/testdata/drc/drcSimpleTests_au83d.gds b/testdata/drc/drcSimpleTests_au83d.gds new file mode 100644 index 000000000..e08d1822f Binary files /dev/null and b/testdata/drc/drcSimpleTests_au83d.gds differ diff --git a/testdata/drc/drcSimpleTests_au84d.gds b/testdata/drc/drcSimpleTests_au84d.gds new file mode 100644 index 000000000..2e953ee33 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au84d.gds differ diff --git a/testdata/drc/drcSimpleTests_au85d.gds b/testdata/drc/drcSimpleTests_au85d.gds new file mode 100644 index 000000000..a2017414e Binary files /dev/null and b/testdata/drc/drcSimpleTests_au85d.gds differ diff --git a/testdata/drc/drcSimpleTests_au86d.gds b/testdata/drc/drcSimpleTests_au86d.gds new file mode 100644 index 000000000..57d031c71 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au86d.gds differ diff --git a/testdata/drc/drcSimpleTests_au87d.gds b/testdata/drc/drcSimpleTests_au87d.gds new file mode 100644 index 000000000..7c21bafe5 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au87d.gds differ diff --git a/testdata/drc/drcSimpleTests_au88d.gds b/testdata/drc/drcSimpleTests_au88d.gds new file mode 100644 index 000000000..dc6d85c8f Binary files /dev/null and b/testdata/drc/drcSimpleTests_au88d.gds differ diff --git a/testdata/drc/drcSimpleTests_au89d.gds b/testdata/drc/drcSimpleTests_au89d.gds new file mode 100644 index 000000000..30e6602d1 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au89d.gds differ