diff --git a/src/db/db/dbAsIfFlatEdgePairs.cc b/src/db/db/dbAsIfFlatEdgePairs.cc index 7803bbb23..0876cdc0d 100644 --- a/src/db/db/dbAsIfFlatEdgePairs.cc +++ b/src/db/db/dbAsIfFlatEdgePairs.cc @@ -292,7 +292,7 @@ AsIfFlatEdgePairs::insert_into_as_polygons (Layout *layout, db::cell_index_type db::Shapes &shapes = layout->cell (into_cell).shapes (into_layer); for (EdgePairsIterator e (begin ()); ! e.at_end (); ++e) { - shapes.insert (e->to_simple_polygon (enl)); + shapes.insert (e->normalized ().to_simple_polygon (enl)); } } diff --git a/src/db/db/dbDeepRegion.cc b/src/db/db/dbDeepRegion.cc index 5fa74efe3..0ee8b7195 100644 --- a/src/db/db/dbDeepRegion.cc +++ b/src/db/db/dbDeepRegion.cc @@ -247,7 +247,7 @@ DeepRegion::has_valid_polygons () const bool DeepRegion::has_valid_merged_polygons () const { - return merged_semantics (); + return false; } const db::RecursiveShapeIterator * diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc index 6ee3172bf..b2788f090 100644 --- a/src/db/db/dbDeepShapeStore.cc +++ b/src/db/db/dbDeepShapeStore.cc @@ -873,7 +873,7 @@ DeepShapeStore::insert_as_polygons (const DeepLayer &deep_layer, db::Layout *int if (s->is_edge_pair ()) { - out.insert (s->edge_pair ().to_simple_polygon (enl)); + out.insert (s->edge_pair ().normalized ().to_simple_polygon (enl)); } else if (s->is_path () || s->is_polygon () || s->is_box ()) { diff --git a/src/db/db/dbFlatEdgePairs.cc b/src/db/db/dbFlatEdgePairs.cc index e4a8d50f8..87d8eb689 100644 --- a/src/db/db/dbFlatEdgePairs.cc +++ b/src/db/db/dbFlatEdgePairs.cc @@ -185,7 +185,7 @@ FlatEdgePairs::insert_into_as_polygons (Layout *layout, db::cell_index_type into { db::Shapes &out = layout->cell (into_cell).shapes (into_layer); for (EdgePairsIterator p (begin ()); ! p.at_end (); ++p) { - out.insert (p->to_simple_polygon (enl)); + out.insert (p->normalized ().to_simple_polygon (enl)); } } diff --git a/src/db/db/dbLayoutToNetlist.cc b/src/db/db/dbLayoutToNetlist.cc index 9028e5abe..97cce0100 100644 --- a/src/db/db/dbLayoutToNetlist.cc +++ b/src/db/db/dbLayoutToNetlist.cc @@ -129,7 +129,9 @@ db::Region *LayoutToNetlist::make_layer (const std::string &n) si.shape_flags (db::ShapeIterator::Nothing); std::auto_ptr region (new db::Region (si, dss ())); - register_layer (*region, n); + if (! n.empty ()) { + register_layer (*region, n); + } return region.release (); } @@ -140,7 +142,9 @@ db::Region *LayoutToNetlist::make_layer (unsigned int layer_index, const std::st si.shape_flags (db::ShapeIterator::All); std::auto_ptr region (new db::Region (si, dss ())); - register_layer (*region, n); + if (! n.empty ()) { + register_layer (*region, n); + } return region.release (); } diff --git a/src/db/db/dbLayoutToNetlist.h b/src/db/db/dbLayoutToNetlist.h index 95649d014..9bca6b617 100644 --- a/src/db/db/dbLayoutToNetlist.h +++ b/src/db/db/dbLayoutToNetlist.h @@ -305,6 +305,30 @@ public: */ void set_netlist_extracted (); + /** + * @brief Gets the internal DeepShapeStore object + * + * This method is intended for special cases, i.e. for the master + * LayoutToNetlist object in the DRC environment. The DSS provided + * for DRC needs to be initialized properly for text representation. + */ + db::DeepShapeStore &dss () + { + tl_assert (mp_dss.get () != 0); + return *mp_dss; + } + + /** + * @brief Gets the internal DeepShapeStore object (const version) + * + * See the non-const version for details. + */ + const db::DeepShapeStore &dss () const + { + tl_assert (mp_dss.get () != 0); + return *mp_dss; + } + /** * @brief Gets the internal layout */ @@ -526,18 +550,6 @@ private: bool m_is_flat; db::DeepLayer m_dummy_layer; - db::DeepShapeStore &dss () - { - tl_assert (mp_dss.get () != 0); - return *mp_dss; - } - - const db::DeepShapeStore &dss () const - { - tl_assert (mp_dss.get () != 0); - return *mp_dss; - } - void init (); size_t search_net (const db::ICplxTrans &trans, const db::Cell *cell, const db::local_cluster &test_cluster, std::vector &rev_inst_path); void build_net_rec (const db::Net &net, db::Layout &target, db::Cell &target_cell, const std::map &lmap, const char *net_cell_name_prefix, const char *cell_name_prefix, const char *device_cell_name_prefix, std::map, db::cell_index_type> &cmap, const ICplxTrans &tr) const; diff --git a/src/db/db/dbTestSupport.cc b/src/db/db/dbTestSupport.cc index 3f7798bef..b8b1af7d5 100644 --- a/src/db/db/dbTestSupport.cc +++ b/src/db/db/dbTestSupport.cc @@ -59,9 +59,13 @@ void compare_layouts (tl::TestBase *_this, const db::Layout &layout, const std:: if (norm == WriteGDS2) { tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.gds", hash)); options.set_format ("GDS2"); - } else { + } else if (norm == WriteOAS) { tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.oas", hash)); options.set_format ("OASIS"); + } else { + // write the temp file in the same format than the au file + tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x." + tl::extension (au_file), hash)); + options.set_format_from_filename (tmp_file); } { diff --git a/src/db/unit_tests/dbLayoutToNetlistTests.cc b/src/db/unit_tests/dbLayoutToNetlistTests.cc index 681dff981..730d31ae0 100644 --- a/src/db/unit_tests/dbLayoutToNetlistTests.cc +++ b/src/db/unit_tests/dbLayoutToNetlistTests.cc @@ -2111,7 +2111,11 @@ TEST(9_FlatExtractionWithExternalDSS) db::Cell &tc = ly.cell (*ly.begin_top_down ()); - db::DeepShapeStore dss; + // NOTE: we use a DSS from a LayoutToNetlist object - this one is initialized properly + // with the text representation settings. + db::LayoutToNetlist l2n_master; + db::DeepShapeStore &dss = l2n_master.dss (); + db::LayoutToNetlist l2n (&dss); std::auto_ptr rbulk (new db::Region ()); diff --git a/src/drc/unit_tests/drcBasicTests.cc b/src/drc/unit_tests/drcBasicTests.cc index a5978b6d6..98401cb0c 100644 --- a/src/drc/unit_tests/drcBasicTests.cc +++ b/src/drc/unit_tests/drcBasicTests.cc @@ -30,7 +30,7 @@ TEST(1) std::string input = tl::testsrc (); input += "/testdata/drc/drctest.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcBasicTests_au.oas"; + au += "/testdata/drc/drcBasicTests_au.gds"; std::string output = this->tmp_file ("tmp.gds"); diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc index 4d8c6b11d..a8f69fb4f 100644 --- a/src/drc/unit_tests/drcSimpleTests.cc +++ b/src/drc/unit_tests/drcSimpleTests.cc @@ -31,7 +31,7 @@ TEST(1) rs += "/testdata/drc/drcSimpleTests_1.drc"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au1.oas"; + au += "/testdata/drc/drcSimpleTests_au1.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -71,7 +71,7 @@ TEST(2) input += "/testdata/drc/drctest.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au2.oas"; + au += "/testdata/drc/drcSimpleTests_au2.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -111,7 +111,7 @@ TEST(3_Flat) input += "/testdata/drc/drctest.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au3.oas"; + au += "/testdata/drc/drcSimpleTests_au3.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -151,7 +151,7 @@ TEST(4_Hierarchical) input += "/testdata/drc/drctest.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au4.oas"; + au += "/testdata/drc/drcSimpleTests_au4.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -191,7 +191,7 @@ TEST(5_FlatAntenna) input += "/testdata/drc/antenna_l1.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au5.oas"; + au += "/testdata/drc/drcSimpleTests_au5.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -231,7 +231,7 @@ TEST(6_HierarchicalAntenna) input += "/testdata/drc/antenna_l1.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au6.oas"; + au += "/testdata/drc/drcSimpleTests_au6.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -271,7 +271,7 @@ TEST(7_AntennaWithDiodes) input += "/testdata/drc/antenna_l1.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au7.oas"; + au += "/testdata/drc/drcSimpleTests_au7.gds"; std::string output = this->tmp_file ("tmp.gds"); @@ -311,7 +311,7 @@ TEST(8_TextsAndPolygons) input += "/testdata/drc/texts.gds"; std::string au = tl::testsrc (); - au += "/testdata/drc/drcSimpleTests_au8.oas"; + au += "/testdata/drc/drcSimpleTests_au8.gds"; std::string output = this->tmp_file ("tmp.gds"); diff --git a/testdata/drc/drcBasicTests_au.gds b/testdata/drc/drcBasicTests_au.gds new file mode 100644 index 000000000..594ba23d0 Binary files /dev/null and b/testdata/drc/drcBasicTests_au.gds differ diff --git a/testdata/drc/drcBasicTests_au.oas b/testdata/drc/drcBasicTests_au.oas deleted file mode 100644 index c4c29ffe2..000000000 Binary files a/testdata/drc/drcBasicTests_au.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_1.drc b/testdata/drc/drcSimpleTests_1.drc index 75b575701..28f5bd3a5 100644 --- a/testdata/drc/drcSimpleTests_1.drc +++ b/testdata/drc/drcSimpleTests_1.drc @@ -16,6 +16,6 @@ x.is_box? == false || raise("unexpected value") x.output(10, 0) y = polygon_layer -y.insert(polygon([ p(0, 0), p(0, 1.0), p(2.0, 1.0), p(2.0, 2.0), p(1.0, 2.0), p(1.0, 0) ])) +y.insert(polygon([ p(0, 0), p(0, 1.0), p(2.0, 1.0), p(2.0, 2.0), p(3.0, 2.0), p(3.0, 0) ])) y.output(11, 0) diff --git a/testdata/drc/drcSimpleTests_au1.gds b/testdata/drc/drcSimpleTests_au1.gds new file mode 100644 index 000000000..55a1a97e1 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au1.gds differ diff --git a/testdata/drc/drcSimpleTests_au1.oas b/testdata/drc/drcSimpleTests_au1.oas deleted file mode 100644 index 6cd7e0683..000000000 Binary files a/testdata/drc/drcSimpleTests_au1.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au2.gds b/testdata/drc/drcSimpleTests_au2.gds new file mode 100644 index 000000000..44b1433ab Binary files /dev/null and b/testdata/drc/drcSimpleTests_au2.gds differ diff --git a/testdata/drc/drcSimpleTests_au2.oas b/testdata/drc/drcSimpleTests_au2.oas deleted file mode 100644 index 787eddb7a..000000000 Binary files a/testdata/drc/drcSimpleTests_au2.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au3.gds b/testdata/drc/drcSimpleTests_au3.gds new file mode 100644 index 000000000..5f919587f Binary files /dev/null and b/testdata/drc/drcSimpleTests_au3.gds differ diff --git a/testdata/drc/drcSimpleTests_au3.oas b/testdata/drc/drcSimpleTests_au3.oas deleted file mode 100644 index 7f496f52f..000000000 Binary files a/testdata/drc/drcSimpleTests_au3.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au4.gds b/testdata/drc/drcSimpleTests_au4.gds new file mode 100644 index 000000000..1f3124594 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au4.gds differ diff --git a/testdata/drc/drcSimpleTests_au4.oas b/testdata/drc/drcSimpleTests_au4.oas deleted file mode 100644 index 3a6f5f206..000000000 Binary files a/testdata/drc/drcSimpleTests_au4.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au5.gds b/testdata/drc/drcSimpleTests_au5.gds new file mode 100644 index 000000000..3578cc1c0 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au5.gds differ diff --git a/testdata/drc/drcSimpleTests_au5.oas b/testdata/drc/drcSimpleTests_au5.oas deleted file mode 100644 index f1d5835dc..000000000 Binary files a/testdata/drc/drcSimpleTests_au5.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au6.gds b/testdata/drc/drcSimpleTests_au6.gds new file mode 100644 index 000000000..75a2525f9 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au6.gds differ diff --git a/testdata/drc/drcSimpleTests_au6.oas b/testdata/drc/drcSimpleTests_au6.oas deleted file mode 100644 index 3b7878d85..000000000 Binary files a/testdata/drc/drcSimpleTests_au6.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au7.gds b/testdata/drc/drcSimpleTests_au7.gds new file mode 100644 index 000000000..3fa5aff17 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au7.gds differ diff --git a/testdata/drc/drcSimpleTests_au7.oas b/testdata/drc/drcSimpleTests_au7.oas deleted file mode 100644 index 8deabb567..000000000 Binary files a/testdata/drc/drcSimpleTests_au7.oas and /dev/null differ diff --git a/testdata/drc/drcSimpleTests_au8.gds b/testdata/drc/drcSimpleTests_au8.gds new file mode 100644 index 000000000..86825b3c5 Binary files /dev/null and b/testdata/drc/drcSimpleTests_au8.gds differ diff --git a/testdata/drc/drcSimpleTests_au8.oas b/testdata/drc/drcSimpleTests_au8.oas deleted file mode 100644 index 869056430..000000000 Binary files a/testdata/drc/drcSimpleTests_au8.oas and /dev/null differ diff --git a/testdata/drc/drcSuiteTests.drc b/testdata/drc/drcSuiteTests.drc index 88765993e..0928bbb0a 100644 --- a/testdata/drc/drcSuiteTests.drc +++ b/testdata/drc/drcSuiteTests.drc @@ -14,12 +14,12 @@ def run_testsuite(dm, ic, tiled = false, hier = false) lb = 100 - a = input(RBA::LayerInfo::new(1, 0)) - b = input(2) - c = input(3) - x = input(10) - y = input(11) - empty = input(1000) + a = polygons(RBA::LayerInfo::new(1, 0)) + b = polygons(2) + c = polygons(3) + x = polygons(10) + y = polygons(11) + empty = polygons(1000) h = {} layers.each { |l| h[l] = true } diff --git a/testdata/ruby/dbRegionTest.rb b/testdata/ruby/dbRegionTest.rb index 92f10f144..85cdd27c4 100644 --- a/testdata/ruby/dbRegionTest.rb +++ b/testdata/ruby/dbRegionTest.rb @@ -793,20 +793,12 @@ class DBRegion_TestClass < TestBase def test_15 r = RBA::Region::new - ex = nil - begin - t = r.texts("*", true) - rescue => ex - end - assert_equal(ex.to_s, "Texts can only be identified on an original layer in Region::texts") + t = r.texts("*", true) + assert_equal(t.to_s, "") r.insert(RBA::Box::new(1, 2, 3, 4)) - ex = nil - begin - t = r.texts("*", true) - rescue => ex - end - assert_equal(ex.to_s, "Texts can only be identified on an original layer in Region::texts") + t = r.texts("*", true) + assert_equal(t.to_s, "") ly = RBA::Layout::new top = ly.create_cell("TOP")