diff --git a/src/db/db/dbAsIfFlatRegion.cc b/src/db/db/dbAsIfFlatRegion.cc index b6b3a80b7..aa66e3d1e 100644 --- a/src/db/db/dbAsIfFlatRegion.cc +++ b/src/db/db/dbAsIfFlatRegion.cc @@ -1428,12 +1428,12 @@ AsIfFlatRegion::not_with (const Region &other, PropertyConstraint property_const } else if (other.empty () && ! strict_handling ()) { // Nothing to do - return clone (); + return clone ()->remove_properties (pc_remove (property_constraint)); } else if (! bbox ().overlaps (other.bbox ()) && ! strict_handling ()) { // Nothing to do - return clone (); + return clone ()->remove_properties (pc_remove (property_constraint)); } else { return and_or_not_with (false, other, property_constraint); @@ -1513,12 +1513,12 @@ AsIfFlatRegion::andnot_with (const Region &other, PropertyConstraint property_co } else if (other.empty () && ! strict_handling ()) { // Nothing to do - return std::make_pair (new EmptyRegion (), clone ()); + return std::make_pair (new EmptyRegion (), clone ()->remove_properties (pc_remove (property_constraint))); } else if (! bbox ().overlaps (other.bbox ()) && ! strict_handling ()) { // Nothing to do - return std::make_pair (new EmptyRegion (), clone ()); + return std::make_pair (new EmptyRegion (), clone ()->remove_properties (pc_remove (property_constraint))); } else if (pc_skip (property_constraint)) { diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index c0630158d..0d7d725de 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -783,11 +783,11 @@ DeepRegion::and_with (const Region &other, PropertyConstraint property_constrain if (empty ()) { - return clone (); + return clone ()->remove_properties (pc_remove (property_constraint)); } else if (other.empty ()) { - return other.delegate ()->clone (); + return other.delegate ()->clone ()->remove_properties (pc_remove (property_constraint)); } else if (! other_deep) { @@ -807,7 +807,7 @@ DeepRegion::not_with (const Region &other, PropertyConstraint property_constrain if (empty () || other.empty ()) { - return clone (); + return clone ()->remove_properties (pc_remove (property_constraint)); } else if (! other_deep) { @@ -835,11 +835,11 @@ DeepRegion::andnot_with (const Region &other, PropertyConstraint property_constr if (empty ()) { - return std::make_pair (clone (), clone ()); + return std::make_pair (clone ()->remove_properties (pc_remove (property_constraint)), clone ()->remove_properties (pc_remove (property_constraint))); } else if (other.empty ()) { - return std::make_pair (other.delegate ()->clone (), clone ()); + return std::make_pair (other.delegate ()->clone ()->remove_properties (pc_remove (property_constraint)), clone ()->remove_properties (pc_remove (property_constraint))); } else if (! other_deep) { diff --git a/src/db/db/dbEdgePairsDelegate.h b/src/db/db/dbEdgePairsDelegate.h index 4ea093ede..6cdf92e5c 100644 --- a/src/db/db/dbEdgePairsDelegate.h +++ b/src/db/db/dbEdgePairsDelegate.h @@ -166,6 +166,12 @@ public: virtual EdgePairsDelegate *clone () const = 0; + EdgePairsDelegate *remove_properties (bool remove = true) + { + ShapeCollectionDelegateBase::remove_properties (remove); + return this; + } + void enable_progress (const std::string &progress_desc); void disable_progress (); diff --git a/src/db/db/dbEdgesDelegate.h b/src/db/db/dbEdgesDelegate.h index cba4e40f9..182700bae 100644 --- a/src/db/db/dbEdgesDelegate.h +++ b/src/db/db/dbEdgesDelegate.h @@ -239,6 +239,12 @@ public: virtual EdgesDelegate *clone () const = 0; + EdgesDelegate *remove_properties (bool remove = true) + { + ShapeCollectionDelegateBase::remove_properties (remove); + return this; + } + void set_base_verbosity (int vb); int base_verbosity () const { diff --git a/src/db/db/dbFlatEdgePairs.cc b/src/db/db/dbFlatEdgePairs.cc index 5204387db..eff3816fe 100644 --- a/src/db/db/dbFlatEdgePairs.cc +++ b/src/db/db/dbFlatEdgePairs.cc @@ -192,11 +192,15 @@ const db::RecursiveShapeIterator *FlatEdgePairs::iter () const void FlatEdgePairs::apply_property_translator (const db::PropertiesTranslator &pt) { - db::Shapes new_edge_pairs (mp_edge_pairs->is_editable ()); - new_edge_pairs.assign (*mp_edge_pairs, pt); - mp_edge_pairs->swap (new_edge_pairs); + if ((mp_edge_pairs->type_mask () & db::ShapeIterator::Properties) != 0) { - invalidate_cache (); + db::Shapes new_edge_pairs (mp_edge_pairs->is_editable ()); + new_edge_pairs.assign (*mp_edge_pairs, pt); + mp_edge_pairs->swap (new_edge_pairs); + + invalidate_cache (); + + } } db::PropertiesRepository *FlatEdgePairs::properties_repository () diff --git a/src/db/db/dbFlatEdges.cc b/src/db/db/dbFlatEdges.cc index e185fc5e6..5e386c431 100644 --- a/src/db/db/dbFlatEdges.cc +++ b/src/db/db/dbFlatEdges.cc @@ -390,11 +390,15 @@ const db::RecursiveShapeIterator *FlatEdges::iter () const void FlatEdges::apply_property_translator (const db::PropertiesTranslator &pt) { - db::Shapes new_edges (mp_edges->is_editable ()); - new_edges.assign (*mp_edges, pt); - mp_edges->swap (new_edges); + if ((mp_edges->type_mask () & db::ShapeIterator::Properties) != 0) { - invalidate_cache (); + db::Shapes new_edges (mp_edges->is_editable ()); + new_edges.assign (*mp_edges, pt); + mp_edges->swap (new_edges); + + invalidate_cache (); + + } } db::PropertiesRepository *FlatEdges::properties_repository () diff --git a/src/db/db/dbFlatRegion.cc b/src/db/db/dbFlatRegion.cc index 248b9121a..307984b9d 100644 --- a/src/db/db/dbFlatRegion.cc +++ b/src/db/db/dbFlatRegion.cc @@ -421,11 +421,15 @@ const db::RecursiveShapeIterator *FlatRegion::iter () const void FlatRegion::apply_property_translator (const db::PropertiesTranslator &pt) { - db::Shapes new_polygons (mp_polygons->is_editable ()); - new_polygons.assign (*mp_polygons, pt); - mp_polygons->swap (new_polygons); + if ((mp_polygons->type_mask () & db::ShapeIterator::Properties) != 0) { - invalidate_cache (); + db::Shapes new_polygons (mp_polygons->is_editable ()); + new_polygons.assign (*mp_polygons, pt); + mp_polygons->swap (new_polygons); + + invalidate_cache (); + + } } db::PropertiesRepository *FlatRegion::properties_repository () diff --git a/src/db/db/dbFlatTexts.cc b/src/db/db/dbFlatTexts.cc index 3b00b400a..26a718116 100644 --- a/src/db/db/dbFlatTexts.cc +++ b/src/db/db/dbFlatTexts.cc @@ -190,11 +190,15 @@ const db::RecursiveShapeIterator *FlatTexts::iter () const void FlatTexts::apply_property_translator (const db::PropertiesTranslator &pt) { - db::Shapes new_texts (mp_texts->is_editable ()); - new_texts.assign (*mp_texts, pt); - mp_texts->swap (new_texts); + if ((mp_texts->type_mask () & db::ShapeIterator::Properties) != 0) { - invalidate_cache (); + db::Shapes new_texts (mp_texts->is_editable ()); + new_texts.assign (*mp_texts, pt); + mp_texts->swap (new_texts); + + invalidate_cache (); + + } } db::PropertiesRepository *FlatTexts::properties_repository () diff --git a/src/db/db/dbRegionDelegate.h b/src/db/db/dbRegionDelegate.h index d4ccac4a2..1b701f26d 100644 --- a/src/db/db/dbRegionDelegate.h +++ b/src/db/db/dbRegionDelegate.h @@ -196,6 +196,12 @@ public: virtual RegionDelegate *clone () const = 0; + RegionDelegate *remove_properties (bool remove = true) + { + ShapeCollectionDelegateBase::remove_properties (remove); + return this; + } + void set_base_verbosity (int vb); int base_verbosity () const { diff --git a/src/db/db/dbShapeCollection.cc b/src/db/db/dbShapeCollection.cc index 4d5a3a0fc..ba1eb224b 100644 --- a/src/db/db/dbShapeCollection.cc +++ b/src/db/db/dbShapeCollection.cc @@ -55,11 +55,16 @@ DeepShapeCollectionDelegateBase::apply_property_translator (const db::Properties for (auto c = layout.begin (); c != layout.end (); ++c) { db::Shapes &shapes = c->shapes (m_deep_layer.layer ()); + if ((shapes.type_mask () & ShapeIterator::Properties) != 0) { - db::Shapes new_shapes (shapes.is_editable ()); - shapes.swap (new_shapes); + // properties are present - need to translate them - shapes.assign (new_shapes, pt); + db::Shapes new_shapes (shapes.is_editable ()); + shapes.swap (new_shapes); + + shapes.assign (new_shapes, pt); + + } } } diff --git a/src/db/db/dbShapeCollection.h b/src/db/db/dbShapeCollection.h index 4e4824811..a036e0887 100644 --- a/src/db/db/dbShapeCollection.h +++ b/src/db/db/dbShapeCollection.h @@ -83,6 +83,13 @@ public: virtual void apply_property_translator (const db::PropertiesTranslator & /*pt*/) = 0; virtual db::PropertiesRepository *properties_repository () = 0; virtual const db::PropertiesRepository *properties_repository () const = 0; + + void remove_properties (bool remove = true) + { + if (remove) { + apply_property_translator (db::PropertiesTranslator::make_remove_all ()); + } + } }; /** diff --git a/src/db/db/dbTextsDelegate.h b/src/db/db/dbTextsDelegate.h index 367ced7f1..726714dad 100644 --- a/src/db/db/dbTextsDelegate.h +++ b/src/db/db/dbTextsDelegate.h @@ -66,6 +66,12 @@ public: virtual TextsDelegate *clone () const = 0; + TextsDelegate *remove_properties (bool remove = true) + { + ShapeCollectionDelegateBase::remove_properties (remove); + return this; + } + void enable_progress (const std::string &progress_desc); void disable_progress (); diff --git a/src/db/unit_tests/dbAsIfFlatRegionTests.cc b/src/db/unit_tests/dbAsIfFlatRegionTests.cc index 91333e70f..124ac5f15 100644 --- a/src/db/unit_tests/dbAsIfFlatRegionTests.cc +++ b/src/db/unit_tests/dbAsIfFlatRegionTests.cc @@ -1688,6 +1688,12 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (25, 0)), r3.bool_and (r2, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (26, 0)), r1.bool_and (r3, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (27, 0)), r1.bool_and (r3, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (22, 1)), r1.bool_and (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (23, 1)), r1.bool_and (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (24, 1)), r3.bool_and (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (25, 1)), r3.bool_and (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (26, 1)), r1.bool_and (r3, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (27, 1)), r1.bool_and (r3, db::DifferentPropertiesConstraintDrop)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 0)), r1 - r2); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.bool_not (r2, db::NoPropertyConstraint)); @@ -1697,6 +1703,12 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (35, 0)), r3.bool_not (r2, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (36, 0)), r1.bool_not (r3, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (37, 0)), r1.bool_not (r3, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r1.bool_not (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (33, 1)), r1.bool_not (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (34, 1)), r3.bool_not (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (35, 1)), r3.bool_not (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (36, 1)), r1.bool_not (r3, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (37, 1)), r1.bool_not (r3, db::DifferentPropertiesConstraintDrop)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.andnot (r2).first); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.andnot (r2).second); @@ -1712,6 +1724,18 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (51, 0)), r1.andnot (r3, db::SamePropertiesConstraint).second); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (52, 0)), r1.andnot (r3, db::DifferentPropertiesConstraint).first); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (53, 0)), r1.andnot (r3, db::DifferentPropertiesConstraint).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r1.andnot (r2, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (43, 1)), r1.andnot (r2, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (44, 1)), r1.andnot (r2, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (45, 1)), r1.andnot (r2, db::DifferentPropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (46, 1)), r3.andnot (r2, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (47, 1)), r3.andnot (r2, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (48, 1)), r3.andnot (r2, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (49, 1)), r3.andnot (r2, db::DifferentPropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (50, 1)), r1.andnot (r3, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (51, 1)), r1.andnot (r3, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (52, 1)), r1.andnot (r3, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (53, 1)), r1.andnot (r3, db::DifferentPropertiesConstraintDrop).second); CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/flat_region_au40.gds"); @@ -1829,12 +1853,24 @@ TEST(42_DRCWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.separation_check (r2, 1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 0)), r2.space_check (1000, opt)); + opt.prop_constraint = db::SamePropertiesConstraintDrop; + + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 1)), r1.space_check (1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 1)), r1.separation_check (r2, 1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r2.space_check (1000, opt)); + opt.prop_constraint = db::DifferentPropertiesConstraint; target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.space_check (1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.separation_check (r2, 1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 0)), r2.space_check (1000, opt)); + opt.prop_constraint = db::DifferentPropertiesConstraintDrop; + + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 1)), r1.space_check (1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 1)), r1.separation_check (r2, 1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r2.space_check (1000, opt)); + CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/flat_region_au42.gds"); } @@ -1896,10 +1932,18 @@ TEST(43_ComplexOpsWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.cop_to_region (sep_check2p, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 0)), r1.cop_to_edges (sep_check2e, db::SamePropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 1)), r1.cop_to_edge_pairs (sep_check, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 1)), r1.cop_to_region (sep_check2p, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r1.cop_to_edges (sep_check2e, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.cop_to_edge_pairs (sep_check, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.cop_to_region (sep_check2p, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 0)), r1.cop_to_edges (sep_check2e, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 1)), r1.cop_to_edge_pairs (sep_check, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 1)), r1.cop_to_region (sep_check2p, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r1.cop_to_edges (sep_check2e, db::DifferentPropertiesConstraintDrop)); + CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/flat_region_au43.gds"); } @@ -1932,9 +1976,6 @@ TEST(44_SizeWithProperties) db::Layout target; unsigned int target_top_cell_index = target.add_cell (ly.cell_name (top_cell_index)); - db::RegionCheckOptions opt; - opt.metrics = db::Projection; - target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (1, 0)), r1); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (2, 0)), r2); diff --git a/src/db/unit_tests/dbDeepRegionTests.cc b/src/db/unit_tests/dbDeepRegionTests.cc index 6cf0658d5..89117d591 100644 --- a/src/db/unit_tests/dbDeepRegionTests.cc +++ b/src/db/unit_tests/dbDeepRegionTests.cc @@ -2176,6 +2176,12 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (25, 0)), r3.bool_and (r2, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (26, 0)), r1.bool_and (r3, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (27, 0)), r1.bool_and (r3, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (22, 1)), r1.bool_and (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (23, 1)), r1.bool_and (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (24, 1)), r3.bool_and (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (25, 1)), r3.bool_and (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (26, 1)), r1.bool_and (r3, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (27, 1)), r1.bool_and (r3, db::DifferentPropertiesConstraintDrop)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 0)), r1 - r2); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.bool_not (r2, db::NoPropertyConstraint)); @@ -2185,6 +2191,12 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (35, 0)), r3.bool_not (r2, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (36, 0)), r1.bool_not (r3, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (37, 0)), r1.bool_not (r3, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r1.bool_not (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (33, 1)), r1.bool_not (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (34, 1)), r3.bool_not (r2, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (35, 1)), r3.bool_not (r2, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (36, 1)), r1.bool_not (r3, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (37, 1)), r1.bool_not (r3, db::DifferentPropertiesConstraintDrop)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.andnot (r2).first); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.andnot (r2).second); @@ -2200,6 +2212,18 @@ TEST(40_BoolWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (51, 0)), r1.andnot (r3, db::SamePropertiesConstraint).second); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (52, 0)), r1.andnot (r3, db::DifferentPropertiesConstraint).first); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (53, 0)), r1.andnot (r3, db::DifferentPropertiesConstraint).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r1.andnot (r2, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (43, 1)), r1.andnot (r2, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (44, 1)), r1.andnot (r2, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (45, 1)), r1.andnot (r2, db::DifferentPropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (46, 1)), r3.andnot (r2, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (47, 1)), r3.andnot (r2, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (48, 1)), r3.andnot (r2, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (49, 1)), r3.andnot (r2, db::DifferentPropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (50, 1)), r1.andnot (r3, db::SamePropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (51, 1)), r1.andnot (r3, db::SamePropertiesConstraintDrop).second); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (52, 1)), r1.andnot (r3, db::DifferentPropertiesConstraintDrop).first); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (53, 1)), r1.andnot (r3, db::DifferentPropertiesConstraintDrop).second); CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/deep_region_au40.gds"); @@ -2321,12 +2345,24 @@ TEST(42_DRCWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.separation_check (r2, 1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 0)), r2.space_check (1000, opt)); + opt.prop_constraint = db::SamePropertiesConstraintDrop; + + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 1)), r1.space_check (1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 1)), r1.separation_check (r2, 1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r2.space_check (1000, opt)); + opt.prop_constraint = db::DifferentPropertiesConstraint; target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.space_check (1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.separation_check (r2, 1000, opt)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 0)), r2.space_check (1000, opt)); + opt.prop_constraint = db::DifferentPropertiesConstraintDrop; + + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 1)), r1.space_check (1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 1)), r1.separation_check (r2, 1000, opt)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r2.space_check (1000, opt)); + CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/deep_region_au42.gds"); } @@ -2390,10 +2426,18 @@ TEST(43_ComplexOpsWithProperties) target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 0)), r1.cop_to_region (sep_check2p, db::SamePropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 0)), r1.cop_to_edges (sep_check2e, db::SamePropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (30, 1)), r1.cop_to_edge_pairs (sep_check, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (31, 1)), r1.cop_to_region (sep_check2p, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (32, 1)), r1.cop_to_edges (sep_check2e, db::SamePropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 0)), r1.cop_to_edge_pairs (sep_check, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 0)), r1.cop_to_region (sep_check2p, db::DifferentPropertiesConstraint)); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 0)), r1.cop_to_edges (sep_check2e, db::DifferentPropertiesConstraint)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (40, 1)), r1.cop_to_edge_pairs (sep_check, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (41, 1)), r1.cop_to_region (sep_check2p, db::DifferentPropertiesConstraintDrop)); + target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (42, 1)), r1.cop_to_edges (sep_check2e, db::DifferentPropertiesConstraintDrop)); + CHECKPOINT(); db::compare_layouts (_this, target, tl::testdata () + "/algo/deep_region_au43.gds"); } @@ -2428,9 +2472,6 @@ TEST(44_SizeWithProperties) db::Layout target; unsigned int target_top_cell_index = target.add_cell (ly.cell_name (top_cell_index)); - db::RegionCheckOptions opt; - opt.metrics = db::Projection; - target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (1, 0)), r1); target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (2, 0)), r2); diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb index a5bd6286d..b3c1c82f4 100644 --- a/src/drc/drc/built-in-macros/_drc_engine.rb +++ b/src/drc/drc/built-in-macros/_drc_engine.rb @@ -318,13 +318,13 @@ module DRC def props_eq self._context("props_eq") do - DRCPropertiesConstraint::new(RBA::Region::SamePropertiesConstraint) + DRCPropertiesConstraint::new(RBA::Region::SamePropertiesConstraintDrop) end end def props_ne self._context("props_ne") do - DRCPropertiesConstraint::new(RBA::Region::DifferentPropertiesConstraint) + DRCPropertiesConstraint::new(RBA::Region::DifferentPropertiesConstraintDrop) end end diff --git a/testdata/algo/deep_region_au40.gds b/testdata/algo/deep_region_au40.gds index c6764b0b6..84d6d4969 100644 Binary files a/testdata/algo/deep_region_au40.gds and b/testdata/algo/deep_region_au40.gds differ diff --git a/testdata/algo/deep_region_au42.gds b/testdata/algo/deep_region_au42.gds index 6fa76a15f..7a633c745 100644 Binary files a/testdata/algo/deep_region_au42.gds and b/testdata/algo/deep_region_au42.gds differ diff --git a/testdata/algo/deep_region_au43.gds b/testdata/algo/deep_region_au43.gds index c65a1ecc3..857661a5b 100644 Binary files a/testdata/algo/deep_region_au43.gds and b/testdata/algo/deep_region_au43.gds differ diff --git a/testdata/algo/flat_region_au40.gds b/testdata/algo/flat_region_au40.gds index bb410687a..682ed0746 100644 Binary files a/testdata/algo/flat_region_au40.gds and b/testdata/algo/flat_region_au40.gds differ diff --git a/testdata/algo/flat_region_au42.gds b/testdata/algo/flat_region_au42.gds index 3f846fdd6..7963f8104 100644 Binary files a/testdata/algo/flat_region_au42.gds and b/testdata/algo/flat_region_au42.gds differ diff --git a/testdata/algo/flat_region_au43.gds b/testdata/algo/flat_region_au43.gds index 33db39033..5295c4d6a 100644 Binary files a/testdata/algo/flat_region_au43.gds and b/testdata/algo/flat_region_au43.gds differ diff --git a/testdata/drc/drcSimpleTests_70.drc b/testdata/drc/drcSimpleTests_70.drc index 860fe612c..c39b4556f 100644 --- a/testdata/drc/drcSimpleTests_70.drc +++ b/testdata/drc/drcSimpleTests_70.drc @@ -84,6 +84,8 @@ l1_nets.space(1.0.um, projection, props_ne + props_copy).polygons.output(202, 0) l1_nets.space(1.0.um, projection, props_copy).polygons.output(203, 0) l1_nets.width(1.0.um, projection).polygons.output(204, 0) l1_nets.width(1.0.um, projection, props_copy).polygons.output(205, 0) +l1_nets.space(1.0.um, projection, props_eq).polygons.output(206, 0) +l1_nets.space(1.0.um, projection, props_ne).polygons.output(207, 0) l1_nets.drc(space(projection) < 1.0.um).polygons.output(210, 0) l1_nets.drc(space(projection) < 1.0.um, props_eq + props_copy).polygons.output(211, 0) @@ -91,6 +93,8 @@ l1_nets.drc(space(projection) < 1.0.um, props_ne + props_copy).polygons.output(2 l1_nets.drc(space(projection) < 1.0.um, props_copy).polygons.output(213, 0) l1_nets.drc(width(projection) < 1.0.um).polygons.output(214, 0) l1_nets.drc(width(projection) < 1.0.um, props_copy).polygons.output(215, 0) +l1_nets.drc(space(projection) < 1.0.um, props_eq).polygons.output(216, 0) +l1_nets.drc(space(projection) < 1.0.um, props_ne).polygons.output(217, 0) # edge pair to edge/polygon conversion with properties @@ -104,9 +108,12 @@ l1_nets.space(1.0.um, projection, props_copy).edges.extended_in(10.nm).output(22 l1_nets_sized = l1_nets.sized(0.2.um) l1_nets_sized.and(l1_nets_sized, props_ne + props_copy).output(300, 0) # overlap of different nets, same layer +l1_nets_sized.and(l1_nets_sized, props_ne).output(301, 0) l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um)).output(310, 0) l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_ne + props_copy).output(311, 0) l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_eq + props_copy).output(312, 0) l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_copy).output(313, 0) +l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_ne).output(314, 0) +l1_nets.drc(primary.sized(0.2.um) & foreign.sized(0.2.um), props_eq).output(315, 0) diff --git a/testdata/drc/drcSimpleTests_au70.gds b/testdata/drc/drcSimpleTests_au70.gds index bd9736eb5..ffe5a38a3 100644 Binary files a/testdata/drc/drcSimpleTests_au70.gds and b/testdata/drc/drcSimpleTests_au70.gds differ diff --git a/testdata/drc/drcSimpleTests_au70d.gds b/testdata/drc/drcSimpleTests_au70d.gds index 7cac4fb6b..a4339e558 100644 Binary files a/testdata/drc/drcSimpleTests_au70d.gds and b/testdata/drc/drcSimpleTests_au70d.gds differ