mirror of https://github.com/KLayout/klayout.git
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:
parent
745696507f
commit
6932977273
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -247,7 +247,7 @@ DeepRegion::has_valid_polygons () const
|
|||
bool
|
||||
DeepRegion::has_valid_merged_polygons () const
|
||||
{
|
||||
return merged_semantics ();
|
||||
return false;
|
||||
}
|
||||
|
||||
const db::RecursiveShapeIterator *
|
||||
|
|
|
|||
|
|
@ -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 ()) {
|
||||
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,7 +129,9 @@ db::Region *LayoutToNetlist::make_layer (const std::string &n)
|
|||
si.shape_flags (db::ShapeIterator::Nothing);
|
||||
|
||||
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 ();
|
||||
}
|
||||
|
||||
|
|
@ -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 <db::Region> region (new db::Region (si, dss ()));
|
||||
register_layer (*region, n);
|
||||
if (! n.empty ()) {
|
||||
register_layer (*region, n);
|
||||
}
|
||||
return region.release ();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<db::Region> rbulk (new db::Region ());
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
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.
|
|
@ -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 }
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Reference in New Issue