A few bug fixes and test updates

- edge pairs are normalized before turning them into polygons.
  This makes flat and deep implementation more consistent.
- deep region and flat regions were not cooperating in geo
  checks
- unnamed layers are not registered in make_layer - this
  does not make sense and will just hold a fake ref
- tests now use GDS to represent texts after transformation
  (with orientation, OASIS can't do this)
- texts are more consistently handled in the tests
- test debug output is not written in the same format
  than golden data unless special normalization is
  requested.
- a non-orientable polygon was converted to orientable in
  a text because this can be represented in GDS consistently
- DRC testsuite uses "polygons" instead of "input" to achieve
  identical behavior for deep and flat mode with respect to
  texts
- dbRegionTests are updated because texts are not allowed
  for non-original layers too
This commit is contained in:
Matthias Koefferlein
2019-03-09 19:40:38 +01:00
parent 745696507f
commit 6932977273
31 changed files with 64 additions and 48 deletions
+1 -1
View File
@@ -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); db::Shapes &shapes = layout->cell (into_cell).shapes (into_layer);
for (EdgePairsIterator e (begin ()); ! e.at_end (); ++e) { for (EdgePairsIterator e (begin ()); ! e.at_end (); ++e) {
shapes.insert (e->to_simple_polygon (enl)); shapes.insert (e->normalized ().to_simple_polygon (enl));
} }
} }
+1 -1
View File
@@ -247,7 +247,7 @@ DeepRegion::has_valid_polygons () const
bool bool
DeepRegion::has_valid_merged_polygons () const DeepRegion::has_valid_merged_polygons () const
{ {
return merged_semantics (); return false;
} }
const db::RecursiveShapeIterator * const db::RecursiveShapeIterator *
+1 -1
View File
@@ -873,7 +873,7 @@ DeepShapeStore::insert_as_polygons (const DeepLayer &deep_layer, db::Layout *int
if (s->is_edge_pair ()) { 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 ()) { } else if (s->is_path () || s->is_polygon () || s->is_box ()) {
+1 -1
View File
@@ -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); db::Shapes &out = layout->cell (into_cell).shapes (into_layer);
for (EdgePairsIterator p (begin ()); ! p.at_end (); ++p) { for (EdgePairsIterator p (begin ()); ! p.at_end (); ++p) {
out.insert (p->to_simple_polygon (enl)); out.insert (p->normalized ().to_simple_polygon (enl));
} }
} }
+6 -2
View File
@@ -129,7 +129,9 @@ db::Region *LayoutToNetlist::make_layer (const std::string &n)
si.shape_flags (db::ShapeIterator::Nothing); si.shape_flags (db::ShapeIterator::Nothing);
std::auto_ptr <db::Region> region (new db::Region (si, dss ())); std::auto_ptr <db::Region> region (new db::Region (si, dss ()));
register_layer (*region, n); if (! n.empty ()) {
register_layer (*region, n);
}
return region.release (); 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); si.shape_flags (db::ShapeIterator::All);
std::auto_ptr <db::Region> region (new db::Region (si, dss ())); std::auto_ptr <db::Region> region (new db::Region (si, dss ()));
register_layer (*region, n); if (! n.empty ()) {
register_layer (*region, n);
}
return region.release (); return region.release ();
} }
+24 -12
View File
@@ -305,6 +305,30 @@ public:
*/ */
void set_netlist_extracted (); 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 * @brief Gets the internal layout
*/ */
@@ -526,18 +550,6 @@ private:
bool m_is_flat; bool m_is_flat;
db::DeepLayer m_dummy_layer; 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 (); void init ();
size_t search_net (const db::ICplxTrans &trans, const db::Cell *cell, const db::local_cluster<db::PolygonRef> &test_cluster, std::vector<db::InstElement> &rev_inst_path); size_t search_net (const db::ICplxTrans &trans, const db::Cell *cell, const db::local_cluster<db::PolygonRef> &test_cluster, std::vector<db::InstElement> &rev_inst_path);
void build_net_rec (const db::Net &net, db::Layout &target, db::Cell &target_cell, const std::map<unsigned int, const db::Region *> &lmap, const char *net_cell_name_prefix, const char *cell_name_prefix, const char *device_cell_name_prefix, std::map<std::pair<db::cell_index_type, size_t>, db::cell_index_type> &cmap, const ICplxTrans &tr) const; void build_net_rec (const db::Net &net, db::Layout &target, db::Cell &target_cell, const std::map<unsigned int, const db::Region *> &lmap, const char *net_cell_name_prefix, const char *cell_name_prefix, const char *device_cell_name_prefix, std::map<std::pair<db::cell_index_type, size_t>, db::cell_index_type> &cmap, const ICplxTrans &tr) const;
+5 -1
View File
@@ -59,9 +59,13 @@ void compare_layouts (tl::TestBase *_this, const db::Layout &layout, const std::
if (norm == WriteGDS2) { if (norm == WriteGDS2) {
tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.gds", hash)); tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.gds", hash));
options.set_format ("GDS2"); options.set_format ("GDS2");
} else { } else if (norm == WriteOAS) {
tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.oas", hash)); tmp_file = _this->tmp_file (tl::sprintf ("tmp_%x.oas", hash));
options.set_format ("OASIS"); 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);
} }
{ {
+5 -1
View File
@@ -2111,7 +2111,11 @@ TEST(9_FlatExtractionWithExternalDSS)
db::Cell &tc = ly.cell (*ly.begin_top_down ()); 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); db::LayoutToNetlist l2n (&dss);
std::auto_ptr<db::Region> rbulk (new db::Region ()); std::auto_ptr<db::Region> rbulk (new db::Region ());
+1 -1
View File
@@ -30,7 +30,7 @@ TEST(1)
std::string input = tl::testsrc (); std::string input = tl::testsrc ();
input += "/testdata/drc/drctest.gds"; input += "/testdata/drc/drctest.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
+8 -8
View File
@@ -31,7 +31,7 @@ TEST(1)
rs += "/testdata/drc/drcSimpleTests_1.drc"; rs += "/testdata/drc/drcSimpleTests_1.drc";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -71,7 +71,7 @@ TEST(2)
input += "/testdata/drc/drctest.gds"; input += "/testdata/drc/drctest.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -111,7 +111,7 @@ TEST(3_Flat)
input += "/testdata/drc/drctest.gds"; input += "/testdata/drc/drctest.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -151,7 +151,7 @@ TEST(4_Hierarchical)
input += "/testdata/drc/drctest.gds"; input += "/testdata/drc/drctest.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -191,7 +191,7 @@ TEST(5_FlatAntenna)
input += "/testdata/drc/antenna_l1.gds"; input += "/testdata/drc/antenna_l1.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -231,7 +231,7 @@ TEST(6_HierarchicalAntenna)
input += "/testdata/drc/antenna_l1.gds"; input += "/testdata/drc/antenna_l1.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -271,7 +271,7 @@ TEST(7_AntennaWithDiodes)
input += "/testdata/drc/antenna_l1.gds"; input += "/testdata/drc/antenna_l1.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
@@ -311,7 +311,7 @@ TEST(8_TextsAndPolygons)
input += "/testdata/drc/texts.gds"; input += "/testdata/drc/texts.gds";
std::string au = tl::testsrc (); 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"); std::string output = this->tmp_file ("tmp.gds");
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -16,6 +16,6 @@ x.is_box? == false || raise("unexpected value")
x.output(10, 0) x.output(10, 0)
y = polygon_layer 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) y.output(11, 0)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+6 -6
View File
@@ -14,12 +14,12 @@ def run_testsuite(dm, ic, tiled = false, hier = false)
lb = 100 lb = 100
a = input(RBA::LayerInfo::new(1, 0)) a = polygons(RBA::LayerInfo::new(1, 0))
b = input(2) b = polygons(2)
c = input(3) c = polygons(3)
x = input(10) x = polygons(10)
y = input(11) y = polygons(11)
empty = input(1000) empty = polygons(1000)
h = {} h = {}
layers.each { |l| h[l] = true } layers.each { |l| h[l] = true }
+4 -12
View File
@@ -793,20 +793,12 @@ class DBRegion_TestClass < TestBase
def test_15 def test_15
r = RBA::Region::new r = RBA::Region::new
ex = nil t = r.texts("*", true)
begin assert_equal(t.to_s, "")
t = r.texts("*", true)
rescue => ex
end
assert_equal(ex.to_s, "Texts can only be identified on an original layer in Region::texts")
r.insert(RBA::Box::new(1, 2, 3, 4)) r.insert(RBA::Box::new(1, 2, 3, 4))
ex = nil t = r.texts("*", true)
begin assert_equal(t.to_s, "")
t = r.texts("*", true)
rescue => ex
end
assert_equal(ex.to_s, "Texts can only be identified on an original layer in Region::texts")
ly = RBA::Layout::new ly = RBA::Layout::new
top = ly.create_cell("TOP") top = ly.create_cell("TOP")