Debugging sized operator for generic DRC, new tests

This commit is contained in:
Matthias Koefferlein 2023-11-18 13:40:50 +01:00
parent c368710253
commit 877646d959
33 changed files with 276 additions and 41 deletions

View File

@ -1299,12 +1299,30 @@ CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::
}
void
CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::PolygonRef> &res) const
CompoundRegionProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::Polygon> &res) const
{
size_t n = res.size ();
mp_proc->process (tr * p, res);
if (res.size () > n) {
db::ICplxTrans tri = tr.inverted ();
for (auto p = res.begin () + n; p != res.end (); ++p) {
p->transform (tri);
}
}
}
void
CompoundRegionProcessingOperationNode::processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::PolygonRef> &res) const
{
std::vector<db::Polygon> poly;
mp_proc->process (p.obj ().transformed (p.trans ()), poly);
for (std::vector<db::Polygon>::const_iterator p = poly.begin (); p != poly.end (); ++p) {
res.push_back (db::PolygonRef (*p, layout->shape_repository ()));
mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), poly);
if (! poly.empty ()) {
db::ICplxTrans tri = tr.inverted ();
for (std::vector<db::Polygon>::const_iterator p = poly.begin (); p != poly.end (); ++p) {
res.push_back (db::PolygonRef (tri * *p, layout->shape_repository ()));
}
}
}
@ -1349,9 +1367,31 @@ CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::
}
void
CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::Edge> &res) const
CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::Edge> &res) const
{
mp_proc->process (p.obj ().transformed (p.trans ()), res);
size_t n = res.size ();
mp_proc->process (tr * p, res);
if (res.size () > n) {
db::ICplxTrans tri = tr.inverted ();
for (auto p = res.begin () + n; p != res.end (); ++p) {
p->transform (tri);
}
}
}
void
CompoundRegionToEdgeProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::Edge> &res) const
{
size_t n = res.size ();
mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res);
if (res.size () > n) {
db::ICplxTrans tri = tr.inverted ();
for (auto p = res.begin () + n; p != res.end (); ++p) {
p->transform (tri);
}
}
}
// ---------------------------------------------------------------------------------------------
@ -1473,9 +1513,31 @@ CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const
}
void
CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::EdgePair> &res) const
CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::EdgePair> &res) const
{
mp_proc->process (p.obj ().transformed (p.trans ()), res);
size_t n = res.size ();
mp_proc->process (tr * p, res);
if (res.size () > n) {
db::ICplxTrans tri = tr.inverted ();
for (auto p = res.begin () + n; p != res.end (); ++p) {
p->transform (tri);
}
}
}
void
CompoundRegionToEdgePairProcessingOperationNode::processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::EdgePair> &res) const
{
size_t n = res.size ();
mp_proc->process (p.obj ().transformed (p.trans ()).transformed (tr), res);
if (res.size () > n) {
db::ICplxTrans tri = tr.inverted ();
for (auto p = res.begin () + n; p != res.end (); ++p) {
p->transform (tri);
}
}
}
// ---------------------------------------------------------------------------------------------

View File

@ -1138,7 +1138,8 @@ private:
void processed (db::Layout *, const db::Polygon &p, std::vector<db::Polygon> &res) const;
void processed (db::Layout *, const db::PolygonRef &p, std::vector<db::PolygonRef> &res) const;
void processed (db::Layout *, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::PolygonRef> &res) const;
void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::Polygon> &res) const;
void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::PolygonRef> &res) const;
template <class T>
void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions<T, T> &interactions, std::vector<std::unordered_set<T> > &results, const db::LocalProcessorBase *proc) const
@ -1160,23 +1161,16 @@ private:
const std::map<db::ICplxTrans, size_t> &vv = proc->vars ()->variants (cell->cell_index ());
tl_assert (vv.size () == 1);
const db::ICplxTrans &tr = vv.begin ()->first;
processed (layout, tr * *p, res);
if (! res.empty ()) {
db::ICplxTrans tri = tr.inverted ();
for (auto r = res.begin (); r != res.end (); ++r) {
results.front ().insert (tri * *r);
}
}
processed (layout, *p, tr, res);
} else {
processed (layout, *p, res);
results.front ().insert (res.begin (), res.end ());
}
results.front ().insert (res.begin (), res.end ());
}
}
};
@ -1575,7 +1569,8 @@ private:
void processed (db::Layout *, const db::Polygon &p, std::vector<db::Edge> &res) const;
void processed (db::Layout *layout, const db::PolygonRef &p, std::vector<db::Edge> &res) const;
void processed (db::Layout *, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::Edge> &res) const;
void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::Edge> &res) const;
void processed (db::Layout *, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::Edge> &res) const;
template <class T>
void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions<T, T> &interactions, std::vector<std::unordered_set<db::Edge> > &results, const db::LocalProcessorBase *proc) const
@ -1597,23 +1592,16 @@ private:
const std::map<db::ICplxTrans, size_t> &vv = proc->vars ()->variants (cell->cell_index ());
tl_assert (vv.size () == 1);
const db::ICplxTrans &tr = vv.begin ()->first;
processed (layout, tr * *p, res);
if (! res.empty ()) {
db::ICplxTrans tri = tr.inverted ();
for (auto r = res.begin (); r != res.end (); ++r) {
results.front ().insert (tri * *r);
}
}
processed (layout, *p, tr, res);
} else {
processed (layout, *p, res);
results.front ().insert (res.begin (), res.end ());
}
results.front ().insert (res.begin (), res.end ());
}
}
};
@ -1656,7 +1644,8 @@ private:
void processed (db::Layout *, const db::Polygon &p, std::vector<db::EdgePair> &res) const;
void processed (db::Layout *layout, const db::PolygonRef &p, std::vector<db::EdgePair> &res) const;
void processed (db::Layout *, const db::polygon_ref<db::Polygon, db::ICplxTrans> &p, std::vector<db::EdgePair> &res) const;
void processed (db::Layout *, const db::Polygon &p, const db::ICplxTrans &tr, std::vector<db::EdgePair> &res) const;
void processed (db::Layout *layout, const db::PolygonRef &p, const db::ICplxTrans &tr, std::vector<db::EdgePair> &res) const;
template <class T>
void implement_compute_local (db::CompoundRegionOperationCache *cache, db::Layout *layout, db::Cell *cell, const shape_interactions<T, T> &interactions, std::vector<std::unordered_set<db::EdgePair> > &results, const db::LocalProcessorBase *proc) const
@ -1678,23 +1667,16 @@ private:
const std::map<db::ICplxTrans, size_t> &vv = proc->vars ()->variants (cell->cell_index ());
tl_assert (vv.size () == 1);
const db::ICplxTrans &tr = vv.begin ()->first;
processed (layout, tr * *p, res);
if (! res.empty ()) {
db::ICplxTrans tri = tr.inverted ();
for (auto r = res.begin (); r != res.end (); ++r) {
results.front ().insert (tri * *r);
}
}
processed (layout, *p, tr, res);
} else {
processed (layout, *p, res);
results.front ().insert (res.begin (), res.end ());
}
results.front ().insert (res.begin (), res.end ());
}
}
};

View File

@ -1566,3 +1566,54 @@ TEST(70d_props)
{
run_test (_this, "70", true);
}
TEST(80_deep_with_mag_width)
{
run_test (_this, "80", true);
}
TEST(81_deep_with_mag_space)
{
run_test (_this, "81", true);
}
TEST(82_deep_with_mag_cop_width)
{
run_test (_this, "82", true);
}
TEST(83_deep_with_mag_cop_space)
{
run_test (_this, "83", true);
}
TEST(84_deep_with_mag_edge_width)
{
run_test (_this, "84", true);
}
TEST(85_deep_with_mag_edge_space)
{
run_test (_this, "85", true);
}
TEST(86_deep_with_mag_size)
{
run_test (_this, "86", true);
}
TEST(87_deep_with_mag_size_aniso)
{
run_test (_this, "87", true);
}
TEST(88_deep_with_mag_cop_size)
{
run_test (_this, "88", true);
}
TEST(89_deep_with_mag_cop_size_aniso)
{
run_test (_this, "89", true);
}

14
testdata/drc/drcSimpleTests_80.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.width(0.4).output(100, 0)
l1.width(0.9).output(101, 0)
l1.width(1.1).output(102, 0)

BIN
testdata/drc/drcSimpleTests_80.gds vendored Normal file

Binary file not shown.

14
testdata/drc/drcSimpleTests_81.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.space(0.4, projection).output(100, 0)
l1.space(0.9, projection).output(101, 0)
l1.space(1.1, projection).output(102, 0)

BIN
testdata/drc/drcSimpleTests_81.gds vendored Normal file

Binary file not shown.

14
testdata/drc/drcSimpleTests_82.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.drc(width < 0.4).output(100, 0)
l1.drc(width < 0.9).output(101, 0)
l1.drc(width < 1.1).output(102, 0)

BIN
testdata/drc/drcSimpleTests_82.gds vendored Normal file

Binary file not shown.

14
testdata/drc/drcSimpleTests_83.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.drc(space(projection) < 0.4).output(100, 0)
l1.drc(space(projection) < 0.9).output(101, 0)
l1.drc(space(projection) < 1.1).output(102, 0)

BIN
testdata/drc/drcSimpleTests_83.gds vendored Normal file

Binary file not shown.

14
testdata/drc/drcSimpleTests_84.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.edges.width(0.4, projection).output(100, 0)
l1.edges.width(0.9, projection).output(101, 0)
l1.edges.width(1.1, projection).output(102, 0)

BIN
testdata/drc/drcSimpleTests_84.gds vendored Normal file

Binary file not shown.

14
testdata/drc/drcSimpleTests_85.drc vendored Normal file
View File

@ -0,0 +1,14 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.edges.space(0.4, projection).output(100, 0)
l1.edges.space(0.9, projection).output(101, 0)
l1.edges.space(1.1, projection).output(102, 0)

BIN
testdata/drc/drcSimpleTests_85.gds vendored Normal file

Binary file not shown.

13
testdata/drc/drcSimpleTests_86.drc vendored Normal file
View File

@ -0,0 +1,13 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.sized(0.2).output(100, 0)
l1.sized(-0.2).output(101, 0)

BIN
testdata/drc/drcSimpleTests_86.gds vendored Normal file

Binary file not shown.

15
testdata/drc/drcSimpleTests_87.drc vendored Normal file
View File

@ -0,0 +1,15 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.sized(0.2, 0.0).output(100, 0)
l1.sized(0.0, 0.2).output(101, 0)
l1.sized(-0.2, 0.0).output(102, 0)
l1.sized(0.0, -0.2).output(103, 0)

BIN
testdata/drc/drcSimpleTests_87.gds vendored Normal file

Binary file not shown.

13
testdata/drc/drcSimpleTests_88.drc vendored Normal file
View File

@ -0,0 +1,13 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.drc(sized(0.2)).output(100, 0)
l1.drc(sized(-0.2)).output(101, 0)

BIN
testdata/drc/drcSimpleTests_88.gds vendored Normal file

Binary file not shown.

15
testdata/drc/drcSimpleTests_89.drc vendored Normal file
View File

@ -0,0 +1,15 @@
source $drc_test_source
target $drc_test_target
deep
l1 = input(1, 0)
l1.output(1, 0)
l1.drc(sized(0.2, 0.0)).output(100, 0)
l1.drc(sized(0.0, 0.2)).output(101, 0)
l1.drc(sized(-0.2, 0.0)).output(102, 0)
l1.drc(sized(0.0, -0.2)).output(103, 0)

BIN
testdata/drc/drcSimpleTests_89.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au80d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au81d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au82d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au83d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au84d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au85d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au86d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au87d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au88d.gds vendored Normal file

Binary file not shown.

BIN
testdata/drc/drcSimpleTests_au89d.gds vendored Normal file

Binary file not shown.