From feda8680cad12bf001a73e1b08d7f23186e822e4 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 6 Sep 2025 19:15:12 +0200 Subject: [PATCH] WIP: exclude area implemented. Needs optimization. --- src/db/db/dbFillTool.cc | 14 ++++---------- src/db/db/gsiDeclDbRegion.cc | 6 +++--- src/drc/drc/built-in-macros/_drc_layer.rb | 6 +++++- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/db/db/dbFillTool.cc b/src/db/db/dbFillTool.cc index 0cd298fe2..cf08a437a 100644 --- a/src/db/db/dbFillTool.cc +++ b/src/db/db/dbFillTool.cc @@ -319,11 +319,11 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f if (! exclude_area.empty ()) { - auto iter = exclude_area.iter (); - iter.confine_region (fp0.box ()); + auto it = exclude_area.begin_iter (); + it.first.confine_region (fp0.box ()); // over- and undersize the polygons to fill gaps that cannot be filled. - db::Region excluded (iter); + db::Region excluded (it.first, it.second); excluded.size (dx, 0); excluded.size (-dx, 0); excluded.size (dy, 0); @@ -332,16 +332,12 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f if (enhanced_fill || remaining_parts != 0) { - tl::warn << "@@@ using booleans for exclude"; - // In enhanced fill or if the remaining parts are requested, it is better to implement the // exclude area by a boolean NOT fr -= excluded; } else { - tl::warn << "@@@ using exclude area rasterizer"; - // Otherwise use a second rasterizer for the exclude polygons that must have a zero pixel coverage for the // pixel to be filled. @@ -437,9 +433,7 @@ fill_polygon_impl (db::Cell *cell, const db::Polygon &fp0, db::cell_index_type f if (remaining_parts) { db::EdgeProcessor ep; - std::vector fp1; - fp1.push_back (fp0); - ep.boolean (fp1, filled_regions, *remaining_parts, db::BooleanOp::ANotB, false /*=don't resolve holes*/); + ep.boolean (filled_poly, filled_regions, *remaining_parts, db::BooleanOp::ANotB, false /*=don't resolve holes*/); } return true; diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc index 870927267..386fcfee4 100644 --- a/src/db/db/gsiDeclDbRegion.cc +++ b/src/db/db/gsiDeclDbRegion.cc @@ -4345,7 +4345,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n" "\n" - "This method has been introduced in version 0.27.\n" + "This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n" ) + gsi::method_ext ("fill", &fill_region_skew, gsi::arg ("in_cell"), gsi::arg ("fill_cell_index"), @@ -4362,7 +4362,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n" "\n" - "This method has been introduced in version 0.27.\n" + "This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n" ) + gsi::method_ext ("fill_multi", &fill_region_multi, gsi::arg ("in_cell"), gsi::arg ("fill_cell_index"), @@ -4377,7 +4377,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region", "\n" "This method is equivalent to \\Cell#fill_region, but is based on Region (with the cell being the first parameter).\n" "\n" - "This method has been introduced in version 0.27.\n" + "This method has been introduced in version 0.27. The 'exclude_area' argument has been added in version 0.30.4.\n" ) + gsi::method_ext ("nets", &nets, gsi::arg ("extracted"), gsi::arg ("net_prop_name", tl::Variant (), "nil"), gsi::arg ("net_filter", (const std::vector *) (0), "nil"), "@brief Pulls the net shapes from a LayoutToNetlist database\n" diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb index b672bd877..44466da10 100644 --- a/src/drc/drc/built-in-macros/_drc_layer.rb +++ b/src/drc/drc/built-in-macros/_drc_layer.rb @@ -5897,7 +5897,7 @@ CODE pattern = nil origin = RBA::DPoint::new repeat = false - excl = RBA::Region::new + excl = nil args.each_with_index do |a,ai| if a.is_a?(DRCSource) @@ -5946,6 +5946,10 @@ CODE column_step = RBA::DVector::new(0, pattern.default_ypitch) end + if !excl + excl = RBA::Region::new + end + dbu_trans = RBA::VCplxTrans::new(1.0 / @engine.dbu) result = nil