From 18eadb119e275d8f7dc12032638b156fab95b7b2 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 23 Mar 2024 22:31:46 +0100
Subject: [PATCH 01/41] Fixed a small problem: browser windows did not get
closed when closing the window.
---
src/layui/layui/layBrowser.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/layui/layui/layBrowser.cc b/src/layui/layui/layBrowser.cc
index edfbf4a26..b5e3bebc3 100644
--- a/src/layui/layui/layBrowser.cc
+++ b/src/layui/layui/layBrowser.cc
@@ -24,6 +24,7 @@
#include
#include
+#include
#include "layBrowser.h"
#include "layLayoutViewBase.h"
@@ -81,7 +82,7 @@ Browser::closeEvent (QCloseEvent *event)
if (active ()) {
m_active = false;
deactivated ();
- QDialog::closeEvent (event);
+ event->accept ();
}
}
From b634d93cb246ef855b7c59b8b8e4fc3fcf43fc9e Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Wed, 17 Apr 2024 22:54:01 +0200
Subject: [PATCH 02/41] Bugfix: timeout for HTTP(S) connection was including
the time taken to input the password if one is requested.
---
src/tl/tl/tlHttpStreamQt.cc | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/tl/tl/tlHttpStreamQt.cc b/src/tl/tl/tlHttpStreamQt.cc
index 019caeb91..c8c03a572 100644
--- a/src/tl/tl/tlHttpStreamQt.cc
+++ b/src/tl/tl/tlHttpStreamQt.cc
@@ -27,6 +27,7 @@
#include "tlDeferredExecution.h"
#include "tlObject.h"
#include "tlTimer.h"
+#include "tlSleep.h"
#include
#include
@@ -447,9 +448,18 @@ InputHttpStreamPrivateData::read (char *b, size_t n)
issue_request (QUrl (tl::to_qstring (m_url)));
}
- tl::Clock start_time = tl::Clock::current ();
- while (mp_reply == 0 && (m_timeout <= 0.0 || (tl::Clock::current() - start_time).seconds () < m_timeout)) {
+ const unsigned long tick_ms = 10;
+ double time_waited = 0.0;
+
+ while (mp_reply == 0 && (m_timeout <= 0.0 || time_waited < m_timeout)) {
+
mp_stream->tick ();
+
+ // NOTE: as tick() includes waiting for the password dialog, we must not include
+ // the time spent there.
+ tl::msleep (tick_ms);
+ time_waited += tick_ms * 1e-3;
+
}
if (! mp_reply) {
From cba126e9eeb00ebaf684efb906185119c6e02dea Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Thu, 18 Apr 2024 21:27:09 +0200
Subject: [PATCH 03/41] Small enhancements for Spice reader
- Detects recursive subcircuit calls now
- Dismisses empty top level circuit which happened to be created
when there were not top level elements and control statements
were present (such as .param)
---
src/db/db/dbCircuit.cc | 5 ++++
src/db/db/dbCircuit.h | 5 ++++
src/db/db/dbNetlistSpiceReader.cc | 17 +++++++++++-
src/db/unit_tests/dbNetlistReaderTests.cc | 34 +++++++++++++++++++++++
testdata/algo/nreader24.cir | 14 ++++++++++
testdata/algo/nreader25.cir | 11 ++++++++
6 files changed, 85 insertions(+), 1 deletion(-)
create mode 100644 testdata/algo/nreader24.cir
create mode 100644 testdata/algo/nreader25.cir
diff --git a/src/db/db/dbCircuit.cc b/src/db/db/dbCircuit.cc
index aaca632c8..c9c4d2153 100644
--- a/src/db/db/dbCircuit.cc
+++ b/src/db/db/dbCircuit.cc
@@ -644,6 +644,11 @@ void Circuit::set_pin_ref_for_pin (size_t pin_id, Net::pin_iterator iter)
m_pin_refs [pin_id] = iter;
}
+bool Circuit::is_empty () const
+{
+ return m_nets.empty () && m_pins.empty () && m_devices.empty () && m_subcircuits.empty ();
+}
+
void Circuit::blank ()
{
tl_assert (netlist () != 0);
diff --git a/src/db/db/dbCircuit.h b/src/db/db/dbCircuit.h
index 1e0f0a956..abcb74274 100644
--- a/src/db/db/dbCircuit.h
+++ b/src/db/db/dbCircuit.h
@@ -759,6 +759,11 @@ public:
*/
void blank ();
+ /**
+ * @brief Gets a value indicating whether the circuit is empty
+ */
+ bool is_empty () const;
+
/**
* @brief Generate memory statistics
*/
diff --git a/src/db/db/dbNetlistSpiceReader.cc b/src/db/db/dbNetlistSpiceReader.cc
index 88632b71a..05976791d 100644
--- a/src/db/db/dbNetlistSpiceReader.cc
+++ b/src/db/db/dbNetlistSpiceReader.cc
@@ -943,6 +943,12 @@ SpiceNetlistBuilder::circuit_for (const SpiceCachedCircuit *cc, const parameters
if (cp == c->second.end ()) {
return 0;
}
+
+ // a null pointer indicates that we are currently defining this circuit
+ if (cp->second == 0) {
+ error (tl::sprintf (tl::to_string (tr ("Subcircuit '%s' called recursively")), cc->name ()));
+ }
+
return cp->second;
}
@@ -1055,7 +1061,8 @@ SpiceNetlistBuilder::build_circuit (const SpiceCachedCircuit *cc, const paramete
c->set_name (make_circuit_name (cc->name (), pv));
}
- register_circuit_for (cc, pv, c, anonymous_top_level);
+ // pre-register the circuit - allows detecting recursive calls
+ register_circuit_for (cc, pv, 0, false);
std::unique_ptr > n2n (mp_nets_by_name.release ());
mp_nets_by_name.reset (0);
@@ -1095,6 +1102,14 @@ SpiceNetlistBuilder::build_circuit (const SpiceCachedCircuit *cc, const paramete
std::swap (c, mp_netlist_circuit);
std::swap (vars, m_variables);
+ // final registration if required
+ if (! anonymous_top_level || ! c->is_empty ()) {
+ register_circuit_for (cc, pv, c, anonymous_top_level);
+ } else {
+ mp_netlist->remove_circuit (c);
+ c = 0;
+ }
+
return c;
}
diff --git a/src/db/unit_tests/dbNetlistReaderTests.cc b/src/db/unit_tests/dbNetlistReaderTests.cc
index 19858f26d..c3b67b343 100644
--- a/src/db/unit_tests/dbNetlistReaderTests.cc
+++ b/src/db/unit_tests/dbNetlistReaderTests.cc
@@ -880,6 +880,40 @@ TEST(23_endl)
);
}
+TEST(24_recursive_calls)
+{
+ db::Netlist nl;
+
+ std::string path = tl::combine_path (tl::combine_path (tl::testdata (), "algo"), "nreader24.cir");
+
+ db::NetlistSpiceReader reader;
+ tl::InputStream is (path);
+
+ try {
+ reader.read (is, nl);
+ EXPECT_EQ (false, true);
+ } catch (tl::Exception &ex) {
+ EXPECT_EQ (ex.msg (), "Subcircuit 'C1' called recursively in /home/matthias/klayout/master/testdata/algo/nreader24.cir, line 8");
+ }
+}
+
+TEST(25_dismiss_top_level)
+{
+ db::Netlist nl;
+
+ std::string path = tl::combine_path (tl::combine_path (tl::testdata (), "algo"), "nreader25.cir");
+
+ db::NetlistSpiceReader reader;
+ tl::InputStream is (path);
+ reader.read (is, nl);
+
+ EXPECT_EQ (nl.to_string (),
+ "circuit TOP (A=A,B=B);\n"
+ " device NMOS '1' (S=A,G=B,D=A,B=B) (L=100,W=100,AS=0,AD=0,PS=0,PD=0);\n"
+ "end;\n"
+ );
+}
+
TEST(100_ExpressionParser)
{
std::map vars;
diff --git a/testdata/algo/nreader24.cir b/testdata/algo/nreader24.cir
new file mode 100644
index 000000000..c42a4ff51
--- /dev/null
+++ b/testdata/algo/nreader24.cir
@@ -0,0 +1,14 @@
+* Testing recursive call detection
+
+.subckt c1 a b
+x1 a b c2
+.end
+
+.subckt c2 a b
+x1 a b c1
+.ends
+
+xtop vdd vss c2
+
+.end
+
diff --git a/testdata/algo/nreader25.cir b/testdata/algo/nreader25.cir
new file mode 100644
index 000000000..9026cfc70
--- /dev/null
+++ b/testdata/algo/nreader25.cir
@@ -0,0 +1,11 @@
+* Test: dismiss empty top level circuit
+
+.subckt top a b
+m1 a b a b nmos
+.ends
+
+* this triggered generation of a top level circuit
+.param p1 17
+
+.end
+
From 424ead4d9a635e9a4e9426d5eb51714e41e65d0c Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Thu, 18 Apr 2024 22:02:46 +0200
Subject: [PATCH 04/41] Some enhancements to expression parser:
- upcase() and downcase() functions
- type error messages indicate argument number
---
src/doc/doc/about/expressions.xml | 2 +
src/tl/tl/tlExpression.cc | 180 ++++++++++++++-----------
src/tl/unit_tests/tlExpressionTests.cc | 12 ++
3 files changed, 115 insertions(+), 79 deletions(-)
diff --git a/src/doc/doc/about/expressions.xml b/src/doc/doc/about/expressions.xml
index f7e405c48..d7f83622f 100644
--- a/src/doc/doc/about/expressions.xml
+++ b/src/doc/doc/about/expressions.xml
@@ -282,6 +282,7 @@ var x = 3; x = x + 1; x
| combine(x,y) | String | String | Combines the path components x and y using the system specific separator |
| cosh(x) | Numeric | Numeric | Hyperbolic cosine function |
| cos(x) | Numeric | Numeric | Cosine function |
+ | downcase(x) | String | String | Converts the given string to lower case |
| env(x) | String | String | Access an environment variable |
| error(x) | String | | Raise an error |
| exp(x) | Numeric | Numeric | Exponential function |
@@ -318,6 +319,7 @@ var x = 3; x = x + 1; x
| to_f(x) | Any | Numeric | Convert argument to numeric if possible |
| to_i(x) | Any | Numeric (integer) | Convert argument to numeric (32 bit integer) |
| to_s(x) | Any | String | Convert argument to string |
+ | upcase(x) | String | String | Converts the given string to upper case |
diff --git a/src/tl/tl/tlExpression.cc b/src/tl/tl/tlExpression.cc
index dea3d086a..0db330f5c 100644
--- a/src/tl/tl/tlExpression.cc
+++ b/src/tl/tl/tlExpression.cc
@@ -145,14 +145,14 @@ ExpressionParserContext::where () const
// ----------------------------------------------------------------------------
// Utilities for evaluation
-static double to_double (const ExpressionParserContext &context, const tl::Variant &v)
+static double to_double (const ExpressionParserContext &context, const tl::Variant &v, unsigned int narg)
{
if (v.can_convert_to_double ()) {
return v.to_double ();
} else if (v.is_list ()) {
return v.get_list ().size ();
} else {
- throw EvalError (tl::to_string (tr ("Double precision floating point value expected")), context);
+ throw EvalError (tl::to_string (tr ("Double precision floating point value expected for argument #")) + tl::to_string (narg + 1), context);
}
}
@@ -162,50 +162,50 @@ static double to_double (const ExpressionParserContext &context, const std::vect
throw EvalError (tl::to_string (tr ("Function expects a single numeric argument")), context);
}
- return to_double (context, v [0]);
+ return to_double (context, v [0], 0);
}
-static long to_long (const ExpressionParserContext &context, const tl::Variant &v)
+static long to_long (const ExpressionParserContext &context, const tl::Variant &v, int narg)
{
if (v.can_convert_to_long ()) {
return v.to_long ();
} else if (v.is_list ()) {
return long (v.get_list ().size ());
} else {
- throw EvalError (tl::to_string (tr ("Integer value expected")), context);
+ throw EvalError (tl::to_string (tr ("Integer value expected for argument #")) + tl::to_string (narg + 1), context);
}
}
-static unsigned long to_ulong (const ExpressionParserContext &context, const tl::Variant &v)
+static unsigned long to_ulong (const ExpressionParserContext &context, const tl::Variant &v, int narg)
{
if (v.can_convert_to_ulong ()) {
return v.to_ulong ();
} else if (v.is_list ()) {
return (unsigned long) (v.get_list ().size ());
} else {
- throw EvalError (tl::to_string (tr ("Unsigned integer value expected")), context);
+ throw EvalError (tl::to_string (tr ("Unsigned integer value expected for argument #")) + tl::to_string (narg + 1), context);
}
}
-static long long to_longlong (const ExpressionParserContext &context, const tl::Variant &v)
+static long long to_longlong (const ExpressionParserContext &context, const tl::Variant &v, int narg)
{
if (v.can_convert_to_longlong ()) {
return v.to_longlong ();
} else if (v.is_list ()) {
return long (v.get_list ().size ());
} else {
- throw EvalError (tl::to_string (tr ("Integer value expected")), context);
+ throw EvalError (tl::to_string (tr ("Integer value expected for argument #")) + tl::to_string (narg + 1), context);
}
}
-static unsigned long long to_ulonglong (const ExpressionParserContext &context, const tl::Variant &v)
+static unsigned long long to_ulonglong (const ExpressionParserContext &context, const tl::Variant &v, int narg)
{
if (v.can_convert_to_ulonglong ()) {
return v.to_ulong ();
} else if (v.is_list ()) {
return (unsigned long long) (v.get_list ().size ());
} else {
- throw EvalError (tl::to_string (tr ("Unsigned integer value expected")), context);
+ throw EvalError (tl::to_string (tr ("Unsigned integer value expected for argument #")) + tl::to_string (narg + 1), context);
}
}
@@ -1089,13 +1089,13 @@ public:
v.swap (o);
} else if (v->is_longlong ()) {
- v.set (tl::Variant (v->to_longlong () << to_longlong (m_context, *b)));
+ v.set (tl::Variant (v->to_longlong () << to_longlong (m_context, *b, 1)));
} else if (v->is_ulonglong ()) {
- v.set (tl::Variant (v->to_ulonglong () << to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (v->to_ulonglong () << to_ulonglong (m_context, *b, 1)));
} else if (v->is_ulong ()) {
- v.set (tl::Variant (v->to_ulong () << to_ulong (m_context, *b)));
+ v.set (tl::Variant (v->to_ulong () << to_ulong (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_long (m_context, *v) << to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) << to_long (m_context, *b, 1)));
}
}
};
@@ -1145,13 +1145,13 @@ public:
v.swap (o);
} else if (v->is_longlong ()) {
- v.set (tl::Variant (v->to_longlong () >> to_longlong (m_context, *b)));
+ v.set (tl::Variant (v->to_longlong () >> to_longlong (m_context, *b, 1)));
} else if (v->is_ulonglong ()) {
- v.set (tl::Variant (v->to_ulonglong () >> to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (v->to_ulonglong () >> to_ulonglong (m_context, *b, 1)));
} else if (v->is_ulong ()) {
- v.set (tl::Variant (v->to_ulong () >> to_ulong (m_context, *b)));
+ v.set (tl::Variant (v->to_ulong () >> to_ulong (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_long (m_context, *v) >> to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) >> to_long (m_context, *b, 1)));
}
}
};
@@ -1203,17 +1203,17 @@ public:
} else if (v->is_a_string () || b->is_a_string ()) {
v.set (tl::Variant (std::string (v->to_string ()) + b->to_string ()));
} else if (v->is_double () || b->is_double ()) {
- v.set (tl::Variant (to_double (m_context, *v) + to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) + to_double (m_context, *b, 1)));
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) + to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) + to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) + to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) + to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) + to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) + to_ulong (m_context, *b, 1)));
} else if (v->is_long () || b->is_long ()) {
- v.set (tl::Variant (to_long (m_context, *v) + to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) + to_long (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_double (m_context, *v) + to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) + to_double (m_context, *b, 1)));
}
}
};
@@ -1263,17 +1263,17 @@ public:
v.swap (o);
} else if (v->is_double () || b->is_double ()) {
- v.set (tl::Variant (to_double (m_context, *v) - to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) - to_double (m_context, *b, 1)));
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) - to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) - to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) - to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) - to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) - to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) - to_ulong (m_context, *b, 1)));
} else if (v->is_long () || b->is_long ()) {
- v.set (tl::Variant (to_long (m_context, *v) - to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) - to_long (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_double (m_context, *v) - to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) - to_double (m_context, *b, 1)));
}
}
};
@@ -1324,7 +1324,7 @@ public:
} else if (v->is_a_string ()) {
- long x = to_long (m_context, *b);
+ long x = to_long (m_context, *b, 1);
if (x < 0) {
throw EvalError (tl::to_string (tr ("Numeric argument of '*' operator with string must be positive")), m_context);
}
@@ -1339,7 +1339,7 @@ public:
} else if (b->is_a_string ()) {
- long x = to_long (m_context, *v);
+ long x = to_long (m_context, *v, 0);
if (x < 0) {
throw EvalError (tl::to_string (tr ("Numeric argument of '*' operator with string must be positive")), m_context);
}
@@ -1353,17 +1353,17 @@ public:
v.set (tl::Variant (s));
} else if (v->is_double () || b->is_double ()) {
- v.set (tl::Variant (to_double (m_context, *v) * to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) * to_double (m_context, *b, 1)));
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) * to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) * to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) * to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) * to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) * to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) * to_ulong (m_context, *b, 1)));
} else if (v->is_long () || b->is_long ()) {
- v.set (tl::Variant (to_long (m_context, *v) * to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) * to_long (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_double (m_context, *v) * to_double (m_context, *b)));
+ v.set (tl::Variant (to_double (m_context, *v, 0) * to_double (m_context, *b, 1)));
}
}
};
@@ -1413,41 +1413,41 @@ public:
v.swap (o);
} else if (v->is_double () || b->is_double ()) {
- double d = to_double (m_context, *b);
+ double d = to_double (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_double (m_context, *v) / d));
+ v.set (tl::Variant (to_double (m_context, *v, 0) / d));
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- unsigned long long d = to_ulonglong (m_context, *b);
+ unsigned long long d = to_ulonglong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_ulonglong (m_context, *v) / d));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) / d));
} else if (v->is_longlong () || b->is_longlong ()) {
- long long d = to_longlong (m_context, *b);
+ long long d = to_longlong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_longlong (m_context, *v) / d));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) / d));
} else if (v->is_ulong () || b->is_ulong ()) {
- unsigned long d = to_ulong (m_context, *b);
+ unsigned long d = to_ulong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_ulong (m_context, *v) / d));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) / d));
} else if (v->is_long () || b->is_long ()) {
- long d = to_long (m_context, *b);
+ long d = to_long (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_long (m_context, *v) / d));
+ v.set (tl::Variant (to_long (m_context, *v, 0) / d));
} else {
- double d = to_double (m_context, *b);
+ double d = to_double (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Division by zero")), m_context);
}
- v.set (tl::Variant (to_double (m_context, *v) / d));
+ v.set (tl::Variant (to_double (m_context, *v, 0) / d));
}
}
};
@@ -1497,29 +1497,29 @@ public:
v.swap (o);
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- unsigned long long d = to_ulonglong (m_context, *b);
+ unsigned long long d = to_ulonglong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Modulo by zero")), m_context);
}
- v.set (tl::Variant (to_ulonglong (m_context, *v) % d));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) % d));
} else if (v->is_longlong () || b->is_longlong ()) {
- long long d = to_longlong (m_context, *b);
+ long long d = to_longlong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Modulo by zero")), m_context);
}
- v.set (tl::Variant (to_longlong (m_context, *v) % d));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) % d));
} else if (v->is_ulong () || b->is_ulong ()) {
- unsigned long d = to_ulong (m_context, *b);
+ unsigned long d = to_ulong (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Modulo by zero")), m_context);
}
- v.set (tl::Variant (to_ulong (m_context, *v) % d));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) % d));
} else {
- long d = to_long (m_context, *b);
+ long d = to_long (m_context, *b, 1);
if (d == 0) {
throw EvalError (tl::to_string (tr ("Modulo by zero")), m_context);
}
- v.set (tl::Variant (to_long (m_context, *v) % d));
+ v.set (tl::Variant (to_long (m_context, *v, 0) % d));
}
}
};
@@ -1569,13 +1569,13 @@ public:
v.swap (o);
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) & to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) & to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) & to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) & to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) & to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) & to_ulong (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_long (m_context, *v) & to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) & to_long (m_context, *b, 1)));
}
}
};
@@ -1625,13 +1625,13 @@ public:
v.swap (o);
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) | to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) | to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) | to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) | to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) | to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) | to_ulong (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_long (m_context, *v) | to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) | to_long (m_context, *b, 1)));
}
}
};
@@ -1681,13 +1681,13 @@ public:
v.swap (o);
} else if (v->is_ulonglong () || b->is_ulonglong ()) {
- v.set (tl::Variant (to_ulonglong (m_context, *v) ^ to_ulonglong (m_context, *b)));
+ v.set (tl::Variant (to_ulonglong (m_context, *v, 0) ^ to_ulonglong (m_context, *b, 1)));
} else if (v->is_longlong () || b->is_longlong ()) {
- v.set (tl::Variant (to_longlong (m_context, *v) ^ to_longlong (m_context, *b)));
+ v.set (tl::Variant (to_longlong (m_context, *v, 0) ^ to_longlong (m_context, *b, 1)));
} else if (v->is_ulong () || b->is_ulong ()) {
- v.set (tl::Variant (to_ulong (m_context, *v) ^ to_ulong (m_context, *b)));
+ v.set (tl::Variant (to_ulong (m_context, *v, 0) ^ to_ulong (m_context, *b, 1)));
} else {
- v.set (tl::Variant (to_long (m_context, *v) ^ to_long (m_context, *b)));
+ v.set (tl::Variant (to_long (m_context, *v, 0) ^ to_long (m_context, *b, 1)));
}
}
};
@@ -1826,7 +1826,7 @@ public:
} else if (v->is_ulonglong ()) {
v.set (-(long long)(v->to_ulonglong ()));
} else {
- v.set (-to_double (m_context, *v));
+ v.set (-to_double (m_context, *v, 0));
}
}
};
@@ -1881,7 +1881,7 @@ public:
} else if (v->is_ulonglong ()) {
v.set (~v->to_ulonglong ());
} else {
- v.set (~to_long (m_context, *v));
+ v.set (~to_long (m_context, *v, 0));
}
}
};
@@ -2388,7 +2388,7 @@ abs_f (const ExpressionParserContext &context, tl::Variant &out, const std::vect
} else if (v[0].is_double ()) {
out = fabs (v[0].to_double ());
} else {
- out = labs (to_long (context, v[0]));
+ out = labs (to_long (context, v[0], 0));
}
}
@@ -2463,7 +2463,7 @@ pow_f (const ExpressionParserContext &context, tl::Variant &out, const std::vect
throw EvalError (tl::to_string (tr ("'pow' function expects exactly two arguments")), context);
}
- out = pow (to_double (context, vv [0]), to_double (context, vv [1]));
+ out = pow (to_double (context, vv [0], 0), to_double (context, vv [1], 1));
}
static void
@@ -2473,7 +2473,7 @@ atan2_f (const ExpressionParserContext &context, tl::Variant &out, const std::ve
throw EvalError (tl::to_string (tr ("'atan2' function expects exactly two arguments")), context);
}
- out = atan2 (to_double (context, vv [0]), to_double (context, vv [1]));
+ out = atan2 (to_double (context, vv [0], 0), to_double (context, vv [1], 1));
}
static void
@@ -2690,10 +2690,10 @@ substr_f (const ExpressionParserContext &context, tl::Variant &out, const std::v
long len = -1;
if (vv.size () > 2) {
- len = std::max (long (0), to_long (context, vv [2]));
+ len = std::max (long (0), to_long (context, vv [2], 2));
}
- long l = to_long (context, vv [1]);
+ long l = to_long (context, vv [1], 1);
if (l < 0) {
l = long (s.size ()) + l;
if (l < 0) {
@@ -2713,6 +2713,26 @@ substr_f (const ExpressionParserContext &context, tl::Variant &out, const std::v
}
}
+static void
+upcase_f (const ExpressionParserContext &context, tl::Variant &out, const std::vector &vv)
+{
+ if (vv.size () != 1) {
+ throw EvalError (tl::to_string (tr ("'upcase' function expects one argument")), context);
+ }
+
+ out = tl::to_upper_case (vv [0].to_string ());
+}
+
+static void
+downcase_f (const ExpressionParserContext &context, tl::Variant &out, const std::vector &vv)
+{
+ if (vv.size () != 1) {
+ throw EvalError (tl::to_string (tr ("'upcase' function expects one argument")), context);
+ }
+
+ out = tl::to_lower_case (vv [0].to_string ());
+}
+
static void
join_f (const ExpressionParserContext &context, tl::Variant &out, const std::vector &vv)
{
@@ -2752,7 +2772,7 @@ item_f (const ExpressionParserContext &context, tl::Variant &out, const std::vec
throw EvalError (tl::to_string (tr ("First argument of 'item' function must be a list")), context);
}
- long index = to_long (context, vv [1]);
+ long index = to_long (context, vv [1], 1);
if (index < 0 || index >= long (vv [0].end () - vv [0].begin ())) {
out = tl::Variant ();
} else {
@@ -3042,6 +3062,8 @@ static EvalStaticFunction f55 ("file_exists", &file_exists_f);
static EvalStaticFunction f56 ("is_dir", &is_dir_f);
static EvalStaticFunction f57 ("combine", &combine_f);
static EvalStaticFunction f58 ("abs", &abs_f);
+static EvalStaticFunction f59 ("upcase", &upcase_f);
+static EvalStaticFunction f60 ("downcase", &downcase_f);
// ----------------------------------------------------------------------------
// Implementation of a constant wrapper
diff --git a/src/tl/unit_tests/tlExpressionTests.cc b/src/tl/unit_tests/tlExpressionTests.cc
index a547d7c7d..3d8719900 100644
--- a/src/tl/unit_tests/tlExpressionTests.cc
+++ b/src/tl/unit_tests/tlExpressionTests.cc
@@ -784,6 +784,10 @@ TEST(6)
EXPECT_EQ (v.to_string (), std::string ("0"));
v = e.parse ("rfind('abcabc','x')").execute ();
EXPECT_EQ (v.to_string (), std::string ("nil"));
+ v = e.parse ("upcase('abcABC')").execute ();
+ EXPECT_EQ (v.to_string (), std::string ("ABCABC"));
+ v = e.parse ("downcase('abcABC')").execute ();
+ EXPECT_EQ (v.to_string (), std::string ("abcabc"));
v = e.parse ("len('abcabc')").execute ();
EXPECT_EQ (v.to_string (), std::string ("6"));
v = e.parse ("len([])").execute ();
@@ -859,6 +863,14 @@ TEST(6)
msg = ex.msg();
}
EXPECT_EQ (msg, std::string ("My error"));
+ // argument index in error messages
+ msg.clear ();
+ try {
+ v = e.parse ("substr('abcabc',2,'xyz')").execute ();
+ } catch (tl::Exception &ex) {
+ msg = ex.msg();
+ }
+ EXPECT_EQ (msg, std::string ("Integer value expected for argument #3 at position 0 (substr('abcabc',2,'x..)"));
}
// compare ops
From a18a6be181606a0765146f5b64fd00c315cf7906 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 20 Apr 2024 21:50:22 +0200
Subject: [PATCH 05/41] DRC: New options for "corners", "angle",
"with(out)_angle"
- layer.corners: absolute and negative option
- drc(corners): absolute option, != operator supported
- layer.with_angle/without_angle: absolute option
- drc(angle): absolute option
+ corresponding API updates:
- EdgePairs#with_angle, with_angle_both: 'absolute' flag added
- Edges#with_angle: 'absolute' flag added
- Region#corners: 'inverse' and 'absolute' added
---
src/db/db/dbEdgePairFilters.cc | 6 +-
src/db/db/dbEdgesUtils.cc | 38 ++--
src/db/db/dbEdgesUtils.h | 13 +-
src/db/db/dbRegionProcessors.cc | 4 +-
src/db/db/dbRegionProcessors.h | 14 +-
src/db/db/gsiDeclDbCompoundOperation.cc | 32 +--
src/db/db/gsiDeclDbEdgePairs.cc | 42 ++--
src/db/db/gsiDeclDbEdges.cc | 25 ++-
src/db/db/gsiDeclDbRegion.cc | 32 +--
src/db/unit_tests/dbAsIfFlatRegionTests.cc | 10 +-
src/db/unit_tests/dbCompoundOperationTests.cc | 4 +-
src/db/unit_tests/dbDeepEdgesTests.cc | 4 +-
src/db/unit_tests/dbDeepRegionTests.cc | 10 +-
src/db/unit_tests/dbEdgePairsTests.cc | 10 +
src/db/unit_tests/dbEdgesTests.cc | 34 ++--
src/db/unit_tests/dbRegionTests.cc | 18 +-
src/doc/doc/about/drc_ref_drc.xml | 35 +++-
src/doc/doc/about/drc_ref_layer.xml | 36 ++--
.../drc/built-in-macros/_drc_complex_ops.rb | 89 +++++++--
.../built-in-macros/_drc_cop_integration.rb | 26 ++-
src/drc/drc/built-in-macros/_drc_engine.rb | 4 +
src/drc/drc/built-in-macros/_drc_layer.rb | 186 +++++++++++++-----
src/drc/drc/built-in-macros/_drc_tags.rb | 10 +
src/drc/unit_tests/drcSimpleTests.cc | 10 +
testdata/drc/drcGenericTests_12.drc | 2 +
testdata/drc/drcGenericTests_6.drc | 2 +
testdata/drc/drcGenericTests_au12.gds | Bin 9312 -> 9474 bytes
testdata/drc/drcGenericTests_au12d.gds | Bin 9370 -> 9532 bytes
testdata/drc/drcGenericTests_au6.gds | Bin 10422 -> 14518 bytes
testdata/drc/drcGenericTests_au6d.gds | Bin 10480 -> 14576 bytes
testdata/drc/drcSimpleTests_2.drc | 7 +
testdata/drc/drcSimpleTests_49.drc | 4 +
testdata/drc/drcSimpleTests_93.drc | 35 ++++
testdata/drc/drcSimpleTests_93.gds | Bin 0 -> 360 bytes
testdata/drc/drcSimpleTests_au2.gds | Bin 13926 -> 15470 bytes
testdata/drc/drcSimpleTests_au49.gds | Bin 10090 -> 12010 bytes
testdata/drc/drcSimpleTests_au49d.gds | Bin 6314 -> 7594 bytes
testdata/drc/drcSimpleTests_au93.gds | Bin 0 -> 9958 bytes
testdata/drc/drcSimpleTests_au93d.gds | Bin 0 -> 5978 bytes
testdata/drc/drctest.gds | Bin 3192 -> 3328 bytes
40 files changed, 520 insertions(+), 222 deletions(-)
create mode 100644 testdata/drc/drcSimpleTests_93.drc
create mode 100644 testdata/drc/drcSimpleTests_93.gds
create mode 100644 testdata/drc/drcSimpleTests_au93.gds
create mode 100644 testdata/drc/drcSimpleTests_au93d.gds
diff --git a/src/db/db/dbEdgePairFilters.cc b/src/db/db/dbEdgePairFilters.cc
index 8e5aa3008..602c56b90 100644
--- a/src/db/db/dbEdgePairFilters.cc
+++ b/src/db/db/dbEdgePairFilters.cc
@@ -98,13 +98,13 @@ bool EdgePairFilterByArea::selected (const db::EdgePair &edge_pair) const
// EdgePairFilterByArea implementation
InternalAngleEdgePairFilter::InternalAngleEdgePairFilter (double a, bool inverted)
- : m_inverted (inverted), m_checker (a, true, a, true)
+ : m_checker (a, true, a, true, inverted, false)
{
// .. nothing yet ..
}
InternalAngleEdgePairFilter::InternalAngleEdgePairFilter (double amin, bool include_amin, double amax, bool include_amax, bool inverted)
- : m_inverted (inverted), m_checker (amin, include_amin, amax, include_amax)
+ : m_checker (amin, include_amin, amax, include_amax, inverted, false)
{
// .. nothing yet ..
}
@@ -122,7 +122,7 @@ InternalAngleEdgePairFilter::selected (const db::EdgePair &edge_pair) const
std::swap (d1, d2);
}
- return m_checker (d1, d2) != m_inverted;
+ return m_checker (d1, d2);
}
}
diff --git a/src/db/db/dbEdgesUtils.cc b/src/db/db/dbEdgesUtils.cc
index 56d345b2a..fb9407609 100644
--- a/src/db/db/dbEdgesUtils.cc
+++ b/src/db/db/dbEdgesUtils.cc
@@ -215,8 +215,13 @@ EdgeSegmentSelector::process (const db::Edge &edge, std::vector &res)
// -------------------------------------------------------------------------------------------------------------
// EdgeAngleChecker implementation
-EdgeAngleChecker::EdgeAngleChecker (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
+EdgeAngleChecker::EdgeAngleChecker (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
{
+ if (absolute && angle_start < -db::epsilon) {
+ angle_start = 0.0;
+ include_angle_start = true;
+ }
+
m_t_start = db::CplxTrans(1.0, angle_start, false, db::DVector ());
m_t_end = db::CplxTrans(1.0, angle_end, false, db::DVector ());
@@ -225,6 +230,9 @@ EdgeAngleChecker::EdgeAngleChecker (double angle_start, bool include_angle_start
m_big_angle = (angle_end - angle_start + db::epsilon) > 180.0;
m_all = (angle_end - angle_start - db::epsilon) > 360.0;
+
+ m_absolute = absolute;
+ m_inverse = inverse;
}
bool
@@ -255,14 +263,14 @@ EdgeAngleChecker::check (const db::Vector &a, const db::Vector &b) const
// -------------------------------------------------------------------------------------------------------------
// EdgeOrientationFilter implementation
-EdgeOrientationFilter::EdgeOrientationFilter (double amin, bool include_amin, double amax, bool include_amax, bool inverse)
- : m_inverse (inverse), m_checker (amin, include_amin, amax, include_amax)
+EdgeOrientationFilter::EdgeOrientationFilter (double amin, bool include_amin, double amax, bool include_amax, bool inverse, bool absolute)
+ : m_checker (amin, include_amin, amax, include_amax, inverse, absolute)
{
// .. nothing yet ..
}
-EdgeOrientationFilter::EdgeOrientationFilter (double a, bool inverse)
- : m_inverse (inverse), m_checker (a, true, a, true)
+EdgeOrientationFilter::EdgeOrientationFilter (double a, bool inverse, bool absolute)
+ : m_checker (a, true, a, true, inverse, absolute)
{
// .. nothing yet ..
}
@@ -273,9 +281,9 @@ EdgeOrientationFilter::selected (const db::Edge &edge) const
// NOTE: this edge normalization confines the angle to a range between (-90 .. 90] (-90 excluded).
// A horizontal edge has 0 degree, a vertical one has 90 degree.
if (edge.dx () < 0 || (edge.dx () == 0 && edge.dy () < 0)) {
- return m_checker (db::Vector (edge.ortho_length (), 0), -edge.d ()) != m_inverse;
+ return m_checker (db::Vector (edge.ortho_length (), 0), -edge.d ());
} else {
- return m_checker (db::Vector (edge.ortho_length (), 0), edge.d ()) != m_inverse;
+ return m_checker (db::Vector (edge.ortho_length (), 0), edge.d ());
}
}
@@ -289,20 +297,20 @@ SpecialEdgeOrientationFilter::SpecialEdgeOrientationFilter (FilterType type, boo
}
static EdgeAngleChecker s_ortho_checkers [] = {
- EdgeAngleChecker (0.0, true, 0.0, true),
- EdgeAngleChecker (90.0, true, 90.0, true)
+ EdgeAngleChecker (0.0, true, 0.0, true, false, false),
+ EdgeAngleChecker (90.0, true, 90.0, true, false, false)
};
static EdgeAngleChecker s_diagonal_checkers [] = {
- EdgeAngleChecker (-45.0, true, -45.0, true),
- EdgeAngleChecker (45.0, true, 45.0, true)
+ EdgeAngleChecker (-45.0, true, -45.0, true, false, false),
+ EdgeAngleChecker (45.0, true, 45.0, true, false, false)
};
static EdgeAngleChecker s_orthodiagonal_checkers [] = {
- EdgeAngleChecker (-45.0, true, -45.0, true),
- EdgeAngleChecker (0.0, true, 0.0, true),
- EdgeAngleChecker (45.0, true, 45.0, true),
- EdgeAngleChecker (90.0, true, 90.0, true)
+ EdgeAngleChecker (-45.0, true, -45.0, true, false, false),
+ EdgeAngleChecker (0.0, true, 0.0, true, false, false),
+ EdgeAngleChecker (45.0, true, 45.0, true, false, false),
+ EdgeAngleChecker (90.0, true, 90.0, true, false, false)
};
bool
diff --git a/src/db/db/dbEdgesUtils.h b/src/db/db/dbEdgesUtils.h
index 531a18fca..ed856e57a 100644
--- a/src/db/db/dbEdgesUtils.h
+++ b/src/db/db/dbEdgesUtils.h
@@ -142,22 +142,23 @@ private:
class DB_PUBLIC EdgeAngleChecker
{
public:
- EdgeAngleChecker (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end);
+ EdgeAngleChecker (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute);
bool operator() (const db::Edge &a, const db::Edge &b) const
{
- return m_all || check (a.d (), b.d ());
+ return (m_all || check (a.d (), b.d ()) || (m_absolute && check (b.d (), a.d ()))) != m_inverse;
}
bool operator() (const db::Vector &a, const db::Vector &b) const
{
- return m_all || check (a, b);
+ return (m_all || check (a, b) || (m_absolute && check (b, a))) != m_inverse;
}
private:
db::CplxTrans m_t_start, m_t_end;
bool m_include_start, m_include_end;
bool m_big_angle, m_all;
+ bool m_inverse, m_absolute;
bool check (const db::Vector &a, const db::Vector &b) const;
};
@@ -181,22 +182,24 @@ struct DB_PUBLIC EdgeOrientationFilter
* @param amin The minimum angle (measured against the x axis)
* @param amax The maximum angle (measured against the x axis)
* @param inverse If set to true, only edges not matching this criterion will be filtered
+ * @param absolute Angles are always positive
*
* This filter will filter out all edges whose angle against x axis
* is larger or equal to amin and less than amax.
*/
- EdgeOrientationFilter (double amin, bool include_amin, double amax, bool include_amax, bool inverse);
+ EdgeOrientationFilter (double amin, bool include_amin, double amax, bool include_amax, bool inverse, bool absolute);
/**
* @brief Constructor
*
* @param a The angle (measured against the x axis)
* @param inverse If set to true, only edges not matching this criterion will be filtered
+ * @param absolute Angles are always positive
*
* This filter will filter out all edges whose angle against x axis
* is equal to a.
*/
- EdgeOrientationFilter (double a, bool inverse);
+ EdgeOrientationFilter (double a, bool inverse, bool absolute);
/**
* @brief Returns true if the edge orientation matches the criterion
diff --git a/src/db/db/dbRegionProcessors.cc b/src/db/db/dbRegionProcessors.cc
index b61dd2eaf..f432aec21 100644
--- a/src/db/db/dbRegionProcessors.cc
+++ b/src/db/db/dbRegionProcessors.cc
@@ -30,8 +30,8 @@ namespace db
// -----------------------------------------------------------------------------------
// CornerDetectorCore implementation
-CornerDetectorCore::CornerDetectorCore (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
- : m_checker (angle_start, include_angle_start, angle_end, include_angle_end)
+CornerDetectorCore::CornerDetectorCore (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
+ : m_checker (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute)
{
// .. nothing yet ..
}
diff --git a/src/db/db/dbRegionProcessors.h b/src/db/db/dbRegionProcessors.h
index de017aa7c..9593ec782 100644
--- a/src/db/db/dbRegionProcessors.h
+++ b/src/db/db/dbRegionProcessors.h
@@ -114,7 +114,7 @@ private:
class DB_PUBLIC CornerDetectorCore
{
public:
- CornerDetectorCore (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end);
+ CornerDetectorCore (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute);
virtual ~CornerDetectorCore () { }
void detect_corners (const db::Polygon &poly, const CornerPointDelivery &delivery) const;
@@ -130,8 +130,8 @@ class DB_PUBLIC CornersAsRectangles
: public db::PolygonProcessorBase, private CornerDetectorCore
{
public:
- CornersAsRectangles (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, db::Coord dim = 1)
- : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end), m_dim (dim)
+ CornersAsRectangles (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute, db::Coord dim = 1)
+ : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute), m_dim (dim)
{
// .. nothing yet ..
}
@@ -159,8 +159,8 @@ class DB_PUBLIC CornersAsDots
: public db::PolygonToEdgeProcessorBase, private CornerDetectorCore
{
public:
- CornersAsDots (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
- : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end)
+ CornersAsDots (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
+ : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute)
{
// .. nothing yet ..
}
@@ -184,8 +184,8 @@ class DB_PUBLIC CornersAsEdgePairs
: public db::PolygonToEdgePairProcessorBase, private CornerDetectorCore
{
public:
- CornersAsEdgePairs (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
- : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end)
+ CornersAsEdgePairs (double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
+ : CornerDetectorCore (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute)
{
// .. nothing yet ..
}
diff --git a/src/db/db/gsiDeclDbCompoundOperation.cc b/src/db/db/gsiDeclDbCompoundOperation.cc
index 0ee676e20..cc8f93eff 100644
--- a/src/db/db/gsiDeclDbCompoundOperation.cc
+++ b/src/db/db/gsiDeclDbCompoundOperation.cc
@@ -214,22 +214,22 @@ static db::CompoundRegionOperationNode *new_count_filter (db::CompoundRegionOper
return new db::CompoundRegionCountFilterNode (input, invert, min_count, max_count);
}
-static db::CompoundRegionOperationNode *new_corners_as_rectangles (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, db::Coord dim = 1)
+static db::CompoundRegionOperationNode *new_corners_as_rectangles (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, db::Coord dim, bool inverse, bool absolute)
{
check_non_null (input, "input");
- return new db::CompoundRegionProcessingOperationNode (new db::CornersAsRectangles (angle_start, include_angle_start, angle_end, include_angle_end, dim), input, true /*processor is owned*/, dim /*dist adder*/);
+ return new db::CompoundRegionProcessingOperationNode (new db::CornersAsRectangles (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute, dim), input, true /*processor is owned*/, dim /*dist adder*/);
}
-static db::CompoundRegionOperationNode *new_corners_as_dots (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
+static db::CompoundRegionOperationNode *new_corners_as_dots (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
{
check_non_null (input, "input");
- return new db::CompoundRegionToEdgeProcessingOperationNode (new db::CornersAsDots (angle_start, include_angle_start, angle_end, include_angle_end), input, true /*processor is owned*/);
+ return new db::CompoundRegionToEdgeProcessingOperationNode (new db::CornersAsDots (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute), input, true /*processor is owned*/);
}
-static db::CompoundRegionOperationNode *new_corners_as_edge_pairs (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end)
+static db::CompoundRegionOperationNode *new_corners_as_edge_pairs (db::CompoundRegionOperationNode *input, double angle_start, bool include_angle_start, double angle_end, bool include_angle_end, bool inverse, bool absolute)
{
check_non_null (input, "input");
- return new db::CompoundRegionToEdgePairProcessingOperationNode (new db::CornersAsEdgePairs (angle_start, include_angle_start, angle_end, include_angle_end), input, true /*processor is owned*/);
+ return new db::CompoundRegionToEdgePairProcessingOperationNode (new db::CornersAsEdgePairs (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute), input, true /*processor is owned*/);
}
static db::CompoundRegionOperationNode *new_extents (db::CompoundRegionOperationNode *input, db::Coord e)
@@ -341,10 +341,10 @@ static db::CompoundRegionOperationNode *new_edge_length_sum_filter (db::Compound
return new db::CompoundRegionEdgeFilterOperationNode (new db::EdgeLengthFilter (lmin, lmax, inverse), input, true /*processor is owned*/, true /*sum*/);
}
-static db::CompoundRegionOperationNode *new_edge_orientation_filter (db::CompoundRegionOperationNode *input, bool inverse, double amin, bool include_amin, double amax, bool include_amax)
+static db::CompoundRegionOperationNode *new_edge_orientation_filter (db::CompoundRegionOperationNode *input, bool inverse, double amin, bool include_amin, double amax, bool include_amax, bool absolute_angle)
{
check_non_null (input, "input");
- return new db::CompoundRegionEdgeFilterOperationNode (new db::EdgeOrientationFilter (amin, include_amin, amax, include_amax, inverse), input, true /*processor is owned*/);
+ return new db::CompoundRegionEdgeFilterOperationNode (new db::EdgeOrientationFilter (amin, include_amin, amax, include_amax, inverse, absolute_angle), input, true /*processor is owned*/);
}
static db::CompoundRegionOperationNode *new_polygons (db::CompoundRegionOperationNode *input, db::Coord e)
@@ -617,17 +617,21 @@ Class decl_CompoundRegionOperationNode ("db", "
gsi::constructor ("new_count_filter", &new_count_filter, gsi::arg ("inputs"), gsi::arg ("invert", false), gsi::arg ("min_count", size_t (0)), gsi::arg ("max_count", std::numeric_limits::max ()),
"@brief Creates a node selecting results but their shape count.\n"
) +
- gsi::constructor ("new_corners_as_rectangles", &new_corners_as_rectangles, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"), gsi::arg ("dim"),
+ gsi::constructor ("new_corners_as_rectangles", &new_corners_as_rectangles, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"), gsi::arg ("dim"), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief Creates a node turning corners into rectangles.\n"
+ "\n"
+ "'absolute' and 'inverse' arguments have been added in version 0.29.1.\n"
) +
- gsi::constructor ("new_corners_as_dots", &new_corners_as_dots, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"),
+ gsi::constructor ("new_corners_as_dots", &new_corners_as_dots, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief Creates a node turning corners into dots (single-point edges).\n"
+ "\n"
+ "'absolute' and 'inverse' arguments have been added in version 0.29.1.\n"
) +
- gsi::constructor ("new_corners_as_edge_pairs", &new_corners_as_edge_pairs, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"),
+ gsi::constructor ("new_corners_as_edge_pairs", &new_corners_as_edge_pairs, gsi::arg ("input"), gsi::arg ("angle_min"), gsi::arg ("include_angle_min"), gsi::arg ("angle_max"), gsi::arg ("include_angle_max"), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief Creates a node turning corners into edge pairs containing the two edges adjacent to the corner.\n"
"The first edge will be the incoming edge and the second one the outgoing edge.\n"
"\n"
- "This feature has been introduced in version 0.27.1.\n"
+ "This feature has been introduced in version 0.27.1. 'absolute' and 'inverse' arguments have been added in version 0.29.1.\n"
) +
gsi::constructor ("new_extents", &new_extents, gsi::arg ("input"), gsi::arg ("e", 0),
"@brief Creates a node returning the extents of the objects.\n"
@@ -759,8 +763,10 @@ Class decl_CompoundRegionOperationNode ("db", "
gsi::constructor ("new_edge_length_sum_filter", &new_edge_length_sum_filter, gsi::arg ("input"), gsi::arg ("inverse", false), gsi::arg ("lmin", 0), gsi::arg ("lmax", std::numeric_limits::max (), "max"),
"@brief Creates a node filtering edges by their length sum (over the local set).\n"
) +
- gsi::constructor ("new_edge_orientation_filter", &new_edge_orientation_filter, gsi::arg ("input"), gsi::arg ("inverse"), gsi::arg ("amin"), gsi::arg ("include_amin"), gsi::arg ("amax"), gsi::arg ("include_amax"),
+ gsi::constructor ("new_edge_orientation_filter", &new_edge_orientation_filter, gsi::arg ("input"), gsi::arg ("inverse"), gsi::arg ("amin"), gsi::arg ("include_amin"), gsi::arg ("amax"), gsi::arg ("include_amax"), gsi::arg ("absolute_angle", false),
"@brief Creates a node filtering edges by their orientation.\n"
+ "\n"
+ "'absolute_angle' has been introduced in version 0.29.1."
) +
gsi::constructor ("new_polygons", &new_polygons, gsi::arg ("input"), gsi::arg ("e", 0),
"@brief Creates a node converting the input to polygons.\n"
diff --git a/src/db/db/gsiDeclDbEdgePairs.cc b/src/db/db/gsiDeclDbEdgePairs.cc
index b4f6b5447..819ea1b0a 100644
--- a/src/db/db/gsiDeclDbEdgePairs.cc
+++ b/src/db/db/gsiDeclDbEdgePairs.cc
@@ -430,16 +430,16 @@ static db::EdgePairs with_length_both2 (const db::EdgePairs *r, const tl::Varian
return r->filtered (ef);
}
-static db::EdgePairs with_angle1 (const db::EdgePairs *r, double a, bool inverse)
+static db::EdgePairs with_angle1 (const db::EdgePairs *r, double a, bool inverse, bool absolute)
{
- db::EdgeOrientationFilter f (a, inverse);
+ db::EdgeOrientationFilter f (a, inverse, absolute);
db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/);
return r->filtered (ef);
}
-static db::EdgePairs with_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax)
+static db::EdgePairs with_angle2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax, bool absolute)
{
- db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse);
+ db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, absolute);
db::EdgeFilterBasedEdgePairFilter ef (&f, true /*one must match*/);
return r->filtered (ef);
}
@@ -451,16 +451,16 @@ static db::EdgePairs with_angle3 (const db::EdgePairs *r, db::SpecialEdgeOrienta
return r->filtered (ef);
}
-static db::EdgePairs with_angle_both1 (const db::EdgePairs *r, double a, bool inverse)
+static db::EdgePairs with_angle_both1 (const db::EdgePairs *r, double a, bool inverse, bool absolute)
{
- db::EdgeOrientationFilter f (a, inverse);
+ db::EdgeOrientationFilter f (a, inverse, absolute);
db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/);
return r->filtered (ef);
}
-static db::EdgePairs with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax)
+static db::EdgePairs with_angle_both2 (const db::EdgePairs *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax, bool absolute)
{
- db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse);
+ db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, absolute);
db::EdgeFilterBasedEdgePairFilter ef (&f, false /*both must match*/);
return r->filtered (ef);
}
@@ -926,12 +926,16 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"\n"
"This method has been added in version 0.27.1.\n"
) +
- method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"),
+ method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), gsi::arg ("absolute_angle", false),
"@brief Filter the edge pairs by orientation of their edges\n"
"Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only "
"edge pairs with at least one edge having the given angle to the x-axis are returned. If \"inverse\" is true, "
"edge pairs not fulfilling this criterion are returned.\n"
"\n"
+ "With 'absolute_angle' set to false (the default), the angle against the x axis can be negative or positive. "
+ "Edges pointing 'down' make negative angles while edges pointing 'up' make positive angles. With "
+ "'absolute_angle' set to true, the angles are always positive.\n"
+ "\n"
"This will filter edge pairs with at least one horizontal edge:\n"
"\n"
"@code\n"
@@ -946,9 +950,9 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"others = edge_pairs.with_angle_both(0, true)\n"
"@/code\n"
"\n"
- "This method has been added in version 0.27.1.\n"
+ "This method has been added in version 0.27.1. 'absolute_angle' has been introduced in version 0.29.1.\n"
) +
- method_ext ("with_angle", with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false),
+ method_ext ("with_angle", with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), gsi::arg ("absolute_angle", false),
"@brief Filter the edge pairs by orientation of their edges\n"
"Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only "
"edge pairs with at least one edge having an angle between min_angle and max_angle are returned. If \"inverse\" is true, "
@@ -957,6 +961,10 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"With \"include_min_angle\" set to true (the default), the minimum angle is included in the criterion while with false, the "
"minimum angle itself is not included. Same for \"include_max_angle\" where the default is false, meaning the maximum angle is not included in the range.\n"
"\n"
+ "With 'absolute_angle' set to false (the default), the angle against the x axis can be negative or positive. "
+ "Edges pointing 'down' make negative angles while edges pointing 'up' make positive angles. With "
+ "'absolute_angle' set to true, the angles are always positive.\n"
+ "\n"
"Note that the inverse @b result @/b of \\with_angle is delivered by \\with_angle_both with the inverse flag set as edge pairs are unselected when both edges fail to meet the criterion.\n"
"I.e\n"
"\n"
@@ -965,7 +973,7 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"others = edge_pairs.with_angle_both(0, 45, true)\n"
"@/code\n"
"\n"
- "This method has been added in version 0.27.1.\n"
+ "This method has been added in version 0.27.1. 'absolute_angle' has been introduced in version 0.29.1.\n"
) +
method_ext ("with_angle", with_angle3, gsi::arg ("type"), gsi::arg ("inverse"),
"@brief Filter the edge pairs by orientation of their edges\n"
@@ -986,7 +994,7 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"\n"
"This method has been added in version 0.28.\n"
) +
- method_ext ("with_angle_both", with_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"),
+ method_ext ("with_angle_both", with_angle_both1, gsi::arg ("angle"), gsi::arg ("inverse"), gsi::arg ("absolute_angle", false),
"@brief Filter the edge pairs by orientation of both of their edges\n"
"Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only "
"edge pairs with both edges having the given angle to the x-axis are returned. If \"inverse\" is true, "
@@ -1008,7 +1016,7 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"\n"
"This method has been added in version 0.27.1.\n"
) +
- method_ext ("with_angle_both", with_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false),
+ method_ext ("with_angle_both", with_angle_both2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), gsi::arg ("absolute_angle", false),
"@brief Filter the edge pairs by orientation of both of their edges\n"
"Filters the edge pairs in the edge pair collection by orientation. If \"inverse\" is false, only "
"edge pairs with both edges having an angle between min_angle and max_angle are returned. If \"inverse\" is true, "
@@ -1017,6 +1025,10 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"With \"include_min_angle\" set to true (the default), the minimum angle is included in the criterion while with false, the "
"minimum angle itself is not included. Same for \"include_max_angle\" where the default is false, meaning the maximum angle is not included in the range.\n"
"\n"
+ "With 'absolute_angle' set to false (the default), the angle against the x axis can be negative or positive. "
+ "Edges pointing 'down' make negative angles while edges pointing 'up' make positive angles. With "
+ "'absolute_angle' set to true, the angles are always positive.\n"
+ "\n"
"Note that the inverse @b result @/b of \\with_angle_both is delivered by \\with_angle with the inverse flag set as edge pairs are unselected when one edge fails to meet the criterion.\n"
"I.e\n"
"\n"
@@ -1025,7 +1037,7 @@ Class decl_EdgePairs (decl_dbShapeCollection, "db", "EdgePairs",
"others = edge_pairs.with_angle(0, 45, true)\n"
"@/code\n"
"\n"
- "This method has been added in version 0.27.1.\n"
+ "This method has been added in version 0.27.1. 'absolute_angle' has been introduced in version 0.29.1.\n"
) +
method_ext ("with_angle_both", with_angle_both3, gsi::arg ("type"), gsi::arg ("inverse"),
"@brief Filter the edge pairs by orientation of their edges\n"
diff --git a/src/db/db/gsiDeclDbEdges.cc b/src/db/db/gsiDeclDbEdges.cc
index 5fc83ec49..7b2fe4ae2 100644
--- a/src/db/db/gsiDeclDbEdges.cc
+++ b/src/db/db/gsiDeclDbEdges.cc
@@ -438,15 +438,15 @@ static db::Edges with_length2 (const db::Edges *r, const tl::Variant &min, const
return r->filtered (f);
}
-static db::Edges with_angle1 (const db::Edges *r, double a, bool inverse)
+static db::Edges with_angle1 (const db::Edges *r, double a, bool inverse, bool absolute)
{
- db::EdgeOrientationFilter f (a, inverse);
+ db::EdgeOrientationFilter f (a, inverse, absolute);
return r->filtered (f);
}
-static db::Edges with_angle2 (const db::Edges *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax)
+static db::Edges with_angle2 (const db::Edges *r, double amin, double amax, bool inverse, bool include_amin, bool include_amax, bool absolute)
{
- db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse);
+ db::EdgeOrientationFilter f (amin, include_amin, amax, include_amax, inverse, absolute);
return r->filtered (f);
}
@@ -901,19 +901,25 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges",
"\n"
"If you don't want to specify a lower or upper limit, pass nil to that parameter.\n"
) +
- method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"),
+ method_ext ("with_angle", with_angle1, gsi::arg ("angle"), gsi::arg ("inverse"), gsi::arg ("absolute_angle", false),
"@brief Filters the edges by orientation\n"
"Filters the edges in the edge collection by orientation. If \"inverse\" is false, only "
"edges which have the given angle to the x-axis are returned. If \"inverse\" is true, "
"edges not having the given angle are returned.\n"
"\n"
+ "With 'absolute_angle' set to false (the default), the angle against the x axis can be negative or positive. "
+ "Edges pointing 'down' make negative angles while edges pointing 'up' make positive angles. With "
+ "'absolute_angle' set to true, the angles are always positive.\n"
+ "\n"
"This will select horizontal edges:\n"
"\n"
"@code\n"
"horizontal = edges.with_angle(0, false)\n"
"@/code\n"
+ "\n"
+ "'absolute_angle' has been introduced in version 0.29.1."
) +
- method_ext ("with_angle", with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false),
+ method_ext ("with_angle", with_angle2, gsi::arg ("min_angle"), gsi::arg ("max_angle"), gsi::arg ("inverse"), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", false), gsi::arg ("absolute_angle", false),
"@brief Filters the edges by orientation\n"
"Filters the edges in the edge collection by orientation. If \"inverse\" is false, only "
"edges which have an angle to the x-axis larger or equal to \"min_angle\" (depending on \"include_min_angle\") and equal or less than \"max_angle\" (depending on \"include_max_angle\") are "
@@ -923,7 +929,12 @@ Class decl_Edges (decl_dbShapeCollection, "db", "Edges",
"With \"include_min_angle\" set to true (the default), the minimum angle is included in the criterion while with false, the "
"minimum angle itself is not included. Same for \"include_max_angle\" where the default is false, meaning the maximum angle is not included in the range.\n"
"\n"
- "The two \"include..\" arguments have been added in version 0.27."
+ "With 'absolute_angle' set to false (the default), the angle against the x axis can be negative or positive. "
+ "Edges pointing 'down' make negative angles while edges pointing 'up' make positive angles. With "
+ "'absolute_angle' set to true, the angles are always positive.\n"
+ "\n"
+ "The two \"include..\" arguments have been added in version 0.27. "
+ "'absolute_angle' has been introduced in version 0.29.1."
) +
method_ext ("with_angle", with_angle3, gsi::arg ("type"), gsi::arg ("inverse"),
"@brief Filters the edges by orientation type\n"
diff --git a/src/db/db/gsiDeclDbRegion.cc b/src/db/db/gsiDeclDbRegion.cc
index 013c43154..cfd5205e2 100644
--- a/src/db/db/gsiDeclDbRegion.cc
+++ b/src/db/db/gsiDeclDbRegion.cc
@@ -300,19 +300,19 @@ static db::Region *texts_as_boxes2 (const db::Region *r, db::DeepShapeStore &dss
return new db::Region (r->texts_as_boxes (pat, pattern, enl, dss));
}
-static db::Edges corners_to_dots (const db::Region *r, double angle_start, double angle_end, bool include_angle_start, bool include_angle_end)
+static db::Edges corners_to_dots (const db::Region *r, double angle_start, double angle_end, bool include_angle_start, bool include_angle_end, bool inverse, bool absolute)
{
- return r->processed (db::CornersAsDots (angle_start, include_angle_start, angle_end, include_angle_end));
+ return r->processed (db::CornersAsDots (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute));
}
-static db::Region corners_to_boxes (const db::Region *r, double angle_start, double angle_end, db::Coord dim, bool include_angle_start, bool include_angle_end)
+static db::Region corners_to_boxes (const db::Region *r, double angle_start, double angle_end, db::Coord dim, bool include_angle_start, bool include_angle_end, bool inverse, bool absolute)
{
- return r->processed (db::CornersAsRectangles (angle_start, include_angle_start, angle_end, include_angle_end, dim));
+ return r->processed (db::CornersAsRectangles (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute, dim));
}
-static db::EdgePairs corners_to_edge_pairs (const db::Region *r, double angle_start, double angle_end, bool include_angle_start, bool include_angle_end)
+static db::EdgePairs corners_to_edge_pairs (const db::Region *r, double angle_start, double angle_end, bool include_angle_start, bool include_angle_end, bool inverse, bool absolute)
{
- return r->processed (db::CornersAsEdgePairs (angle_start, include_angle_start, angle_end, include_angle_end));
+ return r->processed (db::CornersAsEdgePairs (angle_start, include_angle_start, angle_end, include_angle_end, inverse, absolute));
}
static db::Region *new_si (const db::RecursiveShapeIterator &si)
@@ -1697,7 +1697,7 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region",
"@hide\n"
"This method is provided for DRC implementation.\n"
) +
- method_ext ("corners", &corners_to_boxes, gsi::arg ("angle_min", -180.0), gsi::arg ("angle_max", 180.0), gsi::arg ("dim", 1), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true),
+ method_ext ("corners", &corners_to_boxes, gsi::arg ("angle_min", -180.0), gsi::arg ("angle_max", 180.0), gsi::arg ("dim", 1), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief This method will select all corners whose attached edges satisfy the angle condition.\n"
"\n"
"The angle values specify a range of angles: all corners whose attached edges form an angle "
@@ -1706,29 +1706,35 @@ Class decl_Region (decl_dbShapeCollection, "db", "Region",
"If 'include_angle_min' is true, the angle condition is >= min. angle, otherwise it is > min. angle. "
"Same for 'include_angle_,ax' and the max. angle.\n"
"\n"
- "The angle is measured "
+ "With 'absolute' set to false (the default), the angle is measured "
"between the incoming and the outcoming edge in mathematical sense: a positive value is a turn left "
"while a negative value is a turn right. Since polygon contours are oriented clockwise, positive "
"angles will report concave corners while negative ones report convex ones.\n"
+ "With the 'absolute' option set to true, there is no such distinction and angle values are always positive.\n"
+ "\n"
+ "With 'inverse' set to true, the method will select corners not meeting the angle criterion.\n"
"\n"
"A similar function that reports corners as point-like edges is \\corners_dots.\n"
"\n"
- "This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27.\n"
+ "This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. "
+ "'inverse' and 'absolute' have been added in version 0.29.1.\n"
) +
- method_ext ("corners_dots", &corners_to_dots, gsi::arg ("angle_start", -180.0), gsi::arg ("angle_end", 180.0), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true),
+ method_ext ("corners_dots", &corners_to_dots, gsi::arg ("angle_start", -180.0), gsi::arg ("angle_end", 180.0), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief This method will select all corners whose attached edges satisfy the angle condition.\n"
"\n"
"This method is similar to \\corners, but delivers an \\Edges collection with dot-like edges for each corner.\n"
"\n"
- "This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27.\n"
+ "This method has been introduced in version 0.25. 'include_min_angle' and 'include_max_angle' have been added in version 0.27. "
+ "'inverse' and 'absolute' have been added in version 0.29.1.\n"
) +
- method_ext ("corners_edge_pairs", &corners_to_edge_pairs, gsi::arg ("angle_start", -180.0), gsi::arg ("angle_end", 180.0), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true),
+ method_ext ("corners_edge_pairs", &corners_to_edge_pairs, gsi::arg ("angle_start", -180.0), gsi::arg ("angle_end", 180.0), gsi::arg ("include_min_angle", true), gsi::arg ("include_max_angle", true), gsi::arg ("inverse", false), gsi::arg ("absolute", false),
"@brief This method will select all corners whose attached edges satisfy the angle condition.\n"
"\n"
"This method is similar to \\corners, but delivers an \\EdgePairs collection with an edge pairs for each corner.\n"
"The first edge is the incoming edge of the corner, the second one the outgoing edge.\n"
"\n"
- "This method has been introduced in version 0.27.1.\n"
+ "This method has been introduced in version 0.27.1. "
+ "'inverse' and 'absolute' have been added in version 0.29.1.\n"
) +
method ("merge", (db::Region &(db::Region::*) ()) &db::Region::merge,
"@brief Merge the region\n"
diff --git a/src/db/unit_tests/dbAsIfFlatRegionTests.cc b/src/db/unit_tests/dbAsIfFlatRegionTests.cc
index e966e6597..55d459000 100644
--- a/src/db/unit_tests/dbAsIfFlatRegionTests.cc
+++ b/src/db/unit_tests/dbAsIfFlatRegionTests.cc
@@ -1043,13 +1043,13 @@ TEST(21_Processors)
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (1, 0)), r1);
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), r1.processed (db::CornersAsDots (-180.0, true, 180.0, true)));
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), r1.processed (db::CornersAsDots (0.0, true, 180.0, true)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), r1.processed (db::CornersAsDots (-180.0, true, 180.0, true, false, false)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), r1.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)));
db::Region ext;
- r1.processed (db::CornersAsDots (0.0, true, 180.0, true)).extended (ext, 1000, 1000, 2000, 2000);
+ r1.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)).extended (ext, 1000, 1000, 2000, 2000);
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (12, 0)), ext);
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (13, 0)), r1.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, 2000)));
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (14, 0)), r1.processed (db::CornersAsRectangles (0.0, true, 180.0, true, 2000)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (13, 0)), r1.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, false, false, 2000)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (14, 0)), r1.processed (db::CornersAsRectangles (0.0, true, 180.0, true, false, false, 2000)));
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (20, 0)), r1.processed (db::extents_processor (0, 0)));
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (21, 0)), r1.processed (db::extents_processor (1000, 2000)));
diff --git a/src/db/unit_tests/dbCompoundOperationTests.cc b/src/db/unit_tests/dbCompoundOperationTests.cc
index 95b790268..f64cce6ee 100644
--- a/src/db/unit_tests/dbCompoundOperationTests.cc
+++ b/src/db/unit_tests/dbCompoundOperationTests.cc
@@ -836,10 +836,10 @@ void run_test15 (tl::TestBase *_this, bool deep)
db::CompoundRegionOperationPrimaryNode *primary = new db::CompoundRegionOperationPrimaryNode ();
- db::CompoundRegionProcessingOperationNode *corners1 = new db::CompoundRegionProcessingOperationNode (new db::CornersAsRectangles (-180.0, true, 180.0, true, 1), primary, true /*processor is owned*/);
+ db::CompoundRegionProcessingOperationNode *corners1 = new db::CompoundRegionProcessingOperationNode (new db::CornersAsRectangles (-180.0, true, 180.0, true, false, false, 1), primary, true /*processor is owned*/);
db::CompoundRegionCountFilterNode count1 (corners1, false, 5, 10000);
- db::CompoundRegionToEdgeProcessingOperationNode *corners2 = new db::CompoundRegionToEdgeProcessingOperationNode (new db::CornersAsDots (-180.0, true, 180.0, true), primary, true /*processor is owned*/);
+ db::CompoundRegionToEdgeProcessingOperationNode *corners2 = new db::CompoundRegionToEdgeProcessingOperationNode (new db::CornersAsDots (-180.0, true, 180.0, true, false, false), primary, true /*processor is owned*/);
db::CompoundRegionCountFilterNode count2 (corners2, true, 5, 10000);
EXPECT_EQ (count1.result_type () == db::CompoundRegionJoinOperationNode::Region, true);
diff --git a/src/db/unit_tests/dbDeepEdgesTests.cc b/src/db/unit_tests/dbDeepEdgesTests.cc
index 381ae4fc7..b078fc808 100644
--- a/src/db/unit_tests/dbDeepEdgesTests.cc
+++ b/src/db/unit_tests/dbDeepEdgesTests.cc
@@ -327,8 +327,8 @@ TEST(5_Filters)
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (2, 0)), r2);
- db::EdgeOrientationFilter eof1 (0, true, 1, true, false);
- db::EdgeOrientationFilter eof2 (0, true, 1, true, true);
+ db::EdgeOrientationFilter eof1 (0, true, 1, true, false, false);
+ db::EdgeOrientationFilter eof2 (0, true, 1, true, true, false);
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), e2.filtered (eof1));
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), e2.filtered (eof2));
diff --git a/src/db/unit_tests/dbDeepRegionTests.cc b/src/db/unit_tests/dbDeepRegionTests.cc
index 9212846a5..8826f1f8d 100644
--- a/src/db/unit_tests/dbDeepRegionTests.cc
+++ b/src/db/unit_tests/dbDeepRegionTests.cc
@@ -1264,13 +1264,13 @@ TEST(21_Processors)
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (1, 0)), r1);
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), r1.processed (db::CornersAsDots (-180.0, true, 180.0, true)));
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), r1.processed (db::CornersAsDots (0.0, true, 180.0, true)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (10, 0)), r1.processed (db::CornersAsDots (-180.0, true, 180.0, true, false, false)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (11, 0)), r1.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)));
db::Region ext;
- r1.processed (db::CornersAsDots (0.0, true, 180.0, true)).extended (ext, 1000, 1000, 2000, 2000);
+ r1.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)).extended (ext, 1000, 1000, 2000, 2000);
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (12, 0)), ext);
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (13, 0)), r1.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, 2000)));
- target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (14, 0)), r1.processed (db::CornersAsRectangles (0.0, true, 180.0, true, 2000)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (13, 0)), r1.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, false, false, 2000)));
+ target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (14, 0)), r1.processed (db::CornersAsRectangles (0.0, true, 180.0, true, false, false, 2000)));
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (20, 0)), r1.processed (db::extents_processor (0, 0)));
target.insert (target_top_cell_index, target.get_layer (db::LayerProperties (21, 0)), r1.processed (db::extents_processor (1000, 2000)));
diff --git a/src/db/unit_tests/dbEdgePairsTests.cc b/src/db/unit_tests/dbEdgePairsTests.cc
index 1e42dc574..b91972ec8 100644
--- a/src/db/unit_tests/dbEdgePairsTests.cc
+++ b/src/db/unit_tests/dbEdgePairsTests.cc
@@ -166,6 +166,7 @@ TEST(5_InternalAngleFilter)
{
db::EdgePair ep0 (db::Edge (db::Point (0, 0), db::Point (100, 0)), db::Edge (db::Point (100, 0), db::Point (0, 0)));
db::EdgePair ep45 (db::Edge (db::Point (0, 0), db::Point (100, 0)), db::Edge (db::Point (0, 0), db::Point (100, 100)));
+ db::EdgePair ep45inv (db::Edge (db::Point (0, 0), db::Point (100, 100)), db::Edge (db::Point (0, 0), db::Point (100, 0)));
db::EdgePair ep180 (db::Edge (db::Point (0, 0), db::Point (100, 0)), db::Edge (db::Point (0, 0), db::Point (100, 0)));
db::EdgePair ep90 (db::Edge (db::Point (0, 0), db::Point (100, 0)), db::Edge (db::Point (0, 0), db::Point (0, 100)));
db::EdgePair epm90 (db::Edge (db::Point (0, 0), db::Point (100, 0)), db::Edge (db::Point (0, 100), db::Point (0, 0)));
@@ -187,6 +188,7 @@ TEST(5_InternalAngleFilter)
EXPECT_EQ (db::InternalAngleEdgePairFilter (45.0, false).selected (ep90), false);
EXPECT_EQ (db::InternalAngleEdgePairFilter (45.0, false).selected (epm90), false);
EXPECT_EQ (db::InternalAngleEdgePairFilter (45.0, false).selected (ep45), true);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (45.0, false).selected (ep45inv), true);
EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true).selected (ep0), false);
EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true).selected (ep180), false);
@@ -199,4 +201,12 @@ TEST(5_InternalAngleFilter)
EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, false).selected (ep90), false);
EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, false).selected (epm90), false);
EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, false).selected (ep45), true);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, false).selected (ep45inv), true);
+
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (ep0), false);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (ep180), false);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (ep90), true);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (epm90), true);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (ep45), false);
+ EXPECT_EQ (db::InternalAngleEdgePairFilter (0.0, true, 45.0, true, true).selected (ep45inv), false);
}
diff --git a/src/db/unit_tests/dbEdgesTests.cc b/src/db/unit_tests/dbEdgesTests.cc
index d9cb66589..56a21d00f 100644
--- a/src/db/unit_tests/dbEdgesTests.cc
+++ b/src/db/unit_tests/dbEdgesTests.cc
@@ -202,55 +202,63 @@ TEST(4)
EXPECT_EQ (db::compare (rr, "(0,0;0,200);(0,200;100,200);(100,200;100,0);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (0.0, false);
+ db::EdgeOrientationFilter f1 (0.0, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,200;100,200);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (50.0, true, 80.0, false, false);
+ db::EdgeOrientationFilter f1 (50.0, true, 80.0, false, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(200,0;250,200);(250,-200;300,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (50.0, true, 80.0, false, true);
+ db::EdgeOrientationFilter f1 (-80.0, true, -50.0, false, false, false);
+ EXPECT_EQ (db::compare (r.filtered (f1), "(250,200;300,0);(200,0;250,-200)"), true);
+ }
+ {
+ db::EdgeOrientationFilter f1 (50.0, true, 80.0, false, false, true);
+ EXPECT_EQ (db::compare (r.filtered (f1), "(200,0;250,200);(250,200;300,0);(200,0;250,-200);(250,-200;300,0)"), true);
+ }
+ {
+ db::EdgeOrientationFilter f1 (50.0, true, 80.0, false, true, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,0;0,200);(0,200;100,200);(100,200;100,0);(100,0;0,0);(250,200;300,0);(300,0;200,0);(200,0;250,-200)"), true);
}
{
- db::EdgeOrientationFilter f1 (0.0, true, 1.0, false, false);
+ db::EdgeOrientationFilter f1 (0.0, true, 1.0, false, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,200;100,200);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (-1.0, true, 1.0, false, false);
+ db::EdgeOrientationFilter f1 (-1.0, true, 1.0, false, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,200;100,200);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (-1.0, true, 0.0, false, false);
+ db::EdgeOrientationFilter f1 (-1.0, true, 0.0, false, false, false);
EXPECT_EQ (r.filtered (f1).to_string (), "");
}
{
- db::EdgeOrientationFilter f1 (-1.0, true, 0.0, true, false);
+ db::EdgeOrientationFilter f1 (-1.0, true, 0.0, true, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,200;100,200);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (0.0, true, 1.0, true, false);
+ db::EdgeOrientationFilter f1 (0.0, true, 1.0, true, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,200;100,200);(100,0;0,0);(300,0;200,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (0.0, false, 1.0, true, false);
+ db::EdgeOrientationFilter f1 (0.0, false, 1.0, true, false, false);
EXPECT_EQ (r.filtered (f1).to_string (), "");
}
{
- db::EdgeOrientationFilter f1 (90.0, false);
+ db::EdgeOrientationFilter f1 (90.0, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,0;0,200);(100,200;100,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (90.0, true, 91.0, false, false);
+ db::EdgeOrientationFilter f1 (90.0, true, 91.0, false, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,0;0,200);(100,200;100,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (89.0, true, 91.0, false, false);
+ db::EdgeOrientationFilter f1 (89.0, true, 91.0, false, false, false);
EXPECT_EQ (db::compare (r.filtered (f1), "(0,0;0,200);(100,200;100,0)"), true);
}
{
- db::EdgeOrientationFilter f1 (89.0, true, 90.0, false, false);
+ db::EdgeOrientationFilter f1 (89.0, true, 90.0, false, false, false);
EXPECT_EQ (r.filtered (f1).to_string (), "");
}
}
diff --git a/src/db/unit_tests/dbRegionTests.cc b/src/db/unit_tests/dbRegionTests.cc
index 70ac453b2..eaaee9e8c 100644
--- a/src/db/unit_tests/dbRegionTests.cc
+++ b/src/db/unit_tests/dbRegionTests.cc
@@ -2574,17 +2574,17 @@ TEST(100_Processors)
r.insert (db::Box (db::Point (0, 300), db::Point (200, 400)));
r.insert (db::Box (db::Point (100, 300), db::Point (200, 500)));
- EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-180.0, true, 180.0, true)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,400;100,400);(100,500;100,500);(200,500;200,500)"), true);
- EXPECT_EQ (r.processed (db::CornersAsDots (0.0, true, 180.0, true)).to_string (), "(100,400;100,400)");
- EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-90.0, true, 90.0, true)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,400;100,400);(100,500;100,500);(200,500;200,500)"), true);
- EXPECT_EQ (r.processed (db::CornersAsDots (-90.0, false, 90.0, true)).to_string (), "(100,400;100,400)");
- EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-90.0, true, 90.0, false)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,500;100,500);(200,500;200,500)"), true);
- EXPECT_EQ (r.processed (db::CornersAsDots (-90.0, false, 90.0, false)).to_string (), "");
+ EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-180.0, true, 180.0, true, false, false)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,400;100,400);(100,500;100,500);(200,500;200,500)"), true);
+ EXPECT_EQ (r.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)).to_string (), "(100,400;100,400)");
+ EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-90.0, true, 90.0, true, false, false)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,400;100,400);(100,500;100,500);(200,500;200,500)"), true);
+ EXPECT_EQ (r.processed (db::CornersAsDots (-90.0, false, 90.0, true, false, false)).to_string (), "(100,400;100,400)");
+ EXPECT_EQ (db::compare (r.processed (db::CornersAsDots (-90.0, true, 90.0, false, false, false)), "(100,0;100,0);(0,0;0,0);(0,200;0,200);(100,200;100,200);(200,300;200,300);(0,300;0,300);(0,400;0,400);(100,500;100,500);(200,500;200,500)"), true);
+ EXPECT_EQ (r.processed (db::CornersAsDots (-90.0, false, 90.0, false, false, false)).to_string (), "");
db::Region ext;
- r.processed (db::CornersAsDots (0.0, true, 180.0, true)).extended (ext, 10, 10, 20, 20);
+ r.processed (db::CornersAsDots (0.0, true, 180.0, true, false, false)).extended (ext, 10, 10, 20, 20);
EXPECT_EQ (ext.to_string (), "(90,380;90,420;110,420;110,380)");
- EXPECT_EQ (db::compare (r.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, 2)), "(98,-2;98,2;102,2;102,-2);(-2,-2;-2,2;2,2;2,-2);(-2,198;-2,202;2,202;2,198);(98,198;98,202;102,202;102,198);(198,298;198,302;202,302;202,298);(-2,298;-2,302;2,302;2,298);(-2,398;-2,402;2,402;2,398);(98,398;98,402;102,402;102,398);(98,498;98,502;102,502;102,498);(198,498;198,502;202,502;202,498)"), true);
- EXPECT_EQ (r.processed (db::CornersAsRectangles (0.0, true, 180.0, true, 2)).to_string (), "(98,398;98,402;102,402;102,398)");
+ EXPECT_EQ (db::compare (r.processed (db::CornersAsRectangles (-180.0, true, 180.0, true, false, false, 2)), "(98,-2;98,2;102,2;102,-2);(-2,-2;-2,2;2,2;2,-2);(-2,198;-2,202;2,202;2,198);(98,198;98,202;102,202;102,198);(198,298;198,302;202,302;202,298);(-2,298;-2,302;2,302;2,298);(-2,398;-2,402;2,402;2,398);(98,398;98,402;102,402;102,398);(98,498;98,502;102,502;102,498);(198,498;198,502;202,502;202,498)"), true);
+ EXPECT_EQ (r.processed (db::CornersAsRectangles (0.0, true, 180.0, true, false, false, 2)).to_string (), "(98,398;98,402;102,402;102,398)");
EXPECT_EQ (db::compare (r.processed (db::extents_processor (0, 0)), "(0,0;0,200;100,200;100,0);(0,300;0,500;200,500;200,300)"), true);
EXPECT_EQ (db::compare (r.processed (db::extents_processor (10, 20)), "(-10,-20;-10,220;110,220;110,-20);(-10,280;-10,520;210,520;210,280)"), true);
diff --git a/src/doc/doc/about/drc_ref_drc.xml b/src/doc/doc/about/drc_ref_drc.xml
index 19c63f8b9..a4ad2a239 100644
--- a/src/doc/doc/about/drc_ref_drc.xml
+++ b/src/doc/doc/about/drc_ref_drc.xml
@@ -164,7 +164,7 @@ out = in.drc((width < 0.3).edges - secondary(waive))
This operation selects edges by their angle, measured against the horizontal
axis in the mathematical sense.
-For this measurement edges are considered without their direction and straight lines.
+For this measurement edges are considered without their direction.
A horizontal edge has an angle of zero degree. A vertical one has
an angle of 90 degrees. The angle range is from -90 (exclusive) to 90 degree (inclusive).
@@ -172,20 +172,28 @@ If the input shapes are not polygons or edge pairs, they are converted to edges
before the angle test is made.
For example, the following code selects all edges from the primary shape which are 45 degree
-(up) or 135 degree (down). The "+" will join the results:
+(up) or -45 degree (down). The "+" operator will join the results:
-out = in.drc((angle == 45) + (angle == 135))
-out = in.drc((primary.angle == 45) + (primary.angle == 135)) # equivalent
+out = in.drc((angle == 45) + (angle == -45))
+out = in.drc((primary.angle == 45) + (primary.angle == -45)) # equivalent
-Note that angle checks usually imply the need to rotation variant formation as cells which
+You can avoid using both 45 and -45 degree checks with the 'absolute' option.
+With this option, angles are not signed and the value is the absolute angle
+the edge encloses with the x axis:
+
+
+out = in.drc(angle(absolute) == 45)
+
+
+Note that angle checks usually imply the need for rotation variant formation as cells which
are placed non-rotated and rotated by 90 degree cannot be considered identical. This imposes
a performance penalty in hierarchical mode. If possible, consider using DRC#rectilinear for
example to detect shapes with non-manhattan geometry instead of using angle checks.
The "angle" method is available as a plain function or as a method on DRC expressions.
-The plain function is equivalent to "primary.angle".
+The plain function is equivalent to the method call "primary.angle".
"area" - Selects the primary shape if the area is meeting the condition
@@ -363,8 +371,7 @@ See layer#centers for details abo
Usage:
- expression.corners
-- expression.corners(as_dots)
-- expression.corners(as_boxes)
+- expression.corners([ options ])
This operation acts on polygons and selects the corners of the polygons.
@@ -374,10 +381,20 @@ and negative for the turn to the right. Hence positive angles indicate concave
(inner) corners, negative ones indicate convex (outer) corners.
Angles take values between -180 and 180 degree.
-When using "as_dots" for the argument, the operation will return single-point edges at
+When using "as_dots" for an option, the operation will return single-point edges at
the selected corners. With "as_boxes" (the default), small (2x2 DBU) rectangles will be
produced at each selected corner.
+Another option is "absolute" which selects the corners by absolute angle - i.e left
+and right turns will both be considered positive angles.
+
+Examples for use of the options are:
+
+
+corners(as_dots)
+corners(as_boxes, absolute)
+
+
The following example selects all corners:
diff --git a/src/doc/doc/about/drc_ref_layer.xml b/src/doc/doc/about/drc_ref_layer.xml
index 858e64abc..3d68b9eda 100644
--- a/src/doc/doc/about/drc_ref_layer.xml
+++ b/src/doc/doc/about/drc_ref_layer.xml
@@ -264,8 +264,11 @@ deliver objects that can be converted into polygons. Such objects are of class <
This method produces markers on the corners of the polygons. An angle criterion can be given which
selects corners based on the angle of the connecting edges. Positive angles indicate a left turn
-while negative angles indicate a right turn. Since polygons are oriented clockwise, positive angles
+while negative angles indicate a right turn.
+Since polygons are oriented clockwise, positive angles
indicate concave (inner) corners while negative ones indicate convex (outer) corners
+The 'absolute' option allows turning this off and considering both left and right turns
+positive angles.
The markers generated can be point-like edges or small 2x2 DBU boxes. The latter is the default.
@@ -276,6 +279,8 @@ The options available are:
as_dots : with this option, point-like edges will be produced instead of small boxes
as_edge_pairs : with this option, an edge pair is produced for each corner selected. The first edge
is the incoming edge to the corner, the second edge the outgoing edge.
+absolute : with this option, left and right turns will both be considered positive angles
+negative : with this option, all corners not matching the angle criterion are selected
The following images show the effect of this method:
@@ -3615,13 +3620,13 @@ The following images illustrate the effect of the "without_touching_corners" opt
Usage:
-- layer.with_angle(min .. max)
-- layer.with_angle(value)
-- layer.with_angle(min, max)
+- layer.with_angle(min .. max [, absolute])
+- layer.with_angle(value [, absolute])
+- layer.with_angle(min, max [, absolute])
- layer.with_angle(ortho)
- layer.with_angle(diagonal)
- layer.with_angle(diagonal_only)
-- edge_pair_layer.with_angle(... [, both])
+- edge_pair_layer.with_angle(... [, both] [, absolute])
When called on an edge layer, the method selects edges by their angle,
@@ -3641,6 +3646,11 @@ meeting the angle criterion. In this case an additional argument is accepted whi
either "both" (plain word) to indicate that both edges have to be within the given interval.
Without this argument, it is sufficient for one edge to meet the criterion.
+The "absolute" option is available for edge or edge pair layers.
+Without the "absolute" option, edges sloping down are assigned a negative angle while edges sloping up are assigned
+a positive angle (vertical edges are always 90 degree). With the "absolute" option,
+edges sloping down also have a positive angle which is the one enclosed with the horizontal axis.
+
Here are examples for "with_angle" on edge pair layers:
@@ -4006,21 +4016,25 @@ This method is available for polygon layers only.
Usage:
-- layer.without_angle(min .. max)
-- layer.without_angle(value)
-- layer.without_angle(min, max)
+- layer.without_angle(min .. max [, absolute])
+- layer.without_angle(value [, absolute])
+- layer.without_angle(min, max [, absolute])
- layer.without_angle(ortho)
- layer.without_angle(diagonal)
- layer.without_angle(diagonal_only)
-- edge_pair_layer.without_angle(... [, both])
+- edge_pair_layer.without_angle(... [, both] [, absolute])
The method basically is the inverse of with_angle. It selects all edges
of the edge layer or corners of the polygons which do not have the given angle (second form) or whose angle
is not inside the given interval (first and third form) or of the given type (other forms).
-When called on edge pairs, it selects
-edge pairs by the angles of their edges.
+When called on edge pairs, it selects edge pairs by the angles of their edges.
+
+The "absolute" option is available for edge or edge pair layers. Without the "absolute" option,
+edges sloping down are assigned a negative angle while edges sloping up are assigned
+a positive angle (vertical edges are always 90 degree). With the "absolute" option,
+edges sloping down also have a positive angle which is the one enclosed with the horizontal axis.
A note on the "both" modifier (without_angle called on edge pairs): "both" means that
both edges need to be "without_angle". For example
diff --git a/src/drc/drc/built-in-macros/_drc_complex_ops.rb b/src/drc/drc/built-in-macros/_drc_complex_ops.rb
index 3f093df45..e47290685 100644
--- a/src/drc/drc/built-in-macros/_drc_complex_ops.rb
+++ b/src/drc/drc/built-in-macros/_drc_complex_ops.rb
@@ -691,7 +691,7 @@ CODE
# This operation selects edges by their angle, measured against the horizontal
# axis in the mathematical sense.
#
- # For this measurement edges are considered without their direction and straight lines.
+ # For this measurement edges are considered without their direction.
# A horizontal edge has an angle of zero degree. A vertical one has
# an angle of 90 degrees. The angle range is from -90 (exclusive) to 90 degree (inclusive).
#
@@ -699,23 +699,43 @@ CODE
# before the angle test is made.
#
# For example, the following code selects all edges from the primary shape which are 45 degree
- # (up) or 135 degree (down). The "+" will join the results:
+ # (up) or -45 degree (down). The "+" operator will join the results:
#
# @code
- # out = in.drc((angle == 45) + (angle == 135))
- # out = in.drc((primary.angle == 45) + (primary.angle == 135)) # equivalent
+ # out = in.drc((angle == 45) + (angle == -45))
+ # out = in.drc((primary.angle == 45) + (primary.angle == -45)) # equivalent
# @/code
#
- # Note that angle checks usually imply the need to rotation variant formation as cells which
+ # You can avoid using both 45 and -45 degree checks with the 'absolute' option.
+ # With this option, angles are not signed and the value is the absolute angle
+ # the edge encloses with the x axis:
+ #
+ # @code
+ # out = in.drc(angle(absolute) == 45)
+ # @/code
+ #
+ # Note that angle checks usually imply the need for rotation variant formation as cells which
# are placed non-rotated and rotated by 90 degree cannot be considered identical. This imposes
# a performance penalty in hierarchical mode. If possible, consider using \DRC#rectilinear for
# example to detect shapes with non-manhattan geometry instead of using angle checks.
#
# The "angle" method is available as a plain function or as a method on \DRC# expressions.
- # The plain function is equivalent to "primary.angle".
+ # The plain function is equivalent to the method call "primary.angle".
- def angle
- DRCOpNodeEdgeOrientationFilter::new(@engine, self)
+ def angle(*args)
+
+ filter = DRCOpNodeEdgeOrientationFilter::new(@engine, self)
+
+ args.each do |a|
+ if a.is_a?(DRCAbsoluteMode)
+ filter.absolute = a.value
+ else
+ raise("Invalid argument (#{a.inspect}) for 'angle' method")
+ end
+ end
+
+ filter
+
end
# %DRC%
@@ -758,8 +778,7 @@ CODE
# @name corners
# @brief Selects corners of polygons
# @synopsis expression.corners
- # @synopsis expression.corners(as_dots)
- # @synopsis expression.corners(as_boxes)
+ # @synopsis expression.corners([ options ])
#
# This operation acts on polygons and selects the corners of the polygons.
# It can be put into a condition to select corners by their angles. The angle of
@@ -768,9 +787,19 @@ CODE
# (inner) corners, negative ones indicate convex (outer) corners.
# Angles take values between -180 and 180 degree.
#
- # When using "as_dots" for the argument, the operation will return single-point edges at
+ # When using "as_dots" for an option, the operation will return single-point edges at
# the selected corners. With "as_boxes" (the default), small (2x2 DBU) rectangles will be
# produced at each selected corner.
+ #
+ # Another option is "absolute" which selects the corners by absolute angle - i.e left
+ # and right turns will both be considered positive angles.
+ #
+ # Examples for use of the options are:
+ #
+ # @code
+ # corners(as_dots)
+ # corners(as_boxes, absolute)
+ # @/code
#
# The following example selects all corners:
#
@@ -789,14 +818,20 @@ CODE
# The "corners" method is available as a plain function or as a method on \DRC# expressions.
# The plain function is equivalent to "primary.corners".
- def corners(output_mode = DRCOutputMode::new(:dots))
+ def corners(*args)
@engine._context("corners") do
- if output_mode.is_a?(DRCOutputMode)
- output_mode = output_mode.value
- else
- raise("Invalid argument (#{as_dots.inspect}) for 'corners' method")
+ output_mode = :as_boxes
+ absolute = false
+ args.each do |a|
+ if a.is_a?(DRCOutputMode)
+ output_mode = a.value
+ elsif a.is_a?(DRCAbsoluteMode)
+ absolute = a.value
+ else
+ raise("Invalid argument (#{a.inspect}) for 'corners' method")
+ end
end
- DRCOpNodeCornersFilter::new(@engine, output_mode, self)
+ DRCOpNodeCornersFilter::new(@engine, output_mode, absolute, self)
end
end
@@ -1721,6 +1756,7 @@ class DRCOpNodeEdgeOrientationFilter < DRCOpNodeWithCompare
attr_accessor :input
attr_accessor :inverse
+ attr_accessor :absolute
def initialize(engine, input)
super(engine)
@@ -1748,6 +1784,7 @@ class DRCOpNodeEdgeOrientationFilter < DRCOpNodeWithCompare
args << (self.gt ? false : true)
args << (self.lt ? self.lt : (self.le ? self.le + angle_delta : 180.0))
args << (self.lt ? false : true)
+ args << self.absolute
RBA::CompoundRegionOperationNode::new_edge_orientation_filter(*args)
@@ -2037,12 +2074,16 @@ class DRCOpNodeCornersFilter < DRCOpNodeWithCompare
attr_accessor :input
attr_accessor :output_mode
+ attr_accessor :inverse
+ attr_accessor :absolute
- def initialize(engine, output_mode, input)
+ def initialize(engine, output_mode, absolute, input)
super(engine)
self.output_mode = output_mode
self.input = input
self.description = "corners"
+ self.inverse = false
+ self.absolute = absolute
end
def do_create_node(cache)
@@ -2052,14 +2093,26 @@ class DRCOpNodeCornersFilter < DRCOpNodeWithCompare
args << (self.lt ? self.lt : (self.le ? self.le : 180.0))
args << (self.lt ? false : true)
if self.output_mode == :dots || self.output_mode == :edges
+ args << self.inverse
+ args << self.absolute
RBA::CompoundRegionOperationNode::new_corners_as_dots(*args)
elsif self.output_mode == :edge_pairs
+ args << self.inverse
+ args << self.absolute
RBA::CompoundRegionOperationNode::new_corners_as_edge_pairs(*args)
else
args << 2 # dimension is 2x2 DBU
+ args << self.inverse
+ args << self.absolute
RBA::CompoundRegionOperationNode::new_corners_as_rectangles(*args)
end
end
+
+ def inverted
+ res = self.dup
+ res.inverse = !res.inverse
+ return res
+ end
end
diff --git a/src/drc/drc/built-in-macros/_drc_cop_integration.rb b/src/drc/drc/built-in-macros/_drc_cop_integration.rb
index 8bf358bf0..72d73f44f 100644
--- a/src/drc/drc/built-in-macros/_drc_cop_integration.rb
+++ b/src/drc/drc/built-in-macros/_drc_cop_integration.rb
@@ -770,17 +770,7 @@ CODE
# \DRC# expressions (see \Layer#drc and \DRC#length for more details). In this context,
# the operation acts similar to \Layer#with_length.
- # %DRC%
- # @name angle
- # @brief In universal DRC context: selects edges based on their orientation
- # @synopsis angle (in condition)
- #
- # "angle" represents the edge orientation filter on the primary shape edges in
- # \DRC# expressions (see \Layer#drc and \DRC#angle for more details). In this context,
- # the operation acts similar to \Layer#with_angle.
-
%w(
- angle
area
holes
hulls
@@ -798,6 +788,15 @@ CODE
CODE
end
+ # %DRC%
+ # @name angle
+ # @brief In universal DRC context: selects edges based on their orientation
+ # @synopsis angle (in condition)
+ #
+ # "angle" represents the edge orientation filter on the primary shape edges in
+ # \DRC# expressions (see \Layer#drc and \DRC#angle for more details). In this context,
+ # the operation acts similar to \Layer#with_angle.
+
# %DRC%
# @name corners
# @brief Selects corners of polygons
@@ -817,11 +816,6 @@ CODE
# The "corners" operator can be put into a condition which means it's
# applied to corners meeting a particular angle constraint.
- def _cop_corners(output_mode = DRCOutputMode::new(:boxes))
- # NOTE: this method is a fallback for the respective global ones which route to DRCLayer or here.
- return primary.corners(output_mode)
- end
-
# %DRC%
# @name extent_refs
# @brief Returns partial references to the boundings boxes of the polygons
@@ -897,6 +891,8 @@ CODE
rounded_corners
sized
smoothed
+ corners
+ angle
).each do |f|
# NOTE: these methods are fallback for the respective global ones which route to DRCLayer or here.
eval <<"CODE"
diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb
index 81e325ff3..15e9dc824 100644
--- a/src/drc/drc/built-in-macros/_drc_engine.rb
+++ b/src/drc/drc/built-in-macros/_drc_engine.rb
@@ -551,6 +551,10 @@ module DRC
end
end
+ def absolute
+ DRCAbsoluteMode::new(true)
+ end
+
def as_dots
DRCOutputMode::new(:dots)
end
diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb
index 870591330..c5aa2a64b 100644
--- a/src/drc/drc/built-in-macros/_drc_layer.rb
+++ b/src/drc/drc/built-in-macros/_drc_layer.rb
@@ -861,13 +861,13 @@ CODE
# %DRC%
# @name with_angle
# @brief Selects edges by their angle
- # @synopsis layer.with_angle(min .. max)
- # @synopsis layer.with_angle(value)
- # @synopsis layer.with_angle(min, max)
+ # @synopsis layer.with_angle(min .. max [, absolute])
+ # @synopsis layer.with_angle(value [, absolute])
+ # @synopsis layer.with_angle(min, max [, absolute])
# @synopsis layer.with_angle(ortho)
# @synopsis layer.with_angle(diagonal)
# @synopsis layer.with_angle(diagonal_only)
- # @synopsis edge_pair_layer.with_angle(... [, both])
+ # @synopsis edge_pair_layer.with_angle(... [, both] [, absolute])
#
# When called on an edge layer, the method selects edges by their angle,
# measured against the horizontal axis in the mathematical sense.
@@ -886,6 +886,11 @@ CODE
# either "both" (plain word) to indicate that both edges have to be within the given interval.
# Without this argument, it is sufficient for one edge to meet the criterion.
#
+ # The "absolute" option is available for edge or edge pair layers.
+ # Without the "absolute" option, edges sloping down are assigned a negative angle while edges sloping up are assigned
+ # a positive angle (vertical edges are always 90 degree). With the "absolute" option,
+ # edges sloping down also have a positive angle which is the one enclosed with the horizontal axis.
+ #
# Here are examples for "with_angle" on edge pair layers:
#
# @code
@@ -931,21 +936,25 @@ CODE
# %DRC%
# @name without_angle
# @brief Selects edges by the their angle
- # @synopsis layer.without_angle(min .. max)
- # @synopsis layer.without_angle(value)
- # @synopsis layer.without_angle(min, max)
+ # @synopsis layer.without_angle(min .. max [, absolute])
+ # @synopsis layer.without_angle(value [, absolute])
+ # @synopsis layer.without_angle(min, max [, absolute])
# @synopsis layer.without_angle(ortho)
# @synopsis layer.without_angle(diagonal)
# @synopsis layer.without_angle(diagonal_only)
- # @synopsis edge_pair_layer.without_angle(... [, both])
+ # @synopsis edge_pair_layer.without_angle(... [, both] [, absolute])
#
# The method basically is the inverse of \with_angle. It selects all edges
# of the edge layer or corners of the polygons which do not have the given angle (second form) or whose angle
# is not inside the given interval (first and third form) or of the given type (other forms).
#
- # When called on edge pairs, it selects
- # edge pairs by the angles of their edges.
+ # When called on edge pairs, it selects edge pairs by the angles of their edges.
#
+ # The "absolute" option is available for edge or edge pair layers. Without the "absolute" option,
+ # edges sloping down are assigned a negative angle while edges sloping up are assigned
+ # a positive angle (vertical edges are always 90 degree). With the "absolute" option,
+ # edges sloping down also have a positive angle which is the one enclosed with the horizontal axis.
+ #
# A note on the "both" modifier (without_angle called on edge pairs): "both" means that
# both edges need to be "without_angle". For example
#
@@ -989,57 +998,107 @@ CODE
# The method basically is the inverse of \with_internal_angle. It selects all
# edge pairs by the angle enclosed by their edges, applying the opposite criterion than \with_internal_angle.
- %w(angle internal_angle).each do |f|
- [true, false].each do |inv|
- mn = (inv ? "without" : "with") + "_" + f
- eval <<"CODE"
- def #{mn}(*args)
+ [true, false].each do |inv|
+ mn = (inv ? "without" : "with") + "_angle"
+ eval <<"CODE"
+ def #{mn}(*args)
- @engine._context("#{mn}") do
+ @engine._context("#{mn}") do
- f = :with_#{f}
+ self.data.is_a?(RBA::Region) || self.data.is_a?(RBA::Edges) || self.data.is_a?(RBA::EdgePairs) || raise("Requires an edge, edge pair or polygon layer")
- if "#{f}" == "angle"
- self.data.is_a?(RBA::Region) || self.data.is_a?(RBA::Edges) || self.data.is_a?(RBA::EdgePairs) || raise("Requires an edge, edge pair or polygon layer")
- args = args.select do |a|
- if a.is_a?(DRCBothEdges)
- if !self.data.is_a?(RBA::EdgePairs)
- raise("'both' keyword is only available for edge pair layers")
- end
- f = :with_#{f}_both
- false
- else
- true
- end
+ f = :with_angle
+ absolute = self.data.is_a?(RBA::Region) ? nil : false
+
+ args = args.select do |a|
+ if a.is_a?(DRCBothEdges)
+ if !self.data.is_a?(RBA::EdgePairs)
+ raise("'both' keyword is only available for edge pair layers")
end
- else
- requires_edge_pairs
- end
-
- result_class = self.data.is_a?(RBA::Edges) ? RBA::Edges : RBA::EdgePairs
- if args.size == 1
- a = args[0]
- if a.is_a?(Range)
- DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.begin, a.end, #{inv.inspect}))
- elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges)
- if self.data.is_a?(RBA::Region)
- raise("'ortho', 'diagonal' or 'diagonal_only' keyword is only available for edge or edge pair layers")
- end
- DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.value, #{inv.inspect}))
- else
- DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a, #{inv.inspect}))
+ f = :with_angle_both
+ false
+ elsif a.is_a?(DRCAbsoluteMode)
+ if self.data.is_a?(RBA::Region)
+ raise("'absolute' keyword is only available for edge or edge pair layers")
end
- elsif args.size == 2
- DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, args[0], args[1], #{inv.inspect}))
+ absolute = a.value
+ false
else
- raise("Invalid number of range arguments (1 or 2 expected)")
+ true
end
+ end
+ result_class = self.data.is_a?(RBA::Edges) ? RBA::Edges : RBA::EdgePairs
+ if args.size == 1
+ a = args[0]
+ if a.is_a?(Range)
+ args = [ a.begin, a.end, #{inv.inspect} ]
+ if absolute != nil
+ args += [ true, false, absolute ]
+ end
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, *args))
+ elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges)
+ if self.data.is_a?(RBA::Region)
+ raise("'ortho', 'diagonal' or 'diagonal_only' keyword is only available for edge or edge pair layers")
+ end
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.value, #{inv.inspect}))
+ else
+ args = [ @engine._make_numeric_value(a), #{inv.inspect} ]
+ if absolute != nil
+ args += [ absolute ]
+ end
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, *args))
+ end
+ elsif args.size == 2
+ args = [ @engine._make_numeric_value(args[0]), @engine._make_numeric_value(args[1]), #{inv.inspect} ]
+ if absolute != nil
+ args += [ true, false, absolute ]
+ end
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, *args))
+ else
+ raise("Invalid number of range arguments (1 or 2 expected)")
end
end
-CODE
+
end
+CODE
+ end
+
+ [true, false].each do |inv|
+ mn = (inv ? "without" : "with") + "_internal_angle"
+ eval <<"CODE"
+ def #{mn}(*args)
+
+ @engine._context("#{mn}") do
+
+ f = :with_internal_angle
+
+ requires_edge_pairs
+
+ result_class = self.data.is_a?(RBA::Edges) ? RBA::Edges : RBA::EdgePairs
+ if args.size == 1
+ a = args[0]
+ if a.is_a?(Range)
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.begin, a.end, #{inv.inspect}))
+ elsif a.is_a?(DRCOrthoEdges) || a.is_a?(DRCDiagonalOnlyEdges) || a.is_a?(DRCDiagonalEdges)
+ if self.data.is_a?(RBA::Region)
+ raise("'ortho', 'diagonal' or 'diagonal_only' keyword is only available for edge or edge pair layers")
+ end
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, a.value, #{inv.inspect}))
+ else
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, @engine._make_numeric_value(a), #{inv.inspect}))
+ end
+ elsif args.size == 2
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, result_class, f, @engine._make_numeric_value(args[0]), @engine._make_numeric_value(args[1]), #{inv.inspect}))
+ else
+ raise("Invalid number of range arguments (1 or 2 expected)")
+ end
+
+ end
+
+ end
+CODE
end
# %DRC%
@@ -1231,8 +1290,11 @@ CODE
#
# This method produces markers on the corners of the polygons. An angle criterion can be given which
# selects corners based on the angle of the connecting edges. Positive angles indicate a left turn
- # while negative angles indicate a right turn. Since polygons are oriented clockwise, positive angles
+ # while negative angles indicate a right turn.
+ # Since polygons are oriented clockwise, positive angles
# indicate concave (inner) corners while negative ones indicate convex (outer) corners
+ # The 'absolute' option allows turning this off and considering both left and right turns
+ # positive angles.
#
# The markers generated can be point-like edges or small 2x2 DBU boxes. The latter is the default.
#
@@ -1243,6 +1305,8 @@ CODE
# @li @b as_dots @/b: with this option, point-like edges will be produced instead of small boxes @/li
# @li @b as_edge_pairs @/b: with this option, an edge pair is produced for each corner selected. The first edge
# is the incoming edge to the corner, the second edge the outgoing edge. @/li
+ # @li @b absolute @/b: with this option, left and right turns will both be considered positive angles @/li
+ # @li @b negative @/b: with this option, all corners @b not @/b matching the angle criterion are selected @/li
# @/ul
#
# The following images show the effect of this method:
@@ -1264,6 +1328,8 @@ CODE
output_mode = :boxes
amin = -180.0
amax = 180.0
+ absolute = false
+ inverse = false
args.each do |a|
if a.is_a?(Range)
@@ -1277,21 +1343,35 @@ CODE
amax = a.to_f
elsif a.is_a?(DRCOutputMode)
output_mode = a.value
+ elsif a.is_a?(DRCAbsoluteMode)
+ absolute = a.value
+ elsif a.is_a?(DRCNegative)
+ inverse = true
else
raise("Invalid argument #{a.inspect}")
end
end
- f = :corners
- cls = RBA::Region
+ args = [ amin, amax ]
+
if output_mode == :edges || output_mode == :dots
f = :corners_dots
cls = RBA::Edges
elsif output_mode == :edge_pairs
f = :corners_edge_pairs
cls = RBA::EdgePairs
+ else
+ f = :corners
+ cls = RBA::Region
+ args << 1 # 2x2 DBU boxes
end
- DRCLayer::new(@engine, @engine._tcmd(self.data, 0, cls, f, amin, amax))
+
+ args << true # include amin
+ args << true # include amax
+ args << inverse
+ args << absolute
+
+ DRCLayer::new(@engine, @engine._tcmd(self.data, 0, cls, f, *args))
end
diff --git a/src/drc/drc/built-in-macros/_drc_tags.rb b/src/drc/drc/built-in-macros/_drc_tags.rb
index 482f18db8..11d826943 100644
--- a/src/drc/drc/built-in-macros/_drc_tags.rb
+++ b/src/drc/drc/built-in-macros/_drc_tags.rb
@@ -123,6 +123,16 @@ module DRC
end
end
+ # A wrapper for the "absolute" flag for
+ # some DRC functions. The purpose of this class
+ # is to identify the value by the class.
+ class DRCAbsoluteMode
+ attr_accessor :value
+ def initialize(v)
+ self.value = v
+ end
+ end
+
# A wrapper for a rectangle error filter mode
# The purpose of this wrapper is to identify the error filter mode
class DRCRectangleErrorFilter
diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc
index 1c8180a8d..495074f48 100644
--- a/src/drc/unit_tests/drcSimpleTests.cc
+++ b/src/drc/unit_tests/drcSimpleTests.cc
@@ -1673,6 +1673,16 @@ TEST(92_issue1594_dual_top)
compare_netlists (_this, output, au);
}
+TEST(93_withAngle)
+{
+ run_test (_this, "93", false);
+}
+
+TEST(93d_withAngle)
+{
+ run_test (_this, "93", true);
+}
+
TEST(100_edge_interaction_with_count)
{
run_test (_this, "100", false);
diff --git a/testdata/drc/drcGenericTests_12.drc b/testdata/drc/drcGenericTests_12.drc
index 9993793f2..159721a62 100644
--- a/testdata/drc/drcGenericTests_12.drc
+++ b/testdata/drc/drcGenericTests_12.drc
@@ -27,4 +27,6 @@ l1.drc(angle < 0.0).output(111, 0)
l1.drc(primary.angle > 0.0).output(112, 0)
l1.drc(primary.edges.angle == 90).output(113, 0)
l1.drc((angle == 0.0) + (angle == 90)).output(114, 0)
+l1.drc(angle == 45).output(115, 0)
+l1.drc(angle(absolute) == 45).output(116, 0)
diff --git a/testdata/drc/drcGenericTests_6.drc b/testdata/drc/drcGenericTests_6.drc
index 4b49eab6d..80da9f09d 100644
--- a/testdata/drc/drcGenericTests_6.drc
+++ b/testdata/drc/drcGenericTests_6.drc
@@ -23,6 +23,8 @@ l1.drc(corners(as_boxes) == -90).output(102, 0) # outer corners
l1.drc(corners(as_boxes) == 90).output(103, 0) # inner corners
l1.drc(corners(as_boxes) <= -90).output(104, 0)
l1.drc(corners(as_edge_pairs) == 90).output(105, 0)
+l1.drc(corners(as_boxes, absolute) == 90).output(106, 0) # inner and outer corners
+l1.drc(corners(as_boxes) != 90).output(107, 0) # not inner corners
l1.drc(middle).output(110, 0)
l1.drc(middle(as_dots)).output(111, 0)
diff --git a/testdata/drc/drcGenericTests_au12.gds b/testdata/drc/drcGenericTests_au12.gds
index 64cea5f5cd9d98285a0c08f4a59076ad579681cc..832d5dcfa05085550708d662b5819259daf44aaf 100644
GIT binary patch
delta 1088
zcmZ`&&rcIk5MJuC{Xtu{EoHmB-EIq>j6%~iYc;6Va8MLW6Az{b>A{0BfFycV8xuoJ
zPzm2n1-Y3R67=Rp>A`ps?b>(Tm!Dz~Ic=w(7w{GxOfQnfd1XzP3)^nXW3D;`3cp
ztUjOro1!X1N>T|biNA9t;M2~XIi)B=`}&Wcym$EQyJzhqQ?DjAA6G9ZR{wwNUREz_
zD5V7KfVmcMkuz*gaVw^w>CfYhR=_2H5nJ?R&~KudP|;4B*bSPP4;1k!P{5XDV~1)=
z6nBFHdQio5Fpsx!AAQvlBi>yzVZ#a23L1Vya-&X-uoC@@lAePe(O{VdZVw7H2MawYU!npl^!pNJctzAk1twx9GI5tE
zo2NS$n~sg|2|??-u(ASQ;~iKA?(1dDW^Ejc+i2+pYzh_UV|fyQAsVu*5h8|TISGy1
zFf@+2gi9+3JRG`Witsx(k7W~l9Vy9XE7D3RA#5kEsmp9aj;xOzez##;ykq
y*khht+cc}|Qm*m#=UL2y_vbq5u3Z$s`4A>qDRUA
delta 1074
zcmZ`%&ref95PsCh>n}=Qq2+bEeQjy+rlDzGo|Pb=@t}w)Mh}J<(t`&>0`dn)FeV-}
zsHES~7<)4@D0nek6i&t%QO-t9FW!vy9{`-$EzygI&CJfs?tC-fcW1J7ZpN^TK;Wv8
z?Fs~c7+prh=r=0H(SLm-6tJewpD~Q&k?yh6_fA}R_pE*L?B;Ou@yrz?+x_2nuV$`W
zXbTB9BpM+f6IqvBiH|`a`x%LNP@+!$M#04Ql0$caLZ69|&>SB2No-N=^CVjVJ7(f#
zTHt0x!XA>!){7?I_c_=JOWX?kxKFvAut3|jP|rBJCTOBC$Tb{yu@sfqj?AGRwb1G*
z<96yWW}?~e;B!o3A}y(ov2adMZ57Ap>_$Dz<|K~CF5z`TBHtsh5w@@(9rbUBuySlQ
zW8oU%T8ic|ImA|Aw_o>J>HUi7l!N6s|LfvguTU74;}WB`htZ^~a*KAAcHnhzI(T5$
z6#i4RmwIQW;Y1Csv_-hfYCkQzf<@aW-v!tGO!z4DO689weZuS`l=Nt>D)jEk9js+F
z2V;Gdyo4tEv8qWiUlM_4Ya-i#q$6j;lSD!vY~j7MwaO
";
}
+ if (! comment.empty () && n_comment == 1) {
+ info += "";
+ tl::escape_to_html (info, comment);
+ info += "
";
+ }
+
info += "";
if (item && n_item == 1) {
@@ -2901,7 +2916,61 @@ MarkerBrowserPage::flag_menu_selected ()
}
}
-void
+void
+MarkerBrowserPage::edit_button_clicked ()
+{
+ if (! mp_database) {
+ return;
+ }
+
+ MarkerBrowserListViewModel *list_model = dynamic_cast (markers_list->model ());
+ if (! list_model) {
+ return;
+ }
+
+ std::string str;
+
+ QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
+ for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ if (selected_item->column () == 0) {
+ const rdb::Item *i = list_model->item (selected_item->row ());
+ if (! i->comment ().empty ()) {
+ if (str.empty ()) {
+ str = i->comment ();
+ } else if (str != i->comment ()) {
+ str.clear ();
+ break;
+ }
+ }
+ }
+ }
+
+ bool ok = false;
+
+#if QT_VERSION >= 0x50200
+ QString new_text = QInputDialog::getMultiLineText (this, QObject::tr ("Edit Marker Comment"), QObject::tr ("Comment"), tl::to_qstring (str), &ok);
+ str = tl::to_string (new_text);
+#else
+ QString new_text = QInputDialog::getText (this, QObject::tr ("Edit Marker Comment"), QObject::tr ("Comment"), QLineEdit::Normal, tl::to_qstring (tl::escape_string (str)), &ok);
+ str = tl::unescape_string (tl::to_string (new_text));
+#endif
+
+ if (ok) {
+
+ QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
+ for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ if (selected_item->column () == 0) {
+ const rdb::Item *i = list_model->item (selected_item->row ());
+ mp_database->set_item_comment (i, str);
+ }
+ }
+
+ update_info_text ();
+
+ }
+}
+
+void
MarkerBrowserPage::waived_button_clicked ()
{
if (! mp_database) {
diff --git a/src/layui/layui/rdbMarkerBrowserPage.h b/src/layui/layui/rdbMarkerBrowserPage.h
index 58cd27ecc..7a916b1f6 100644
--- a/src/layui/layui/rdbMarkerBrowserPage.h
+++ b/src/layui/layui/rdbMarkerBrowserPage.h
@@ -179,6 +179,7 @@ public slots:
void flag_menu_selected ();
void important_button_clicked ();
void waived_button_clicked ();
+ void edit_button_clicked ();
void snapshot_button_clicked ();
void remove_snapshot_button_clicked ();
void revisit_non_waived ();
From bab4d7b5c7ffedda195703d00f1b02eb7398dcc3 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 27 Apr 2024 21:14:02 +0200
Subject: [PATCH 19/41] Cleanup
---
src/layui/layui/rdbMarkerBrowserPage.cc | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/layui/layui/rdbMarkerBrowserPage.cc b/src/layui/layui/rdbMarkerBrowserPage.cc
index 657f52a14..e6c87b117 100644
--- a/src/layui/layui/rdbMarkerBrowserPage.cc
+++ b/src/layui/layui/rdbMarkerBrowserPage.cc
@@ -2265,8 +2265,6 @@ MarkerBrowserPage::do_update_markers ()
item_index = size_t (selected_item->row ());
++n_item;
- std::string info;
-
const rdb::Cell *c = mp_database->cell_by_id (item->cell_id ());
if (c && c != cell) {
cell = c;
@@ -2931,7 +2929,7 @@ MarkerBrowserPage::edit_button_clicked ()
std::string str;
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (! i->comment ().empty ()) {
@@ -2958,7 +2956,7 @@ MarkerBrowserPage::edit_button_clicked ()
if (ok) {
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
mp_database->set_item_comment (i, str);
@@ -2988,7 +2986,7 @@ MarkerBrowserPage::waived_button_clicked ()
size_t nno = 0;
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3026,7 +3024,7 @@ MarkerBrowserPage::important_button_clicked ()
size_t nno = 0;
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3065,7 +3063,7 @@ MarkerBrowserPage::remove_snapshot_button_clicked ()
if (msgbox.exec () == QMessageBox::Yes) {
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3092,7 +3090,7 @@ MarkerBrowserPage::snapshot_button_clicked ()
}
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3257,7 +3255,7 @@ MarkerBrowserPage::mark_important ()
id_type important_tag_id = mp_database->tags ().tag ("important").id ();
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3284,7 +3282,7 @@ MarkerBrowserPage::mark_unimportant ()
id_type important_tag_id = mp_database->tags ().tag ("important").id ();
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3321,7 +3319,7 @@ MarkerBrowserPage::mark_visited (bool f)
}
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
@@ -3370,7 +3368,7 @@ MarkerBrowserPage::waive_or_unwaive (bool w)
id_type waived_tag_id = mp_database->tags ().tag ("waived").id ();
QModelIndexList selected = markers_list->selectionModel ()->selectedIndexes ();
- for (QModelIndexList::const_iterator selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
+ for (auto selected_item = selected.begin (); selected_item != selected.end (); ++selected_item) {
if (selected_item->column () == 0) {
const rdb::Item *i = list_model->item (selected_item->row ());
if (i) {
From 4b967fcc516cbdb5c1a4561620630155d48ffb8b Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 27 Apr 2024 21:41:04 +0200
Subject: [PATCH 20/41] Show filename in RDB drop-down, 'save' button, bindkeys
for reload, save, open
---
src/layui/layui/MarkerBrowserDialog.ui | 68 +++++++++++++++++++
src/layui/layui/rdbMarkerBrowserDialog.cc | 80 ++++++++++++++++-------
src/layui/layui/rdbMarkerBrowserDialog.h | 7 +-
3 files changed, 125 insertions(+), 30 deletions(-)
diff --git a/src/layui/layui/MarkerBrowserDialog.ui b/src/layui/layui/MarkerBrowserDialog.ui
index a65ca1385..7aee07fe1 100644
--- a/src/layui/layui/MarkerBrowserDialog.ui
+++ b/src/layui/layui/MarkerBrowserDialog.ui
@@ -292,6 +292,74 @@ to load a marker database
+
+
+ Open
+
+
+ Ctrl+O
+
+
+ QAction::NoRole
+
+
+
+
+ Save As
+
+
+ QAction::NoRole
+
+
+
+
+ Reload
+
+
+ F5
+
+
+ QAction::NoRole
+
+
+
+
+ Save
+
+
+ Ctrl+S
+
+
+ QAction::NoRole
+
+
+
+
+ Export To Layout
+
+
+ QAction::NoRole
+
+
+
+
+ Unload
+
+
+ QAction::NoRole
+
+
+
+
+ Unload All
+
+
+ Unload All
+
+
+ QAction::NoRole
+
+
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.cc b/src/layui/layui/rdbMarkerBrowserDialog.cc
index 800025a13..b94829ed8 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.cc
+++ b/src/layui/layui/rdbMarkerBrowserDialog.cc
@@ -84,34 +84,29 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
view ()->rdb_list_changed_event.add (this, &MarkerBrowserDialog::rdbs_changed);
}
- m_open_action = new QAction (QObject::tr ("Open"), mp_ui->file_menu);
- m_saveas_action = new QAction (QObject::tr ("Save As"), mp_ui->file_menu);
- m_export_action = new QAction (QObject::tr ("Export To Layout"), mp_ui->file_menu);
- m_reload_action = new QAction (QObject::tr ("Reload"), mp_ui->file_menu);
- m_unload_action = new QAction (QObject::tr ("Unload"), mp_ui->file_menu);
- m_unload_all_action = new QAction (QObject::tr ("Unload All"), mp_ui->file_menu);
+ connect (mp_ui->open_action, SIGNAL (triggered ()), this, SLOT (open_clicked ()));
+ connect (mp_ui->save_action, SIGNAL (triggered ()), this, SLOT (save_clicked ()));
+ connect (mp_ui->saveas_action, SIGNAL (triggered ()), this, SLOT (saveas_clicked ()));
+ connect (mp_ui->export_action, SIGNAL (triggered ()), this, SLOT (export_clicked ()));
+ connect (mp_ui->reload_action, SIGNAL (triggered ()), this, SLOT (reload_clicked ()));
+ connect (mp_ui->unload_action, SIGNAL (triggered ()), this, SLOT (unload_clicked ()));
+ connect (mp_ui->unload_all_action, SIGNAL (triggered ()), this, SLOT (unload_all_clicked ()));
- connect (m_open_action, SIGNAL (triggered ()), this, SLOT (open_clicked ()));
- connect (m_saveas_action, SIGNAL (triggered ()), this, SLOT (saveas_clicked ()));
- connect (m_export_action, SIGNAL (triggered ()), this, SLOT (export_clicked ()));
- connect (m_reload_action, SIGNAL (triggered ()), this, SLOT (reload_clicked ()));
- connect (m_unload_action, SIGNAL (triggered ()), this, SLOT (unload_clicked ()));
- connect (m_unload_all_action, SIGNAL (triggered ()), this, SLOT (unload_all_clicked ()));
-
- mp_ui->file_menu->addAction (m_open_action);
- mp_ui->file_menu->addAction (m_saveas_action);
+ mp_ui->file_menu->addAction (mp_ui->open_action);
+ mp_ui->file_menu->addAction (mp_ui->save_action);
+ mp_ui->file_menu->addAction (mp_ui->saveas_action);
QAction *sep0 = new QAction (mp_ui->file_menu);
sep0->setSeparator (true);
- mp_ui->file_menu->addAction (m_export_action);
+ mp_ui->file_menu->addAction (mp_ui->export_action);
QAction *sep1 = new QAction (mp_ui->file_menu);
sep1->setSeparator (true);
mp_ui->file_menu->addAction (sep1);
- mp_ui->file_menu->addAction (m_reload_action);
+ mp_ui->file_menu->addAction (mp_ui->reload_action);
QAction *sep2 = new QAction (mp_ui->file_menu);
sep2->setSeparator (true);
mp_ui->file_menu->addAction (sep2);
- mp_ui->file_menu->addAction (m_unload_action);
- mp_ui->file_menu->addAction (m_unload_all_action);
+ mp_ui->file_menu->addAction (mp_ui->unload_action);
+ mp_ui->file_menu->addAction (mp_ui->unload_all_action);
connect (mp_ui->layout_cb, SIGNAL (activated (int)), this, SLOT (cv_index_changed (int)));
connect (mp_ui->rdb_cb, SIGNAL (activated (int)), this, SLOT (rdb_index_changed (int)));
@@ -367,6 +362,34 @@ BEGIN_PROTECTED
END_PROTECTED
}
+void
+MarkerBrowserDialog::save_clicked ()
+{
+BEGIN_PROTECTED
+
+ if (m_rdb_index < int (view ()->num_rdbs ()) && m_rdb_index >= 0) {
+
+ rdb::Database *rdb = view ()->get_rdb (m_rdb_index);
+ if (rdb) {
+
+ if (rdb->filename ().empty ()) {
+
+ saveas_clicked ();
+
+ } else {
+
+ rdb->save (rdb->filename ());
+ rdb->reset_modified ();
+
+ }
+
+ }
+
+ }
+
+END_PROTECTED
+}
+
void
MarkerBrowserDialog::saveas_clicked ()
{
@@ -385,6 +408,9 @@ BEGIN_PROTECTED
rdb->save (fn);
rdb->reset_modified ();
+ // update the RDB title strings
+ rdbs_changed ();
+
}
}
@@ -439,6 +465,7 @@ BEGIN_PROTECTED
int rdb_index = view ()->add_rdb (db.release ());
mp_ui->rdb_cb->setCurrentIndex (rdb_index);
+
// it looks like the setCurrentIndex does not issue this signal:
rdb_index_changed (rdb_index);
@@ -595,6 +622,10 @@ MarkerBrowserDialog::rdbs_changed ()
text += rdb->description ();
text += ")";
}
+ if (! rdb->filename ().empty () && rdb->name () != rdb->filename ()) {
+ text += " - ";
+ text += rdb->filename ();
+ }
mp_ui->rdb_cb->addItem (tl::to_qstring (text));
if (rdb->name () == m_rdb_name) {
rdb_index = i;
@@ -688,11 +719,12 @@ MarkerBrowserDialog::update_content ()
mp_ui->central_stack->setCurrentIndex (1);
}
- m_saveas_action->setEnabled (rdb != 0);
- m_export_action->setEnabled (rdb != 0);
- m_unload_action->setEnabled (rdb != 0);
- m_unload_all_action->setEnabled (rdb != 0);
- m_reload_action->setEnabled (rdb != 0);
+ mp_ui->save_action->setEnabled (rdb != 0);
+ mp_ui->saveas_action->setEnabled (rdb != 0);
+ mp_ui->export_action->setEnabled (rdb != 0);
+ mp_ui->unload_action->setEnabled (rdb != 0);
+ mp_ui->unload_all_action->setEnabled (rdb != 0);
+ mp_ui->reload_action->setEnabled (rdb != 0);
mp_ui->browser_frame->enable_updates (false); // Avoid building the internal lists several times ...
mp_ui->browser_frame->set_rdb (0); // force update
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.h b/src/layui/layui/rdbMarkerBrowserDialog.h
index 482913f6a..a42005566 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.h
+++ b/src/layui/layui/rdbMarkerBrowserDialog.h
@@ -74,6 +74,7 @@ private:
public slots:
void cv_index_changed (int);
void rdb_index_changed (int);
+ void save_clicked ();
void saveas_clicked ();
void export_clicked ();
void reload_clicked ();
@@ -98,12 +99,6 @@ private:
std::string m_rdb_name;
int m_rdb_index;
std::string m_open_filename;
- QAction *m_open_action;
- QAction *m_saveas_action;
- QAction *m_export_action;
- QAction *m_unload_action;
- QAction *m_unload_all_action;
- QAction *m_reload_action;
void update_content ();
void scan_layer ();
From ed64d4a59bf10ae5b0f16394d3812aa1c15a969b Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 27 Apr 2024 23:02:54 +0200
Subject: [PATCH 21/41] DRC enhancements:
- Shapes are added to existing categories rather than creating
a new category with the same name
- The category name in "output" can be an array creating a
hierarchy of categories.
---
src/drc/drc/built-in-macros/_drc_engine.rb | 18 +++++++++++++++++-
src/drc/drc/built-in-macros/_drc_layer.rb | 6 +++++-
src/rdb/rdb/gsiDeclRdb.cc | 1 +
src/rdb/rdb/rdb.cc | 4 ++++
4 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb
index 81e325ff3..0d198f1f8 100644
--- a/src/drc/drc/built-in-macros/_drc_engine.rb
+++ b/src/drc/drc/built-in-macros/_drc_engine.rb
@@ -3226,7 +3226,23 @@ CODE
output_rdb = channel.rdb
output_cell = channel.cell
- cat = output_rdb.create_category(args[0].to_s)
+ categories = args[0]
+ if !categories.is_a?(Array)
+ categories = [ categories.to_s ]
+ end
+
+ cat = nil
+ categories.each do |c|
+ ccat = nil
+ if cat
+ ccat = cat.each_sub_category.find { |i| i.name == c }
+ else
+ ccat = output_rdb.each_category.find { |i| i.name == c }
+ end
+ cat = ccat ? ccat : output_rdb.create_category(cat, c)
+ end
+ cat ||= output_rdb.create_category("default")
+
args[1] && cat.description = args[1]
cat.scan_collection(output_cell, RBA::CplxTrans::new(self.dbu), data)
diff --git a/src/drc/drc/built-in-macros/_drc_layer.rb b/src/drc/drc/built-in-macros/_drc_layer.rb
index 870591330..2d514d687 100644
--- a/src/drc/drc/built-in-macros/_drc_layer.rb
+++ b/src/drc/drc/built-in-macros/_drc_layer.rb
@@ -5111,7 +5111,11 @@ CODE
# This method will copy the content of the layer to the specified output.
#
# If a report database is selected for the output, the specification has to include a
- # category name and optionally a category description.
+ # category name and optionally a category description. The category name can be an
+ # array of strings - in that case, a hierarchy of categories is created
+ # with the first array item being the top level category name.
+ # Shapes are added to an existing category, if a category with the given
+ # name already exists.
#
# If the layout is selected for the output, the specification can consist of
# one to three parameters: a layer number, a data type (optional, default is 0)
diff --git a/src/rdb/rdb/gsiDeclRdb.cc b/src/rdb/rdb/gsiDeclRdb.cc
index 36e134da3..920334d43 100644
--- a/src/rdb/rdb/gsiDeclRdb.cc
+++ b/src/rdb/rdb/gsiDeclRdb.cc
@@ -1342,6 +1342,7 @@ Class decl_ReportDatabase ("rdb", "ReportDatabase",
"@brief Creates a new sub-category\n"
"@param parent The category under which the category should be created\n"
"@param name The name of the category\n"
+ "Since version 0.29.1, 'parent' can be nil. In that case, a top-level category is created."
) +
gsi::method ("category_by_path", &rdb::Database::category_by_name, gsi::arg ("path"),
"@brief Gets a category by path\n"
diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc
index a2e352144..df19f88dc 100644
--- a/src/rdb/rdb/rdb.cc
+++ b/src/rdb/rdb/rdb.cc
@@ -1275,6 +1275,10 @@ Database::import_cells (const Cells &cells)
Category *
Database::create_category (Category *parent, const std::string &name)
{
+ if (! parent) {
+ return create_category (name);
+ }
+
set_modified ();
Category *cat = create_category (&parent->sub_categories (), name);
From 3152be5c3d0e847b9d829d046a087cb4e5431e3b Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 27 Apr 2024 23:36:27 +0200
Subject: [PATCH 22/41] Original file name is written into DRC marker db now
---
src/drc/drc/built-in-macros/_drc_engine.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb
index 0d198f1f8..157154698 100644
--- a/src/drc/drc/built-in-macros/_drc_engine.rb
+++ b/src/drc/drc/built-in-macros/_drc_engine.rb
@@ -3349,7 +3349,7 @@ CODE
else
output_rdb = RBA::ReportDatabase::new(name)
end
-
+
cn = cellname && cellname.to_s
cn ||= @def_cell && @def_cell.name
cn ||= @def_source && @def_source.cell_obj && @def_source.cell_obj.name
@@ -3359,7 +3359,8 @@ CODE
output_rdb.generator = self._generator
output_rdb.top_cell_name = cn
output_rdb.description = description
-
+ output_rdb.original_file = @def_path
+
RDBOutputChannel::new(self, output_rdb, output_rdb_index, cn, output_rdb_file)
end
From aacdc1a4b71c198fff66478c450094d9dfa127d4 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sat, 27 Apr 2024 23:36:48 +0200
Subject: [PATCH 23/41] Info feature for marker browser
---
src/layui/layui/MarkerBrowserDialog.ui | 8 +++++
src/layui/layui/rdbMarkerBrowserDialog.cc | 42 ++++++++++++++++++++++-
src/layui/layui/rdbMarkerBrowserDialog.h | 1 +
3 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/src/layui/layui/MarkerBrowserDialog.ui b/src/layui/layui/MarkerBrowserDialog.ui
index 7aee07fe1..65a398b74 100644
--- a/src/layui/layui/MarkerBrowserDialog.ui
+++ b/src/layui/layui/MarkerBrowserDialog.ui
@@ -360,6 +360,14 @@ to load a marker database
QAction::NoRole
+
+
+ Info
+
+
+ QAction::NoRole
+
+
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.cc b/src/layui/layui/rdbMarkerBrowserDialog.cc
index b94829ed8..6f7fb1f14 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.cc
+++ b/src/layui/layui/rdbMarkerBrowserDialog.cc
@@ -33,6 +33,7 @@
#include "layConverters.h"
#include "layQtTools.h"
#include "layConfigurationDialog.h"
+#include "layBrowserDialog.h"
#include "dbLayoutUtils.h"
#include "dbRecursiveShapeIterator.h"
#include "dbStream.h"
@@ -89,6 +90,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
connect (mp_ui->saveas_action, SIGNAL (triggered ()), this, SLOT (saveas_clicked ()));
connect (mp_ui->export_action, SIGNAL (triggered ()), this, SLOT (export_clicked ()));
connect (mp_ui->reload_action, SIGNAL (triggered ()), this, SLOT (reload_clicked ()));
+ connect (mp_ui->info_action, SIGNAL (triggered ()), this, SLOT (info_clicked ()));
connect (mp_ui->unload_action, SIGNAL (triggered ()), this, SLOT (unload_clicked ()));
connect (mp_ui->unload_all_action, SIGNAL (triggered ()), this, SLOT (unload_all_clicked ()));
@@ -102,6 +104,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
sep1->setSeparator (true);
mp_ui->file_menu->addAction (sep1);
mp_ui->file_menu->addAction (mp_ui->reload_action);
+ mp_ui->file_menu->addAction (mp_ui->info_action);
QAction *sep2 = new QAction (mp_ui->file_menu);
sep2->setSeparator (true);
mp_ui->file_menu->addAction (sep2);
@@ -420,6 +423,42 @@ BEGIN_PROTECTED
END_PROTECTED
}
+void
+MarkerBrowserDialog::info_clicked ()
+{
+ rdb::Database *rdb = 0;
+ if (m_rdb_index < int (view ()->num_rdbs ()) && m_rdb_index >= 0) {
+ rdb = view ()->get_rdb (m_rdb_index);
+ }
+ if (! rdb) {
+ return;
+ }
+
+ std::string html;
+ html = "\n";
+ html += "" + tl::escaped_to_html (rdb->name ()) + "
\n";
+ if (! rdb->description ().empty ()) {
+ html += "" + tl::to_string (tr ("Description: ")) + "" + tl::escaped_to_html (tl::escape_string (rdb->description ())) + "
\n";
+ }
+ if (! rdb->filename ().empty ()) {
+ html += "" + tl::to_string (tr ("File: ")) + "" + tl::escaped_to_html (rdb->filename ()) + "
\n";
+ }
+ if (! rdb->original_file ().empty ()) {
+ html += "" + tl::to_string (tr ("Original File: ")) + "" + tl::escaped_to_html (rdb->original_file ()) + "
\n";
+ }
+ if (! rdb->top_cell_name ().empty ()) {
+ html += "" + tl::to_string (tr ("Top Cell: ")) + "" + tl::escaped_to_html (rdb->top_cell_name ()) + "
\n";
+ }
+ if (! rdb->generator ().empty ()) {
+ html += "" + tl::to_string (tr ("Generator: ")) + "" + tl::escaped_to_html (rdb->generator ()) + "
\n";
+ }
+ html += "";
+
+ std::unique_ptr info_dialog (new lay::BrowserDialog (this, html));
+ info_dialog->setWindowTitle (QObject::tr ("Marker Database Info"));
+ info_dialog->exec ();
+}
+
void
MarkerBrowserDialog::reload_clicked ()
{
@@ -619,7 +658,7 @@ MarkerBrowserDialog::rdbs_changed ()
std::string text = rdb->name ();
if (! rdb->description ().empty ()) {
text += " (";
- text += rdb->description ();
+ text += tl::escape_string (rdb->description ());
text += ")";
}
if (! rdb->filename ().empty () && rdb->name () != rdb->filename ()) {
@@ -725,6 +764,7 @@ MarkerBrowserDialog::update_content ()
mp_ui->unload_action->setEnabled (rdb != 0);
mp_ui->unload_all_action->setEnabled (rdb != 0);
mp_ui->reload_action->setEnabled (rdb != 0);
+ mp_ui->info_action->setEnabled (rdb != 0);
mp_ui->browser_frame->enable_updates (false); // Avoid building the internal lists several times ...
mp_ui->browser_frame->set_rdb (0); // force update
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.h b/src/layui/layui/rdbMarkerBrowserDialog.h
index a42005566..3d651b3fb 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.h
+++ b/src/layui/layui/rdbMarkerBrowserDialog.h
@@ -74,6 +74,7 @@ private:
public slots:
void cv_index_changed (int);
void rdb_index_changed (int);
+ void info_clicked ();
void save_clicked ();
void saveas_clicked ();
void export_clicked ();
From 6e3eb568c342b81c386dfa03294ee3d1c5ff69ce Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 15:30:29 +0200
Subject: [PATCH 24/41] Implementing variant reporting
Instead of reporting working layout cell names, the
original cell names plus a variant indicator is reported.
Also, the variant information from the RDB is filled now.
Also, the marker browser now shows the qname of the cells
instead of the name alone.
---
src/db/db/dbCellVariants.cc | 20 ++++++++----
src/db/db/dbDeepShapeStore.cc | 35 +++++++++++++++++++--
src/db/db/dbHierarchyBuilder.cc | 42 ++++++++++++++++++++++++-
src/db/db/dbHierarchyBuilder.h | 18 ++++++++++-
src/db/db/dbLayout.cc | 3 ++
src/db/db/dbLayout.h | 20 ++++++++++++
src/layui/layui/rdbMarkerBrowserPage.cc | 4 +--
src/rdb/rdb/rdbUtils.cc | 22 +++++++++++--
8 files changed, 149 insertions(+), 15 deletions(-)
diff --git a/src/db/db/dbCellVariants.cc b/src/db/db/dbCellVariants.cc
index d1135c30a..af549ad8a 100644
--- a/src/db/db/dbCellVariants.cc
+++ b/src/db/db/dbCellVariants.cc
@@ -288,6 +288,7 @@ VariantsCollectorBase::separate_variants (std::mapempty ());
for (db::Layout::bottom_up_const_iterator c = mp_layout->begin_bottom_up (); c != mp_layout->end_bottom_up (); ++c) {
@@ -311,6 +312,9 @@ VariantsCollectorBase::separate_variants (std::mapsecond.begin (); v != vc->second.end (); ++v, ++index) {
@@ -333,6 +337,8 @@ VariantsCollectorBase::separate_variants (std::mapfirst.is_unity ()) {
- std::set &tv = m_variants [*c];
- tv.clear ();
- tv.insert (vt.begin ()->first);
- } else {
- m_variants.erase (*c);
+ if (original_cell_is_variant) {
+ if (! original_cell_variant.is_unity ()) {
+ std::set &tv = m_variants [*c];
+ tv.clear ();
+ tv.insert (original_cell_variant);
+ } else {
+ m_variants.erase (*c);
+ }
}
} else {
diff --git a/src/db/db/dbDeepShapeStore.cc b/src/db/db/dbDeepShapeStore.cc
index 02a33fcaa..db052be3b 100644
--- a/src/db/db/dbDeepShapeStore.cc
+++ b/src/db/db/dbDeepShapeStore.cc
@@ -298,28 +298,57 @@ struct DeepShapeStore::LayoutHolder
{
public:
VariantsCreatedListener (DeepShapeStore::LayoutHolder *lh, db::Layout *ly)
- : mp_lh (lh)
+ : mp_lh (lh), m_dbu (ly->dbu ())
{
ly->variants_created_event.add (this, &VariantsCreatedListener::variants_created);
}
private:
+ std::string var_desc (const db::ICplxTrans &t)
+ {
+ std::string s;
+ if (t.is_mirror ()) {
+ s += "m";
+ s += tl::to_string (t.angle () * 0.5);
+ } else {
+ s += "r";
+ s += tl::to_string (t.angle ());
+ }
+ if (t.is_mag ()) {
+ s += tl::sprintf ("*%.9g", t.mag ());
+ }
+ if (t.disp () != db::Vector ()) {
+ s += tl::sprintf ("(%.12g,%.12g)", t.disp ().x () * m_dbu, t.disp ().y () * m_dbu);
+ }
+ return s;
+ }
+
void variants_created (const std::map > *var_map)
{
for (std::map >::const_iterator i = var_map->begin (); i != var_map->end (); ++i) {
for (std::map::const_iterator j = i->second.begin (); j != i->second.end (); ++j) {
- mp_lh->builder.register_variant (i->first, j->second);
+ if (i->first != j->second) {
+ mp_lh->builder.register_variant (i->first, j->second, var_desc (j->first));
+ }
+ }
+ // NOTE: variant conversion events are registered after variant formation events, so we can
+ // base the formed variants (first pass) on the originals.
+ for (std::map::const_iterator j = i->second.begin (); j != i->second.end (); ++j) {
+ if (i->first == j->second) {
+ mp_lh->builder.register_variant (i->first, j->second, var_desc (j->first));
+ }
}
}
}
DeepShapeStore::LayoutHolder *mp_lh;
+ double m_dbu;
};
LayoutHolder (const db::ICplxTrans &trans)
: refs (0), layout (false), builder (&layout, trans), variants_created (this, &layout)
{
- // .. nothing yet ..
+ layout.set_hierarchy_builder (&builder);
}
void add_layer_ref (unsigned int layer)
diff --git a/src/db/db/dbHierarchyBuilder.cc b/src/db/db/dbHierarchyBuilder.cc
index bbfd1d68e..f8476730d 100644
--- a/src/db/db/dbHierarchyBuilder.cc
+++ b/src/db/db/dbHierarchyBuilder.cc
@@ -182,14 +182,24 @@ HierarchyBuilder::reset ()
m_cells_to_be_filled.clear ();
m_cell_map.clear ();
+ m_variants_of_sources_map.clear ();
m_cells_seen.clear ();
m_cell_stack.clear ();
m_cm_entry = null_iterator;
m_cm_new_entry = false;
}
+const std::pair &
+HierarchyBuilder::variant_of_source (db::cell_index_type target) const
+{
+ static std::pair def (std::numeric_limits::max (), std::string ());
+
+ auto vs = m_variants_of_sources_map.find (target);
+ return vs != m_variants_of_sources_map.end () ? vs->second : def;
+}
+
void
-HierarchyBuilder::register_variant (db::cell_index_type non_var, db::cell_index_type var)
+HierarchyBuilder::register_variant (db::cell_index_type non_var, db::cell_index_type var, const std::string &description)
{
// non_var (despite its name) may be a variant created previously.
variant_to_original_target_map_type::const_iterator v = m_variants_to_original_target_map.find (non_var);
@@ -199,11 +209,23 @@ HierarchyBuilder::register_variant (db::cell_index_type non_var, db::cell_index_
m_original_targets_to_variants_map [non_var].push_back (var);
m_variants_to_original_target_map.insert (std::make_pair (var, non_var));
+
+ auto vs = m_variants_of_sources_map.find (non_var);
+ if (vs != m_variants_of_sources_map.end ()) {
+ std::string new_description = vs->second.second;
+ if (! new_description.empty ()) {
+ new_description += ";";
+ }
+ new_description += description;
+ m_variants_of_sources_map [var] = std::make_pair (vs->second.first, new_description);
+ }
}
void
HierarchyBuilder::unregister_variant (db::cell_index_type var)
{
+ m_variants_of_sources_map.erase (var);
+
variant_to_original_target_map_type::iterator v = m_variants_to_original_target_map.find (var);
if (v == m_variants_to_original_target_map.end ()) {
return;
@@ -257,6 +279,7 @@ HierarchyBuilder::begin (const RecursiveShapeIterator *iter)
if (m_cm_entry == m_cell_map.end ()) {
db::cell_index_type new_top_index = mp_target->add_cell (iter->layout ()->cell_name (key.original_cell));
m_cm_entry = m_cell_map.insert (std::make_pair (key, new_top_index)).first;
+ m_variants_of_sources_map.insert (std::make_pair (new_top_index, std::make_pair (key.original_cell, std::string ())));
}
db::Cell &new_top = mp_target->cell (m_cm_entry->second);
@@ -324,17 +347,34 @@ HierarchyBuilder::make_cell_variant (const HierarchyBuilder::CellMapKey &key, co
if (m_cm_entry == m_cell_map.end ()) {
std::string cn = cell_name;
+ std::string description;
if (! key.clip_region.empty ()) {
cn += "$CLIP_VAR";
+ description += "CLIP";
+
}
if (key.inactive) {
cn += "$DIS";
+ if (! description.empty ()) {
+ description += "/";
+ }
+ description += "DISABLED";
}
+
new_cell = mp_target->add_cell (cn.c_str ());
+
+ std::string new_name = mp_target->cell_name (new_cell);
+ if (new_name.size () > cn.size ()) {
+ // use cell name extension to uniquify the description
+ description += new_name.c_str () + cn.size ();
+ }
+
m_cm_entry = m_cell_map.insert (std::make_pair (key, new_cell)).first;
m_cm_new_entry = true;
m_cells_to_be_filled.insert (new_cell);
+ m_variants_of_sources_map.insert (std::make_pair (new_cell, std::make_pair (key.original_cell, description)));
+
} else {
new_cell = m_cm_entry->second;
}
diff --git a/src/db/db/dbHierarchyBuilder.h b/src/db/db/dbHierarchyBuilder.h
index 70c76b2fe..4cd0caf65 100644
--- a/src/db/db/dbHierarchyBuilder.h
+++ b/src/db/db/dbHierarchyBuilder.h
@@ -389,7 +389,7 @@ public:
* The first cell is either the original, non-variant target cell or itself a variant.
* The second cell will be registered as a variant of the first one.
*/
- void register_variant (db::cell_index_type non_var, db::cell_index_type var);
+ void register_variant (db::cell_index_type non_var, db::cell_index_type var, const std::string &description);
/**
* @brief Unregisters a cell as a variant
@@ -404,8 +404,23 @@ public:
return m_variants_to_original_target_map.find (ci) != m_variants_to_original_target_map.end ();
}
+ /**
+ * @brief Gets the information about the target/source + variant relationship
+ *
+ * For a target cell, returns a pointer to a pair with the cell index of the source cell and
+ * a string describing the variant this cell forms of the source cell.
+ *
+ * The description string is empty if the cell is not a variant.
+ */
+ const std::pair &variant_of_source (db::cell_index_type target) const;
+
/**
* @brief Gets the original target for a variant cell
+ *
+ * The original cell is the first-generation target-space cell that variants have been created for.
+ * This still can mean that the original cell is a clip variant of a source cell.
+ *
+ * Target-to-source variants can be derived with "variant_of_source".
*/
db::cell_index_type original_target_for_variant (db::cell_index_type ci) const;
@@ -419,6 +434,7 @@ private:
cell_map_type m_cell_map;
original_target_to_variants_map_type m_original_targets_to_variants_map;
variant_to_original_target_map_type m_variants_to_original_target_map;
+ std::map > m_variants_of_sources_map;
std::set m_cells_seen;
std::set m_cells_to_be_filled;
diff --git a/src/db/db/dbLayout.cc b/src/db/db/dbLayout.cc
index 4e29d27ef..319f10bae 100644
--- a/src/db/db/dbLayout.cc
+++ b/src/db/db/dbLayout.cc
@@ -439,6 +439,7 @@ LayoutOrCellContextInfo::has_meta_info () const
Layout::Layout (db::Manager *manager)
: db::Object (manager),
mp_library (0),
+ mp_builder (0),
m_cells_size (0),
m_invalid (0),
m_top_cells (0),
@@ -454,6 +455,7 @@ Layout::Layout (db::Manager *manager)
Layout::Layout (bool editable, db::Manager *manager)
: db::Object (manager),
mp_library (0),
+ mp_builder (0),
m_cells_size (0),
m_invalid (0),
m_top_cells (0),
@@ -473,6 +475,7 @@ Layout::Layout (const db::Layout &layout)
tl::Object (),
tl::UniqueId (),
mp_library (0),
+ mp_builder (0),
m_cells_size (0),
m_invalid (0),
m_top_cells (0),
diff --git a/src/db/db/dbLayout.h b/src/db/db/dbLayout.h
index 59a4ad19f..4ab44a12e 100644
--- a/src/db/db/dbLayout.h
+++ b/src/db/db/dbLayout.h
@@ -72,6 +72,7 @@ class Technology;
class CellMapping;
class LayerMapping;
class VariantsCollectorBase;
+class HierarchyBuilder;
template class generic_repository;
typedef generic_repository GenericRepository;
@@ -2113,6 +2114,24 @@ public:
*/
const MetaInfo &meta_info (db::cell_index_type ci, meta_info_name_id_type name_id) const;
+ /**
+ * @brief Sets the hierarchy builder reference
+ * Used internally
+ */
+ void set_hierarchy_builder (db::HierarchyBuilder *builder)
+ {
+ mp_builder = builder;
+ }
+
+ /**
+ * @brief Gets the hierarchy builder
+ * Used internally
+ */
+ db::HierarchyBuilder *builder () const
+ {
+ return mp_builder;
+ }
+
/**
* @brief This event is triggered when the technology changes
*/
@@ -2138,6 +2157,7 @@ protected:
private:
db::Library *mp_library;
+ db::HierarchyBuilder *mp_builder;
cell_list m_cells;
size_t m_cells_size;
cell_ptr_vector m_cell_ptrs;
diff --git a/src/layui/layui/rdbMarkerBrowserPage.cc b/src/layui/layui/rdbMarkerBrowserPage.cc
index e6c87b117..380e327e7 100644
--- a/src/layui/layui/rdbMarkerBrowserPage.cc
+++ b/src/layui/layui/rdbMarkerBrowserPage.cc
@@ -287,7 +287,7 @@ SortByKeyCompareFunc::operator() (MarkerBrowserTreeViewModelCacheEntry *a, Marke
const rdb::Cell *ca = mp_rdb->cell_by_id (a->id ());
const rdb::Cell *cb = mp_rdb->cell_by_id (b->id ());
if (ca && cb) {
- return m_ascending ? ca->name () < cb->name () : cb->name () < ca->name ();
+ return m_ascending ? ca->qname () < cb->qname () : cb->qname () < ca->qname ();
}
const rdb::Category *xa = mp_rdb->category_by_id (a->id ());
@@ -582,7 +582,7 @@ public:
if (cell->name ().empty ()) {
return QObject::tr ("All Cells");
} else {
- return QVariant (QString::fromUtf8 ("[") + tl::to_qstring (cell->name ()) + QString::fromUtf8 ("]"));
+ return QVariant (QString::fromUtf8 ("[") + tl::to_qstring (cell->qname ()) + QString::fromUtf8 ("]"));
}
}
diff --git a/src/rdb/rdb/rdbUtils.cc b/src/rdb/rdb/rdbUtils.cc
index 766d43183..6b17dd753 100644
--- a/src/rdb/rdb/rdbUtils.cc
+++ b/src/rdb/rdb/rdbUtils.cc
@@ -174,10 +174,28 @@ public:
const rdb::Cell *cell_for_id (const db::Layout *layout, db::cell_index_type ci)
{
tl_assert (layout != 0);
+
std::string cn = layout->cell_name (ci);
- const rdb::Cell *rdb_cell = mp_rdb->cell_by_qname (cn);
+ std::string layout_cn = cn;
+ std::string qname = cn;
+ std::string var;
+
+ // resolve references to original cells in deep mode and determine variant
+ if (layout->builder ()) {
+ const db::Layout *source = layout->builder ()->source ().layout ();
+ if (source) {
+ const std::pair &vs = layout->builder ()->variant_of_source (ci);
+ if (! vs.second.empty () && source->is_valid_cell_index (vs.first)) {
+ var = vs.second;
+ cn = source->cell_name (vs.first);
+ qname = cn + ":" + var;
+ }
+ }
+ }
+
+ const rdb::Cell *rdb_cell = mp_rdb->cell_by_qname (qname);
if (! rdb_cell) {
- return mp_rdb->create_cell (cn);
+ return mp_rdb->create_cell (cn, var, layout_cn);
} else {
return rdb_cell;
}
From 1c367f3757d3e1452531b8bd0017073c22d61bfb Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 16:16:21 +0200
Subject: [PATCH 25/41] Updating test data
---
src/rdb/unit_tests/rdbRVEReaderTests.cc | 6 +++---
testdata/drc/drcSimpleTests_au14b.lyrdb | 6 ++++++
testdata/drc/drcSimpleTests_au14b_2.lyrdb | 3 +++
3 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/src/rdb/unit_tests/rdbRVEReaderTests.cc b/src/rdb/unit_tests/rdbRVEReaderTests.cc
index 4a22a8e2e..66368ae81 100644
--- a/src/rdb/unit_tests/rdbRVEReaderTests.cc
+++ b/src/rdb/unit_tests/rdbRVEReaderTests.cc
@@ -69,15 +69,15 @@ void run_rve_test (tl::TestBase *_this, const std::string &fn_rve, const std::st
TEST(1)
{
- run_rve_test (_this, "rve1.db", "rve1_au.txt");
+ run_rve_test (_this, "rve1.db", "rve1_au_2.txt");
}
TEST(2)
{
- run_rve_test (_this, "rve2.db", "rve2_au.txt");
+ run_rve_test (_this, "rve2.db", "rve2_au_2.txt");
}
TEST(3)
{
- run_rve_test (_this, "rve3.db", "rve3_au.txt");
+ run_rve_test (_this, "rve3.db", "rve3_au_2.txt");
}
diff --git a/testdata/drc/drcSimpleTests_au14b.lyrdb b/testdata/drc/drcSimpleTests_au14b.lyrdb
index 0b6c00a9d..e025e989e 100644
--- a/testdata/drc/drcSimpleTests_au14b.lyrdb
+++ b/testdata/drc/drcSimpleTests_au14b.lyrdb
@@ -24,6 +24,7 @@
TOP
+
|
@@ -35,6 +36,7 @@
TOP |
false
1
+
edge-pair: (-0.2,0.7;1,0.7)|(1,1.1;-0.2,1.1)
@@ -46,6 +48,7 @@
TOP |
false
1
+
edge-pair: (0,0;0,0.9)|(0.3,0.9;0.3,0)
@@ -57,6 +60,7 @@
TOP |
false
1
+
edge-pair: (0.3,0;0,0)|(0,0.9;0.3,0.9)
@@ -68,6 +72,7 @@
TOP |
false
1
+
edge-pair: (0.5,0;0.5,0.9)|(0.8,0.9;0.8,0)
@@ -79,6 +84,7 @@
TOP |
false
1
+
edge-pair: (0.8,0;0.5,0)|(0.5,0.9;0.8,0.9)
diff --git a/testdata/drc/drcSimpleTests_au14b_2.lyrdb b/testdata/drc/drcSimpleTests_au14b_2.lyrdb
index f3430532f..71743b100 100644
--- a/testdata/drc/drcSimpleTests_au14b_2.lyrdb
+++ b/testdata/drc/drcSimpleTests_au14b_2.lyrdb
@@ -18,6 +18,7 @@
TOP
+
|
@@ -29,6 +30,7 @@
TOP |
false
1
+
edge-pair: (0,0.9;0.3,0.9)/(1,1.1;-0.2,1.1)
@@ -40,6 +42,7 @@
TOP |
false
1
+
edge-pair: (0.5,0.9;0.8,0.9)/(1,1.1;-0.2,1.1)
From fbc336dde2a463da206561ca7be1f0f58f73c93e Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 17:37:58 +0200
Subject: [PATCH 26/41] Added tests
---
src/drc/unit_tests/drcSimpleTests.cc | 71 +++
testdata/drc/drcSimpleTests_110.drc | 16 +
testdata/drc/drcSimpleTests_110.gds | Bin 0 -> 472 bytes
testdata/drc/drcSimpleTests_111.drc | 14 +
testdata/drc/drcSimpleTests_111.gds | Bin 0 -> 472 bytes
testdata/drc/drcSimpleTests_au110.lyrdb | 585 ++++++++++++++++++++++++
testdata/drc/drcSimpleTests_au111.lyrdb | 382 ++++++++++++++++
7 files changed, 1068 insertions(+)
create mode 100644 testdata/drc/drcSimpleTests_110.drc
create mode 100644 testdata/drc/drcSimpleTests_110.gds
create mode 100644 testdata/drc/drcSimpleTests_111.drc
create mode 100644 testdata/drc/drcSimpleTests_111.gds
create mode 100644 testdata/drc/drcSimpleTests_au110.lyrdb
create mode 100644 testdata/drc/drcSimpleTests_au111.lyrdb
diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc
index 1c8180a8d..e08cd0a2c 100644
--- a/src/drc/unit_tests/drcSimpleTests.cc
+++ b/src/drc/unit_tests/drcSimpleTests.cc
@@ -1702,3 +1702,74 @@ TEST(102d_edge_modes)
{
run_test (_this, "102", true);
}
+
+TEST(110_RDBVariantAssignment)
+{
+ std::string rs = tl::testdata ();
+ rs += "/drc/drcSimpleTests_110.drc";
+
+ // apart from that it's a variant of 14b ...
+
+ std::string input = tl::testdata ();
+ input += "/drc/drcSimpleTests_110.gds";
+
+ std::string au_report = tl::testdata ();
+ au_report += "/drc/drcSimpleTests_au110.lyrdb";
+
+ std::string report = this->tmp_file ("tmp.lydrc");
+
+ {
+ // Set some variables
+ lym::Macro config;
+ config.set_text (tl::sprintf (
+ "$drc_force_gc = true\n"
+ "$drc_test_source = '%s'\n"
+ "$drc_test_report = '%s'\n"
+ , input, report)
+ );
+ config.set_interpreter (lym::Macro::Ruby);
+ EXPECT_EQ (config.run (), 0);
+ }
+
+ lym::Macro drc;
+ drc.load_from (rs);
+ EXPECT_EQ (drc.run (), 0);
+
+ compare_text_files (report, au_report);
+}
+
+TEST(111_RDBCategoryHierarchy)
+{
+ std::string rs = tl::testdata ();
+ rs += "/drc/drcSimpleTests_111.drc";
+
+ // apart from that it's a variant of 14b ...
+
+ std::string input = tl::testdata ();
+ input += "/drc/drcSimpleTests_111.gds";
+
+ std::string au_report = tl::testdata ();
+ au_report += "/drc/drcSimpleTests_au111.lyrdb";
+
+ std::string report = this->tmp_file ("tmp.lydrc");
+
+ {
+ // Set some variables
+ lym::Macro config;
+ config.set_text (tl::sprintf (
+ "$drc_force_gc = true\n"
+ "$drc_test_source = '%s'\n"
+ "$drc_test_report = '%s'\n"
+ , input, report)
+ );
+ config.set_interpreter (lym::Macro::Ruby);
+ EXPECT_EQ (config.run (), 0);
+ }
+
+ lym::Macro drc;
+ drc.load_from (rs);
+ EXPECT_EQ (drc.run (), 0);
+
+ compare_text_files (report, au_report);
+}
+
diff --git a/testdata/drc/drcSimpleTests_110.drc b/testdata/drc/drcSimpleTests_110.drc
new file mode 100644
index 000000000..f087e932e
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_110.drc
@@ -0,0 +1,16 @@
+
+source($drc_test_source)
+report("Report comment with\nanother line", $drc_test_report)
+
+deep
+
+l1 = input(1, 0)
+l1 = l1.sized(0.1, 0.0)
+
+l1.output("l1", "L1 (1/0 sized by x=100nm,y=0)")
+l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input")
+
+l1s = l1.snapped(200.nm)
+l1s.output("l1_snapped", "L1 snapped to 200nm")
+l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
+
diff --git a/testdata/drc/drcSimpleTests_110.gds b/testdata/drc/drcSimpleTests_110.gds
new file mode 100644
index 0000000000000000000000000000000000000000..131ac19daee529fd226dc3d77eec1571b8db524f
GIT binary patch
literal 472
zcmZQzV_;&6V31*CVt>KF!XU%I4}_Y?Yz7V{HXlzX1_lvkRy)T|bMIrzKUli#&|fe+
zDuh9X6}LV%Ha15F1{Mwm1~y(M21W)pJ|+eR1|0!rAc+Ln9Dtk?Kt)g*Ns2`fsGpqy
zuPq#GY$5&uKy_R|BZNRU@_=k$`~no(zyLOZ8z#dh#RxQ=M~2l|-~q%M4q=eX7#Uu#b7f~O$V9`HyzD?HXxJuZZI(L+b}TjdI0GKKz<1WgWwNf5CR=4tOCSu7#IXH
sAmRdN;OfCPp_vB`FOC@u4BR^y7(g_i00RTp2Lufh2hyKF!XU%I4}_Y?Yz7V{HXlzX1_lvkRy)T|bMIrzKUli#&|fe+
zDuh9X6}LV%Ha15F1{Mwm1~y(M21W)pJ|+eR1|0!rAc+Ln9Dtk?Kt)g*Ns2`fsGpqy
zuPq#GY$5&uKy_R|BZNRU@_=k$`~no(zyLOZ8z#dh#RxQ=M~2l|-~q%M4q=eX7#Uu#b7f~O$V9`HyzD?HXxJuZZI(L+b}TjdI0GKKz<1WgWwNf5CR=4tOCSu7#IXH
sAmRdN;OfCPp_vB`FOC@u4BR^y7(g_i00RTp2Lufh2hy
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+
+
+ l1
+ L1 (1/0 sized by x=100nm,y=0)
+
+
+
+
+ w1um
+ w < 1µm
+From sized input
+
+
+
+
+ l1_snapped
+ L1 snapped to 200nm
+
+
+
+
+ w1um_snapped
+ w < 1µm
+From snapped input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+ A
+ r0;r0(-0.1,0)
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r0;r0
+ A$VAR1$1
+
+ [
+ TOP
+ r0 *1 1.2,1.2
+ ]
+
+ |
+
+
+ -
+
+ l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ l1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ l1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
+
+
+ -
+
+ l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
+
+
+ -
+
+ l1_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ l1_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
+
+
+ -
+
+ l1_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
+
+
+
+
diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb b/testdata/drc/drcSimpleTests_au111.lyrdb
new file mode 100644
index 000000000..63a47e6f0
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_au111.lyrdb
@@ -0,0 +1,382 @@
+
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+
+
+ input
+
+
+
+ L1
+ Original layer
+
+
+
+
+ L1S
+ Sized original layer
+
+
+
+
+
+
+ w1um
+ w < 1µm
+From sized input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+
+ -
+
+ input.L1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.8,3.9;3.4,4;3.7,4.6;5.2,4.9;5.1,4.2;3.7,4.3)
+
+
+ -
+
+ input.L1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;2.8,3.6;2.8,3)
+
+
+ -
+
+ input.L1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
+
+
+ -
+
+ input.L1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
+
+
+ -
+
+ input.L1S
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ input.L1S
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ input.L1S
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ input.L1S
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+
+
From 4f96914b3c1aedc32fe517b35673d39579824afd Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 17:52:51 +0200
Subject: [PATCH 27/41] Also copy comments on RDB#apply
---
src/rdb/rdb/rdb.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc
index df19f88dc..7771727b3 100644
--- a/src/rdb/rdb/rdb.cc
+++ b/src/rdb/rdb/rdb.cc
@@ -1876,6 +1876,7 @@ Database::apply (const rdb::Database &other)
// actually transfer the attributes here
+ i->set_comment (other->comment ());
// TODO: this has some optimization potential in terms of performance ...
i->set_image_str (other->image_str ());
i->set_tag_str (other->tag_str ());
From daa406d5189884a7f08f82927d9916b73c9a2d4c Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 17:53:10 +0200
Subject: [PATCH 28/41] Auto-apply *.w files on RDB output in DRC
---
src/drc/drc/built-in-macros/_drc_engine.rb | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb
index 157154698..df4592a7e 100644
--- a/src/drc/drc/built-in-macros/_drc_engine.rb
+++ b/src/drc/drc/built-in-macros/_drc_engine.rb
@@ -115,11 +115,29 @@ module DRC
end
def write
+
if @file_name
+
rdb_file = @engine._make_path(@file_name)
+
+ # Apply waive DB if possible
+ wdb_file = rdb_file + ".w"
+ if File.exists?(wdb_file)
+ begin
+ wdb = RBA::ReportDatabase::new
+ wdb.load(wdb_file)
+ @engine.info("Applying waive database: #{wdb_file} ..")
+ @rdb.apply(wdb)
+ wdb._destroy
+ rescue
+ end
+ end
+
@engine.info("Writing report database: #{rdb_file} ..")
@rdb.save(rdb_file)
+
end
+
end
def rdb
From 9619081f8471ec9a9cb1e7cf57e3ace8e479e02f Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 18:50:33 +0200
Subject: [PATCH 29/41] Use fuzzy compare for RDB#apply
---
src/rdb/rdb/rdb.cc | 62 +++++++++++++++++++++++++++++++++++++++++++---
src/rdb/rdb/rdb.h | 5 +---
2 files changed, 60 insertions(+), 7 deletions(-)
diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc
index 7771727b3..b3ea21a41 100644
--- a/src/rdb/rdb/rdb.cc
+++ b/src/rdb/rdb/rdb.cc
@@ -174,6 +174,62 @@ template <> RDB_PUBLIC std::string Value::to_display_string () const
return to_string ();
}
+// compare implementations
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value < other->m_value - db::epsilon;
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value < other->m_value;
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value < other->m_value;
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
+template <> RDB_PUBLIC bool Value::compare (const ValueBase *o) const
+{
+ const Value *other = static_cast *> (o);
+ return m_value.less (other->m_value);
+}
+
// is_shape implementations
template <> RDB_PUBLIC bool Value::is_shape () const
@@ -881,14 +937,14 @@ Tags::tag (const std::string &name, bool user_tag)
const Tag &
Tags::tag (id_type id) const
{
- tl_assert (id - 1 < m_tags.size () && id > 0);
+ tl_assert (id < m_tags.size () + 1 && id > 0);
return m_tags [id - 1];
}
Tag &
Tags::tag (id_type id)
{
- tl_assert (id - 1 < m_tags.size () && id > 0);
+ tl_assert (id < m_tags.size () + 1 && id > 0);
return m_tags [id - 1];
}
@@ -1830,7 +1886,7 @@ Database::apply (const rdb::Database &other)
}
for (auto c = other.categories ().begin (); c != other.categories ().end (); ++c) {
- const rdb::Category *this_cat = category_by_name (c->name ());
+ const rdb::Category *this_cat = category_by_name (c->path ());
if (this_cat) {
cat2cat.insert (std::make_pair (this_cat->id (), c->id ()));
}
diff --git a/src/rdb/rdb/rdb.h b/src/rdb/rdb/rdb.h
index a2d0f0b5a..d8f6c3d18 100644
--- a/src/rdb/rdb/rdb.h
+++ b/src/rdb/rdb/rdb.h
@@ -506,10 +506,7 @@ public:
return type_index_of ();
}
- bool compare (const ValueBase *other) const
- {
- return m_value < static_cast *> (other)->m_value;
- }
+ bool compare (const ValueBase *other) const;
bool is_shape () const;
From 9fcd9d76161df9d900a65be5cf27aa6ed8c8aff5 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 18:50:53 +0200
Subject: [PATCH 30/41] RDB browser: mark waived items as unvisited initially
---
src/layui/layui/rdbMarkerBrowserPage.cc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/layui/layui/rdbMarkerBrowserPage.cc b/src/layui/layui/rdbMarkerBrowserPage.cc
index 380e327e7..173f20739 100644
--- a/src/layui/layui/rdbMarkerBrowserPage.cc
+++ b/src/layui/layui/rdbMarkerBrowserPage.cc
@@ -367,6 +367,7 @@ public:
{
mp_database = db;
m_waived_tag_id = mp_database ? mp_database->tags ().tag ("waived").id () : 0;
+
invalidate ();
}
@@ -1888,6 +1889,16 @@ MarkerBrowserPage::set_rdb (rdb::Database *database)
rerun_button->setToolTip (QString ());
}
+ // mark items visited that carry the waived flag
+ if (mp_database) {
+ id_type waived_tag_id = mp_database->tags ().tag ("waived").id ();
+ for (auto i = mp_database->items ().begin (); i != mp_database->items ().end (); ++i) {
+ if (i->has_tag (waived_tag_id)) {
+ mp_database->set_item_visited (i.operator-> (), true);
+ }
+ }
+ }
+
QAbstractItemModel *tree_model = directory_tree->model ();
MarkerBrowserTreeViewModel *new_model = new MarkerBrowserTreeViewModel ();
From 86a2a6dd40e1d2b2b7e5b628c0b95ff5ef08e384 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 19:05:39 +0200
Subject: [PATCH 31/41] 'Save As Waiver DB' implemented
---
src/layui/layui/MarkerBrowserDialog.ui | 8 ++++++++
src/layui/layui/rdbMarkerBrowserDialog.cc | 25 +++++++++++++++++++++++
src/layui/layui/rdbMarkerBrowserDialog.h | 1 +
src/rdb/rdb/rdb.h | 7 +++++++
src/rdb/rdb/rdbFile.cc | 16 +++++++++++----
5 files changed, 53 insertions(+), 4 deletions(-)
diff --git a/src/layui/layui/MarkerBrowserDialog.ui b/src/layui/layui/MarkerBrowserDialog.ui
index 65a398b74..298ac92a3 100644
--- a/src/layui/layui/MarkerBrowserDialog.ui
+++ b/src/layui/layui/MarkerBrowserDialog.ui
@@ -368,6 +368,14 @@ to load a marker database
QAction::NoRole
+
+
+ Save As Waiver DB
+
+
+ QAction::NoRole
+
+
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.cc b/src/layui/layui/rdbMarkerBrowserDialog.cc
index 6f7fb1f14..e388ef7da 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.cc
+++ b/src/layui/layui/rdbMarkerBrowserDialog.cc
@@ -88,6 +88,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
connect (mp_ui->open_action, SIGNAL (triggered ()), this, SLOT (open_clicked ()));
connect (mp_ui->save_action, SIGNAL (triggered ()), this, SLOT (save_clicked ()));
connect (mp_ui->saveas_action, SIGNAL (triggered ()), this, SLOT (saveas_clicked ()));
+ connect (mp_ui->saveas_waiver_db_action, SIGNAL (triggered ()), this, SLOT (saveas_waiver_db_clicked ()));
connect (mp_ui->export_action, SIGNAL (triggered ()), this, SLOT (export_clicked ()));
connect (mp_ui->reload_action, SIGNAL (triggered ()), this, SLOT (reload_clicked ()));
connect (mp_ui->info_action, SIGNAL (triggered ()), this, SLOT (info_clicked ()));
@@ -97,6 +98,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
mp_ui->file_menu->addAction (mp_ui->open_action);
mp_ui->file_menu->addAction (mp_ui->save_action);
mp_ui->file_menu->addAction (mp_ui->saveas_action);
+ mp_ui->file_menu->addAction (mp_ui->saveas_waiver_db_action);
QAction *sep0 = new QAction (mp_ui->file_menu);
sep0->setSeparator (true);
mp_ui->file_menu->addAction (mp_ui->export_action);
@@ -393,6 +395,28 @@ BEGIN_PROTECTED
END_PROTECTED
}
+void
+MarkerBrowserDialog::saveas_waiver_db_clicked ()
+{
+BEGIN_PROTECTED
+
+ rdb::Database *rdb = 0;
+ if (m_rdb_index < int (view ()->num_rdbs ()) && m_rdb_index >= 0) {
+ rdb = view ()->get_rdb (m_rdb_index);
+ }
+ if (! rdb) {
+ return;
+ }
+
+ if (rdb->filename ().empty ()) {
+ throw tl::Exception (tl::to_string (tr ("The current report database is not saved.\nSave it to some file with 'Save As', before saving it as waiver DB.")));
+ }
+
+ rdb->write (rdb->filename () + ".w");
+
+END_PROTECTED
+}
+
void
MarkerBrowserDialog::saveas_clicked ()
{
@@ -760,6 +784,7 @@ MarkerBrowserDialog::update_content ()
mp_ui->save_action->setEnabled (rdb != 0);
mp_ui->saveas_action->setEnabled (rdb != 0);
+ mp_ui->saveas_waiver_db_action->setEnabled (rdb != 0);
mp_ui->export_action->setEnabled (rdb != 0);
mp_ui->unload_action->setEnabled (rdb != 0);
mp_ui->unload_all_action->setEnabled (rdb != 0);
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.h b/src/layui/layui/rdbMarkerBrowserDialog.h
index 3d651b3fb..a7844414e 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.h
+++ b/src/layui/layui/rdbMarkerBrowserDialog.h
@@ -77,6 +77,7 @@ public slots:
void info_clicked ();
void save_clicked ();
void saveas_clicked ();
+ void saveas_waiver_db_clicked ();
void export_clicked ();
void reload_clicked ();
void open_clicked ();
diff --git a/src/rdb/rdb/rdb.h b/src/rdb/rdb/rdb.h
index d8f6c3d18..d368b5332 100644
--- a/src/rdb/rdb/rdb.h
+++ b/src/rdb/rdb/rdb.h
@@ -2444,6 +2444,13 @@ public:
*/
void save (const std::string &filename);
+ /**
+ * @brief Write the database to a file
+ *
+ * This function is like "save", but does not update the file name attribute.
+ */
+ void write (const std::string &filename);
+
/**
* @brief Load the database from a file
*
diff --git a/src/rdb/rdb/rdbFile.cc b/src/rdb/rdb/rdbFile.cc
index d7575e839..e6159b6a4 100644
--- a/src/rdb/rdb/rdbFile.cc
+++ b/src/rdb/rdb/rdbFile.cc
@@ -118,17 +118,25 @@ make_rdb_structure (rdb::Database *rdb)
}
// -------------------------------------------------------------
-// Implementation of rdb::Database::save
+// Implementation of rdb::Database::save and write
// TODO: move this somewhere else - with generalized functionality
void
rdb::Database::save (const std::string &fn)
{
- tl::OutputStream os (fn, tl::OutputStream::OM_Auto);
- make_rdb_structure (this).write (os, *this);
+ write (fn);
set_filename (fn);
+}
- tl::log << "Saved RDB to " << fn;
+void
+rdb::Database::write (const std::string &fn)
+{
+ tl::OutputStream os (fn, tl::OutputStream::OM_Auto);
+ make_rdb_structure (this).write (os, *this);
+
+ if (tl::verbosity () >= 10) {
+ tl::log << "Saved RDB to " << fn;
+ }
}
// -------------------------------------------------------------
From 7e323442870e34a8023b8977dc8cf7de86fa9ca5 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 19:23:44 +0200
Subject: [PATCH 32/41] Including sub-categories in RDB::apply, fixing handling
of waived count in a category hierarchy in marker browser
---
src/layui/layui/rdbMarkerBrowserPage.cc | 22 ++++++++++++++++++++--
src/rdb/rdb/rdb.cc | 17 +++++++++++++----
2 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/src/layui/layui/rdbMarkerBrowserPage.cc b/src/layui/layui/rdbMarkerBrowserPage.cc
index 173f20739..7d9625053 100644
--- a/src/layui/layui/rdbMarkerBrowserPage.cc
+++ b/src/layui/layui/rdbMarkerBrowserPage.cc
@@ -806,25 +806,43 @@ private:
size_t num_waived_per_cat (id_type cat_id) const
{
- auto ii = mp_database->items_by_category (cat_id);
size_t n = 0;
+
+ auto ii = mp_database->items_by_category (cat_id);
for (auto i = ii.first; i != ii.second; ++i) {
if ((*i)->has_tag (m_waived_tag_id)) {
++n;
}
}
+
+ // include sub-categories
+ const rdb::Category *cat = mp_database->category_by_id (cat_id);
+ tl_assert (cat != 0);
+ for (auto c = cat->sub_categories ().begin (); c != cat->sub_categories ().end (); ++c) {
+ n += num_waived_per_cat (c->id ());
+ }
+
return n;
}
size_t num_waived_per_cell_and_cat (id_type cell_id, id_type cat_id) const
{
- auto ii = mp_database->items_by_cell_and_category (cell_id, cat_id);
size_t n = 0;
+
+ auto ii = mp_database->items_by_cell_and_category (cell_id, cat_id);
for (auto i = ii.first; i != ii.second; ++i) {
if ((*i)->has_tag (m_waived_tag_id)) {
++n;
}
}
+
+ // include sub-categories
+ const rdb::Category *cat = mp_database->category_by_id (cat_id);
+ tl_assert (cat != 0);
+ for (auto c = cat->sub_categories ().begin (); c != cat->sub_categories ().end (); ++c) {
+ n += num_waived_per_cell_and_cat (cell_id, c->id ());
+ }
+
return n;
}
diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc
index b3ea21a41..b1e41866c 100644
--- a/src/rdb/rdb/rdb.cc
+++ b/src/rdb/rdb/rdb.cc
@@ -1868,6 +1868,18 @@ namespace
};
}
+static void map_category (const rdb::Category &cat, const rdb::Database &db, std::map &cat2cat)
+{
+ const rdb::Category *this_cat = db.category_by_name (cat.path ());
+ if (this_cat) {
+ cat2cat.insert (std::make_pair (this_cat->id (), cat.id ()));
+ }
+
+ for (auto c = cat.sub_categories ().begin (); c != cat.sub_categories ().end (); ++c) {
+ map_category (*c, db, cat2cat);
+ }
+}
+
void
Database::apply (const rdb::Database &other)
{
@@ -1886,10 +1898,7 @@ Database::apply (const rdb::Database &other)
}
for (auto c = other.categories ().begin (); c != other.categories ().end (); ++c) {
- const rdb::Category *this_cat = category_by_name (c->path ());
- if (this_cat) {
- cat2cat.insert (std::make_pair (this_cat->id (), c->id ()));
- }
+ map_category (*c, *this, cat2cat);
}
std::map tags_by_name;
From 92a0c38d96ab98d4962fc138e6c91252a0554670 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 19:32:54 +0200
Subject: [PATCH 33/41] Tests for waiving flow
---
src/drc/unit_tests/drcSimpleTests.cc | 44 ++
testdata/drc/drcSimpleTests_112.drc | 16 +
testdata/drc/drcSimpleTests_112.gds | Bin 0 -> 472 bytes
testdata/drc/drcSimpleTests_au112.lyrdb | 596 +++++++++++++++++++++
testdata/drc/drcSimpleTests_au112.lyrdb.w | 616 ++++++++++++++++++++++
5 files changed, 1272 insertions(+)
create mode 100644 testdata/drc/drcSimpleTests_112.drc
create mode 100644 testdata/drc/drcSimpleTests_112.gds
create mode 100644 testdata/drc/drcSimpleTests_au112.lyrdb
create mode 100644 testdata/drc/drcSimpleTests_au112.lyrdb.w
diff --git a/src/drc/unit_tests/drcSimpleTests.cc b/src/drc/unit_tests/drcSimpleTests.cc
index e08cd0a2c..db764bd02 100644
--- a/src/drc/unit_tests/drcSimpleTests.cc
+++ b/src/drc/unit_tests/drcSimpleTests.cc
@@ -25,6 +25,7 @@
#include "dbTestSupport.h"
#include "dbNetlist.h"
#include "dbNetlistSpiceReader.h"
+#include "rdb.h"
#include "lymMacro.h"
#include "tlFileUtils.h"
@@ -1773,3 +1774,46 @@ TEST(111_RDBCategoryHierarchy)
compare_text_files (report, au_report);
}
+TEST(112_Waiving)
+{
+ std::string rs = tl::testdata ();
+ rs += "/drc/drcSimpleTests_112.drc";
+
+ // apart from that it's a variant of 14b ...
+
+ std::string input = tl::testdata ();
+ input += "/drc/drcSimpleTests_112.gds";
+
+ std::string au_report = tl::testdata ();
+ au_report += "/drc/drcSimpleTests_au112.lyrdb";
+
+ std::string report = this->tmp_file ("tmp.lydrc");
+
+ {
+ // Set some variables
+ lym::Macro config;
+ config.set_text (tl::sprintf (
+ "$drc_force_gc = true\n"
+ "$drc_test_source = '%s'\n"
+ "$drc_test_report = '%s'\n"
+ , input, report)
+ );
+ config.set_interpreter (lym::Macro::Ruby);
+ EXPECT_EQ (config.run (), 0);
+ }
+
+ // prepare a waiver db
+ {
+ std::string report_w = this->tmp_file ("tmp.lydrc.w");
+ rdb::Database rdb_w;
+ rdb_w.load (au_report + ".w");
+ rdb_w.write (report_w);
+ }
+
+ lym::Macro drc;
+ drc.load_from (rs);
+ EXPECT_EQ (drc.run (), 0);
+
+ compare_text_files (report, au_report);
+}
+
diff --git a/testdata/drc/drcSimpleTests_112.drc b/testdata/drc/drcSimpleTests_112.drc
new file mode 100644
index 000000000..7c21b7f48
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_112.drc
@@ -0,0 +1,16 @@
+
+source($drc_test_source)
+report("Report comment with\nanother line", $drc_test_report)
+
+deep
+
+l1 = input(1, 0)
+l1 = l1.sized(0.1, 0.0)
+
+l1.output(["inputs", "l1"], "L1 (1/0 sized by x=100nm,y=0)")
+l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nAnother line")
+
+l1s = l1.snapped(200.nm)
+l1s.output([ "inputs", "l1_snapped" ], "L1 snapped to 200nm")
+l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
+
diff --git a/testdata/drc/drcSimpleTests_112.gds b/testdata/drc/drcSimpleTests_112.gds
new file mode 100644
index 0000000000000000000000000000000000000000..131ac19daee529fd226dc3d77eec1571b8db524f
GIT binary patch
literal 472
zcmZQzV_;&6V31*CVt>KF!XU%I4}_Y?Yz7V{HXlzX1_lvkRy)T|bMIrzKUli#&|fe+
zDuh9X6}LV%Ha15F1{Mwm1~y(M21W)pJ|+eR1|0!rAc+Ln9Dtk?Kt)g*Ns2`fsGpqy
zuPq#GY$5&uKy_R|BZNRU@_=k$`~no(zyLOZ8z#dh#RxQ=M~2l|-~q%M4q=eX7#Uu#b7f~O$V9`HyzD?HXxJuZZI(L+b}TjdI0GKKz<1WgWwNf5CR=4tOCSu7#IXH
sAmRdN;OfCPp_vB`FOC@u4BR^y7(g_i00RTp2Lufh2hy
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+ waived
+
+
+
+
+
+ inputs
+
+
+
+ l1
+ L1 (1/0 sized by x=100nm,y=0)
+
+
+
+
+ l1_snapped
+ L1 snapped to 200nm
+
+
+
+
+
+
+ w1um
+ w < 1µm
+Another line
+
+
+
+
+ w1um_snapped
+ w < 1µm
+From snapped input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+ A
+ r0;r0(-0.1,0)
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r0;r0
+ A$VAR1$1
+
+ [
+ TOP
+ r0 *1 1.2,1.2
+ ]
+
+ |
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ inputs.l1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+ First item von w1um
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
+
+
+ -
+ waived
+ inputs.l1_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+ A comment on the only waived input shape
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0 |
+ false
+ 1
+ A comment
+With two lines
+
+
+ edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
+
+
+
+
diff --git a/testdata/drc/drcSimpleTests_au112.lyrdb.w b/testdata/drc/drcSimpleTests_au112.lyrdb.w
new file mode 100644
index 000000000..c4b5fd756
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_au112.lyrdb.w
@@ -0,0 +1,616 @@
+
+
+ waiving
+another line
+ /home/matthias/klayout/testdata/waiving.gds
+ drc: script='/home/matthias/.klayout/drc/waiving.lydrc'
+ TOP
+
+
+ waived
+
+
+
+ red
+
+
+
+ green
+
+
+
+ blue
+
+
+
+ yellow
+
+
+
+ important
+
+
+
+
+
+ inputs
+
+
+
+ l1
+ L1 (1/0 sized by x=100nm,y=0)
+
+
+
+
+ l1_snapped
+ L1 snapped to 200nm
+
+
+
+
+
+
+ w1um
+ w < 1µm
+Another line
+
+
+
+
+ w1um_snapped
+ w < 1µm
+From snapped input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+ A
+ r0;r0(-0.1,0)
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r0;r0
+ A$VAR1$1
+
+ [
+ TOP
+ r0 *1 1.2,1.2
+ ]
+
+ |
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ inputs.l1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+ First item von w1um
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| A:r0 |
+ true
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um
+
| A:r90 |
+ true
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
+
+
+ -
+ waived
+ inputs.l1_snapped
+
| A:r0;r0(-0.1,0) |
+ true
+ 1
+ A comment on the only waived input shape
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ true
+ 1
+
+
+
+ edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um_snapped
+
| A:r90 |
+ true
+ 1
+
+
+
+ edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0 |
+ false
+ 1
+ A comment
+With two lines
+
+
+ edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
+
+
+
+
From 405ac5109a5ce95a2ec553c1727b3958da5a6a69 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 19:57:10 +0200
Subject: [PATCH 34/41] Update DRC documentation, explaining the waive flow.
---
src/doc/doc/manual/drc_basic.xml | 43 ++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/src/doc/doc/manual/drc_basic.xml b/src/doc/doc/manual/drc_basic.xml
index 4fe88fc7a..a5f0cc756 100644
--- a/src/doc/doc/manual/drc_basic.xml
+++ b/src/doc/doc/manual/drc_basic.xml
@@ -234,6 +234,49 @@ gate.width(min_width).output("gate_width", "Gate width violations")
Hence such files can only be run from the macro IDE.
+ DRC waiving flow
+
+
+ DRC waiving is a process of signing off DRC violations that cannot be avoided.
+ Usually DRC waiving is not encouraged, as manufacturability of the device cannot
+ be guaranteed if DRC violations are present. Even worse, giving a non-clean layout
+ into manufacturing may create a contamination risk that manufacturers will try
+ to avoid. Hence, non-DRC-clean layouts are usually rejected.
+
+
+
+ Still there are some legit reasons for DRC waiving. Sometimes DRC rules do not apply
+ because a specific technology option is not used by the device and corresponding
+ DRC rules do not apply. Or, a certain DRC rule may be a recommended rule, and violating
+ it is not forbidden. In that case, a DRC violation can be waived at your own risk.
+ Waiving is not a formal process. Usually, the manufacturer will ask for a confirmation
+ if DRC violations are present. KLayout can help documenting violations and copying
+ the waivers from one DRC run to the next.
+
+
+
+ The DRC waiving flow of KLayout is the following:
+
+
+
+ - In the initial step, a RDB database is created by the DRC run, using the "report" command with a destination file.
+ - This report is inspected in the marker browser. You can add comments, set flags and add screenshots. This is
+ also the time to waive DRC violations that you deem necessary to be waived. The marker browser has a "waive"
+ button which sets or resets the waived flag of the selected markers.
+ - When finished, save the edited database to a 'waiver DB' using the marker browser's 'Save As Waiver DB' feature from
+ the File menu. Technically, this will write the report database to a second file. This second file is named
+ like the original one, with a ".w" added to the file name.
+ - When you run the DRC again, KLayout will find this waiver DB file and apply attributes from the waiver DB
+ to the current report database. These attributes include the flags, images and comments.
+ This will - among the other annotations - apply the waived flag to the report database items.
+
+
+
+ In the waiving step, KLayout will apply attributes to items with the same value (i.e. shape), category and cell.
+ This specifically means, that when you rename a cell, waivers will no longer be applied, or - in the worst case -
+ be applied to the wrong cell. Hence, waiving should be done late in the process, when cell names are unlikely to change.
+
+
Using KLayout as a standalone DRC engine
From bc2028cedb544fc62041897083a43a3e4f097bc3 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Sun, 28 Apr 2024 22:59:21 +0200
Subject: [PATCH 35/41] Providing test data variants
---
...110.lyrdb => drcSimpleTests_au110.lyrdb.1} | 0
testdata/drc/drcSimpleTests_au110.lyrdb.2 | 585 +++++++++++++++++
...111.lyrdb => drcSimpleTests_au111.lyrdb.1} | 0
testdata/drc/drcSimpleTests_au111.lyrdb.2 | 382 +++++++++++
...112.lyrdb => drcSimpleTests_au112.lyrdb.1} | 0
testdata/drc/drcSimpleTests_au112.lyrdb.2 | 596 ++++++++++++++++++
6 files changed, 1563 insertions(+)
rename testdata/drc/{drcSimpleTests_au110.lyrdb => drcSimpleTests_au110.lyrdb.1} (100%)
create mode 100644 testdata/drc/drcSimpleTests_au110.lyrdb.2
rename testdata/drc/{drcSimpleTests_au111.lyrdb => drcSimpleTests_au111.lyrdb.1} (100%)
create mode 100644 testdata/drc/drcSimpleTests_au111.lyrdb.2
rename testdata/drc/{drcSimpleTests_au112.lyrdb => drcSimpleTests_au112.lyrdb.1} (100%)
create mode 100644 testdata/drc/drcSimpleTests_au112.lyrdb.2
diff --git a/testdata/drc/drcSimpleTests_au110.lyrdb b/testdata/drc/drcSimpleTests_au110.lyrdb.1
similarity index 100%
rename from testdata/drc/drcSimpleTests_au110.lyrdb
rename to testdata/drc/drcSimpleTests_au110.lyrdb.1
diff --git a/testdata/drc/drcSimpleTests_au110.lyrdb.2 b/testdata/drc/drcSimpleTests_au110.lyrdb.2
new file mode 100644
index 000000000..439de7517
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_au110.lyrdb.2
@@ -0,0 +1,585 @@
+
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+
+
+ l1
+ L1 (1/0 sized by x=100nm,y=0)
+
+
+
+
+ w1um
+ w < 1µm
+From sized input
+
+
+
+
+ l1_snapped
+ L1 snapped to 200nm
+
+
+
+
+ w1um_snapped
+ w < 1µm
+From snapped input
+
+
+
+
+
+ |
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+ A
+ r0;r0(-0.1,0)
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r0;r0
+ A$VAR1$1
+
+ [
+ TOP
+ r0 *1 1.2,1.2
+ ]
+
+ |
+
+
+ -
+
+ l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ l1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ l1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
+
+
+ -
+
+ l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
+
+
+ -
+
+ l1_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ l1_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
+
+
+ -
+
+ l1_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
+
+
+
+
diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb b/testdata/drc/drcSimpleTests_au111.lyrdb.1
similarity index 100%
rename from testdata/drc/drcSimpleTests_au111.lyrdb
rename to testdata/drc/drcSimpleTests_au111.lyrdb.1
diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb.2 b/testdata/drc/drcSimpleTests_au111.lyrdb.2
new file mode 100644
index 000000000..20d7799e5
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_au111.lyrdb.2
@@ -0,0 +1,382 @@
+
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+
+
+ input
+
+
+
+ L1
+ Original layer
+
+
+
+
+ L1S
+ Sized original layer
+
+
+
+
+
+
+ w1um
+ w < 1µm
+From sized input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+
+ -
+
+ input.L1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.8,3.9;3.4,4;3.7,4.6;5.2,4.9;5.1,4.2;3.7,4.3)
+
+
+ -
+
+ input.L1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;2.8,3.6;2.8,3)
+
+
+ -
+
+ input.L1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
+
+
+ -
+
+ input.L1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
+
+
+ -
+
+ input.L1S
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ input.L1S
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ input.L1S
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ input.L1S
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+
+
diff --git a/testdata/drc/drcSimpleTests_au112.lyrdb b/testdata/drc/drcSimpleTests_au112.lyrdb.1
similarity index 100%
rename from testdata/drc/drcSimpleTests_au112.lyrdb
rename to testdata/drc/drcSimpleTests_au112.lyrdb.1
diff --git a/testdata/drc/drcSimpleTests_au112.lyrdb.2 b/testdata/drc/drcSimpleTests_au112.lyrdb.2
new file mode 100644
index 000000000..5c9191829
--- /dev/null
+++ b/testdata/drc/drcSimpleTests_au112.lyrdb.2
@@ -0,0 +1,596 @@
+
+
+ Report comment with
+another line
+
+ drc: script='.drc'
+ TOP
+
+
+ waived
+
+
+
+
+
+ inputs
+
+
+
+ l1
+ L1 (1/0 sized by x=100nm,y=0)
+
+
+
+
+ l1_snapped
+ L1 snapped to 200nm
+
+
+
+
+
+
+ w1um
+ w < 1µm
+Another line
+
+
+
+
+ w1um_snapped
+ w < 1µm
+From snapped input
+
+
+
+
+
+
+ TOP
+
+
+
+
+ |
+
+ A
+ r0
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r90
+ A$VAR1
+
+ [
+ TOP
+ r270 *1 2,2
+ ]
+
+ |
+
+ A
+ r0;r0(-0.1,0)
+ A
+
+ [
+ TOP
+ r0 *1 0.5,1.2
+ ]
+
+ |
+
+ A
+ r0;r0
+ A$VAR1$1
+
+ [
+ TOP
+ r0 *1 1.2,1.2
+ ]
+
+ |
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
+
+
+ -
+
+ inputs.l1
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
+
+
+ -
+
+ inputs.l1
+
| A:r0 |
+ false
+ 1
+
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+ First item von w1um
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
+ -
+ waived
+ w1um
+
| A:r0 |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
+
+
+ -
+
+ inputs.l1_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
+
+
+ -
+ waived
+ inputs.l1_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+ A comment on the only waived input shape
+
+
+ polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
+
+
+ -
+
+ inputs.l1_snapped
+
| A:r0;r0 |
+ false
+ 1
+
+
+
+ polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0(-0.1,0) |
+ false
+ 1
+
+
+
+ edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
+
+
+ -
+ waived
+ w1um_snapped
+
| A:r90 |
+ false
+ 1
+
+
+
+ edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
+
+
+ -
+
+ w1um_snapped
+
| A:r0;r0 |
+ false
+ 1
+ A comment
+With two lines
+
+
+ edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
+
+
+
+
From a7f0f3ba8e2e0a93b52a80414ef449eccbb2bc66 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 00:10:57 +0200
Subject: [PATCH 36/41] Compatibility with old Ruby versions
---
src/drc/drc/built-in-macros/_drc_engine.rb | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/drc/drc/built-in-macros/_drc_engine.rb b/src/drc/drc/built-in-macros/_drc_engine.rb
index df4592a7e..5f17a8c8f 100644
--- a/src/drc/drc/built-in-macros/_drc_engine.rb
+++ b/src/drc/drc/built-in-macros/_drc_engine.rb
@@ -3253,9 +3253,19 @@ CODE
categories.each do |c|
ccat = nil
if cat
- ccat = cat.each_sub_category.find { |i| i.name == c }
+ cat.each_sub_category do |i|
+ if i.name == c
+ ccat = i
+ break
+ end
+ end
else
- ccat = output_rdb.each_category.find { |i| i.name == c }
+ output_rdb.each_category do |i|
+ if i.name == c
+ ccat = i
+ break
+ end
+ end
end
cat = ccat ? ccat : output_rdb.create_category(cat, c)
end
From 4a2143d234d4ab1ed1978ce9bc16450e5ae73f1d Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 00:46:58 +0200
Subject: [PATCH 37/41] Using plain DRC functions for better test
reproducibility
---
testdata/drc/drcSimpleTests_110.drc | 4 +-
testdata/drc/drcSimpleTests_111.drc | 2 +-
testdata/drc/drcSimpleTests_112.drc | 4 +-
...110.lyrdb.1 => drcSimpleTests_au110.lyrdb} | 412 ++++++------
testdata/drc/drcSimpleTests_au110.lyrdb.2 | 585 -----------------
...111.lyrdb.1 => drcSimpleTests_au111.lyrdb} | 242 +++----
testdata/drc/drcSimpleTests_au111.lyrdb.2 | 382 -----------
...112.lyrdb.1 => drcSimpleTests_au112.lyrdb} | 412 ++++++------
testdata/drc/drcSimpleTests_au112.lyrdb.2 | 596 ------------------
9 files changed, 538 insertions(+), 2101 deletions(-)
rename testdata/drc/{drcSimpleTests_au110.lyrdb.1 => drcSimpleTests_au110.lyrdb} (100%)
delete mode 100644 testdata/drc/drcSimpleTests_au110.lyrdb.2
rename testdata/drc/{drcSimpleTests_au111.lyrdb.1 => drcSimpleTests_au111.lyrdb} (100%)
delete mode 100644 testdata/drc/drcSimpleTests_au111.lyrdb.2
rename testdata/drc/{drcSimpleTests_au112.lyrdb.1 => drcSimpleTests_au112.lyrdb} (100%)
delete mode 100644 testdata/drc/drcSimpleTests_au112.lyrdb.2
diff --git a/testdata/drc/drcSimpleTests_110.drc b/testdata/drc/drcSimpleTests_110.drc
index f087e932e..6fb126755 100644
--- a/testdata/drc/drcSimpleTests_110.drc
+++ b/testdata/drc/drcSimpleTests_110.drc
@@ -8,9 +8,9 @@ l1 = input(1, 0)
l1 = l1.sized(0.1, 0.0)
l1.output("l1", "L1 (1/0 sized by x=100nm,y=0)")
-l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input")
+l1.width(1.0.um).output("w1um", "w < 1µm\nFrom sized input")
l1s = l1.snapped(200.nm)
l1s.output("l1_snapped", "L1 snapped to 200nm")
-l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
+l1s.width(1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
diff --git a/testdata/drc/drcSimpleTests_111.drc b/testdata/drc/drcSimpleTests_111.drc
index 8ba7378dd..763b98b93 100644
--- a/testdata/drc/drcSimpleTests_111.drc
+++ b/testdata/drc/drcSimpleTests_111.drc
@@ -10,5 +10,5 @@ l1s = l1.sized(0.1, 0.0)
l1.output([ "input", "L1" ], "Original layer")
l1s.output([ "input", "L1S" ], "Sized original layer")
-l1s.drc(width < 1.0.um).output("w1um", "w < 1µm\nFrom sized input")
+l1s.width(1.0.um).output("w1um", "w < 1µm\nFrom sized input")
diff --git a/testdata/drc/drcSimpleTests_112.drc b/testdata/drc/drcSimpleTests_112.drc
index 7c21b7f48..fe79de298 100644
--- a/testdata/drc/drcSimpleTests_112.drc
+++ b/testdata/drc/drcSimpleTests_112.drc
@@ -8,9 +8,9 @@ l1 = input(1, 0)
l1 = l1.sized(0.1, 0.0)
l1.output(["inputs", "l1"], "L1 (1/0 sized by x=100nm,y=0)")
-l1.drc(width < 1.0.um).output("w1um", "w < 1µm\nAnother line")
+l1.width(1.0.um).output("w1um", "w < 1µm\nAnother line")
l1s = l1.snapped(200.nm)
l1s.output([ "inputs", "l1_snapped" ], "L1 snapped to 200nm")
-l1s.drc(width < 1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
+l1s.width(1.0.um).output("w1um_snapped", "w < 1µm\nFrom snapped input")
diff --git a/testdata/drc/drcSimpleTests_au110.lyrdb.1 b/testdata/drc/drcSimpleTests_au110.lyrdb
similarity index 100%
rename from testdata/drc/drcSimpleTests_au110.lyrdb.1
rename to testdata/drc/drcSimpleTests_au110.lyrdb
index 793d828a3..77ef871b3 100644
--- a/testdata/drc/drcSimpleTests_au110.lyrdb.1
+++ b/testdata/drc/drcSimpleTests_au110.lyrdb
@@ -137,78 +137,6 @@ From snapped input
polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
-
w1um
@@ -221,18 +149,6 @@ From snapped input
edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
-
w1um
@@ -245,42 +161,6 @@ From snapped input
edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
-
w1um
@@ -302,7 +182,31 @@ From snapped input
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
@@ -317,6 +221,18 @@ From snapped input
edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
-
w1um
@@ -329,6 +245,90 @@ From snapped input
edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
-
w1um
@@ -413,6 +413,90 @@ From snapped input
polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
-
w1um_snapped
@@ -446,79 +530,7 @@ From snapped input
- edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
@@ -533,18 +545,6 @@ From snapped input
edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
-
-
w1um_snapped
diff --git a/testdata/drc/drcSimpleTests_au110.lyrdb.2 b/testdata/drc/drcSimpleTests_au110.lyrdb.2
deleted file mode 100644
index 439de7517..000000000
--- a/testdata/drc/drcSimpleTests_au110.lyrdb.2
+++ /dev/null
@@ -1,585 +0,0 @@
-
-
- Report comment with
-another line
-
- drc: script='.drc'
- TOP
-
-
-
-
- l1
- L1 (1/0 sized by x=100nm,y=0)
-
-
-
-
- w1um
- w < 1µm
-From sized input
-
-
-
-
- l1_snapped
- L1 snapped to 200nm
-
-
-
-
- w1um_snapped
- w < 1µm
-From snapped input
-
-
-
-
-
-
|
- TOP
-
-
-
-
- |
-
- A
- r0
- A
-
- [
- TOP
- r0 *1 0.5,1.2
- ]
-
- |
-
- A
- r90
- A$VAR1
-
- [
- TOP
- r270 *1 2,2
- ]
-
- |
-
- A
- r0;r0(-0.1,0)
- A
-
- [
- TOP
- r0 *1 0.5,1.2
- ]
-
- |
-
- A
- r0;r0
- A$VAR1$1
-
- [
- TOP
- r0 *1 1.2,1.2
- ]
-
- |
-
-
- -
-
- l1
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
-
-
- -
-
- l1
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
-
-
- -
-
- l1
-
| A:r0 |
- false
- 1
-
-
-
- polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
-
-
- -
-
- l1
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
-
- w1um
-
| A:r0 |
- false
- 1
-
-
-
- edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
-
-
- -
-
- w1um
-
| A:r90 |
- false
- 1
-
-
-
- edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
-
-
- -
-
- l1_snapped
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
-
-
- -
-
- l1_snapped
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
-
-
- -
-
- l1_snapped
-
| A:r0;r0(-0.1,0) |
- false
- 1
-
-
-
- polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
-
-
- -
-
- l1_snapped
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
-
-
- -
-
- l1_snapped
-
| A:r0;r0 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
-
- -
-
- w1um_snapped
-
| A:r0;r0(-0.1,0) |
- false
- 1
-
-
-
- edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
-
-
- -
-
- w1um_snapped
-
| A:r90 |
- false
- 1
-
-
-
- edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
-
-
- -
-
- w1um_snapped
-
| A:r0;r0 |
- false
- 1
-
-
-
- edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
-
-
-
-
diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb.1 b/testdata/drc/drcSimpleTests_au111.lyrdb
similarity index 100%
rename from testdata/drc/drcSimpleTests_au111.lyrdb.1
rename to testdata/drc/drcSimpleTests_au111.lyrdb
index 63a47e6f0..37d05841c 100644
--- a/testdata/drc/drcSimpleTests_au111.lyrdb.1
+++ b/testdata/drc/drcSimpleTests_au111.lyrdb
@@ -162,78 +162,6 @@ From sized input
polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
-
w1um
@@ -246,18 +174,6 @@ From sized input
edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
-
w1um
@@ -270,42 +186,6 @@ From sized input
edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
-
w1um
@@ -327,7 +207,31 @@ From sized input
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
@@ -342,6 +246,18 @@ From sized input
edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
-
w1um
@@ -354,6 +270,90 @@ From sized input
edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
-
w1um
diff --git a/testdata/drc/drcSimpleTests_au111.lyrdb.2 b/testdata/drc/drcSimpleTests_au111.lyrdb.2
deleted file mode 100644
index 20d7799e5..000000000
--- a/testdata/drc/drcSimpleTests_au111.lyrdb.2
+++ /dev/null
@@ -1,382 +0,0 @@
-
-
- Report comment with
-another line
-
- drc: script='.drc'
- TOP
-
-
-
-
- input
-
-
-
- L1
- Original layer
-
-
-
-
- L1S
- Sized original layer
-
-
-
-
-
-
- w1um
- w < 1µm
-From sized input
-
-
-
-
-
-
|
- TOP
-
-
-
-
- |
-
- A
- r0
- A
-
- [
- TOP
- r0 *1 0.5,1.2
- ]
-
- |
-
- A
- r90
- A$VAR1
-
- [
- TOP
- r270 *1 2,2
- ]
-
- |
-
-
- -
-
- input.L1
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.8,3.9;3.4,4;3.7,4.6;5.2,4.9;5.1,4.2;3.7,4.3)
-
-
- -
-
- input.L1
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.2,3;2.2,3.6;2.8,3.6;2.8,3)
-
-
- -
-
- input.L1
-
| A:r0 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
-
-
- -
-
- input.L1
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.6;0.2,1.6;0.2,0)
-
-
- -
-
- input.L1S
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
-
-
- -
-
- input.L1S
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
-
-
- -
-
- input.L1S
-
| A:r0 |
- false
- 1
-
-
-
- polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
-
-
- -
-
- input.L1S
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
-
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
-
- w1um
-
| A:r0 |
- false
- 1
-
-
-
- edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
-
-
- -
-
- w1um
-
| A:r90 |
- false
- 1
-
-
-
- edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
-
-
-
-
diff --git a/testdata/drc/drcSimpleTests_au112.lyrdb.1 b/testdata/drc/drcSimpleTests_au112.lyrdb
similarity index 100%
rename from testdata/drc/drcSimpleTests_au112.lyrdb.1
rename to testdata/drc/drcSimpleTests_au112.lyrdb
index 5a2297a78..33b59bf2b 100644
--- a/testdata/drc/drcSimpleTests_au112.lyrdb.1
+++ b/testdata/drc/drcSimpleTests_au112.lyrdb
@@ -147,78 +147,6 @@ From snapped input
polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
- -
- waived
- w1um
-
| TOP |
- false
- 1
- First item von w1um
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
-
waived
w1um
@@ -231,18 +159,6 @@ From snapped input
edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
-
waived
w1um
@@ -255,42 +171,6 @@ From snapped input
edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
-
waived
w1um
@@ -312,7 +192,31 @@ From snapped input
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+ edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
@@ -327,6 +231,18 @@ From snapped input
edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
+
+
-
waived
w1um
@@ -339,6 +255,90 @@ From snapped input
edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+ First item von w1um
+
+
+ edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
+
+
+ -
+ waived
+ w1um
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
+
+
-
waived
w1um
@@ -423,6 +423,90 @@ From snapped input
polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
+ -
+ waived
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
+
+
+ -
+
+ w1um_snapped
+
| TOP |
+ false
+ 1
+
+
+
+ edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
+
+
-
w1um_snapped
@@ -456,79 +540,7 @@ From snapped input
- edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
-
-
- -
- waived
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
+ edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
@@ -543,18 +555,6 @@ From snapped input
edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
-
-
w1um_snapped
diff --git a/testdata/drc/drcSimpleTests_au112.lyrdb.2 b/testdata/drc/drcSimpleTests_au112.lyrdb.2
deleted file mode 100644
index 5c9191829..000000000
--- a/testdata/drc/drcSimpleTests_au112.lyrdb.2
+++ /dev/null
@@ -1,596 +0,0 @@
-
-
- Report comment with
-another line
-
- drc: script='.drc'
- TOP
-
-
- waived
-
-
-
-
-
- inputs
-
-
-
- l1
- L1 (1/0 sized by x=100nm,y=0)
-
-
-
-
- l1_snapped
- L1 snapped to 200nm
-
-
-
-
-
-
- w1um
- w < 1µm
-Another line
-
-
-
-
- w1um_snapped
- w < 1µm
-From snapped input
-
-
-
-
-
-
|
- TOP
-
-
-
-
- |
-
- A
- r0
- A
-
- [
- TOP
- r0 *1 0.5,1.2
- ]
-
- |
-
- A
- r90
- A$VAR1
-
- [
- TOP
- r270 *1 2,2
- ]
-
- |
-
- A
- r0;r0(-0.1,0)
- A
-
- [
- TOP
- r0 *1 0.5,1.2
- ]
-
- |
-
- A
- r0;r0
- A$VAR1$1
-
- [
- TOP
- r0 *1 1.2,1.2
- ]
-
- |
-
-
- -
-
- inputs.l1
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.7,3.9;3.3,4;3.6,4.6;5.1,4.9;5.3,4.9;5.2,4.2;5,4.2;3.804,4.285;3.9,3.9)
-
-
- -
-
- inputs.l1
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.1,3;2.1,3.6;2.9,3.6;2.9,3)
-
-
- -
-
- inputs.l1
-
| A:r0 |
- false
- 1
-
-
-
- polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
-
-
- -
-
- inputs.l1
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,-0.1;0,1.7;0.2,1.7;0.2,-0.1)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.804,4.285;3.9,3.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(4.138,4.708;5.1,4.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.3,4;3.6,4.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.3,4;3.6,4.6)|(3.804,4.285;3.9,3.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.6,4.6;4.256,4.731)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.53,4.233;3.804,4.285)|(3.455,4.31;3.6,4.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.266,4.733;5.1,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;3.804,4.285)|(3.6,4.6;5.1,4.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.3,4;3.6,4.6)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.9,3.9;3.7,3.9)|(3.6,4.6;4.408,4.762)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
- First item von w1um
-
-
- edge-pair: (5.1,4.9;5.3,4.9)|(5.3,4.9;5.2,4.2)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.7,3.9;3.3,4)|(3.804,4.285;3.9,3.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5,4.2;4.343,4.247)|(5.1,4.9;5.3,4.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;5,4.2)|(5.1,4.9;5.3,4.9)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.1,3;2.1,3.6)|(2.9,3.6;2.9,3)
-
-
- -
- waived
- w1um
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.9,3;2.1,3)|(2.1,3.6;2.9,3.6)
-
-
- -
- waived
- w1um
-
| A:r0 |
- false
- 1
-
-
-
- edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
-
-
- -
- waived
- w1um
-
| A:r90 |
- false
- 1
-
-
-
- edge-pair: (0,-0.1;0,1.7)|(0.2,1.7;0.2,-0.1)
-
-
- -
-
- inputs.l1_snapped
-
| TOP |
- false
- 1
-
-
-
- polygon: (3.4,4;3.6,4.6;5.2,5;5.4,5;5.2,4.2;3.8,4.2;4,4)
-
-
- -
-
- inputs.l1_snapped
-
| TOP |
- false
- 1
-
-
-
- polygon: (2.2,3;2.2,3.6;3,3.6;3,3)
-
-
- -
- waived
- inputs.l1_snapped
-
| A:r0;r0(-0.1,0) |
- false
- 1
- A comment on the only waived input shape
-
-
- polygon: (-0.1,0;-0.1,1.6;0.3,1.6;0.3,0)
-
-
- -
-
- inputs.l1_snapped
-
| A:r90 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.8;0.2,1.8;0.2,0)
-
-
- -
-
- inputs.l1_snapped
-
| A:r0;r0 |
- false
- 1
-
-
-
- polygon: (0,0;0,1.6;0.4,1.6;0.4,0)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;4.6,4.2)|(5.2,5;5.4,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.8,4.2;4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,5;5.4,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4,4;3.4,4)|(3.6,4.6;4.547,4.837)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (5.2,4.2;3.8,4.2)|(3.6,4.6;5.2,5)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (4.314,4.778;5.2,5)|(5.4,5;5.2,4.2)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.6,4.6)|(4,4;3.4,4)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.4,4;3.55,4.45)|(3.8,4.2;4,4)
-
-
- -
- waived
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3.467,4.2;3.6,4.6)|(4.521,4.2;3.8,4.2)
-
-
- -
- waived
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (3,3;2.2,3)|(2.2,3.6;3,3.6)
-
-
- -
-
- w1um_snapped
-
| TOP |
- false
- 1
-
-
-
- edge-pair: (2.2,3;2.2,3.6)|(3,3.6;3,3)
-
-
- -
-
- w1um_snapped
-
| A:r0;r0(-0.1,0) |
- false
- 1
-
-
-
- edge-pair: (-0.1,0;-0.1,1.6)|(0.3,1.6;0.3,0)
-
-
- -
- waived
- w1um_snapped
-
| A:r90 |
- false
- 1
-
-
-
- edge-pair: (0,0;0,1.8)|(0.2,1.8;0.2,0)
-
-
- -
-
- w1um_snapped
-
| A:r0;r0 |
- false
- 1
- A comment
-With two lines
-
-
- edge-pair: (0,0;0,1.6)|(0.4,1.6;0.4,0)
-
-
-
-
From db0e9efe3107606dbcb3edfb3afc76a1b9a2c020 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 18:51:31 +0200
Subject: [PATCH 38/41] Bugfix: reload was not working properly
---
src/rdb/rdb/rdb.cc | 2 +-
src/rdb/rdb/rdb.h | 4 +++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/rdb/rdb/rdb.cc b/src/rdb/rdb/rdb.cc
index b1e41866c..64f8192f4 100644
--- a/src/rdb/rdb/rdb.cc
+++ b/src/rdb/rdb/rdb.cc
@@ -1762,7 +1762,7 @@ read_db_from_layout (rdb::Database *db, tl::InputStream &is)
}
void
-Database::load (const std::string &fn)
+Database::load (std::string fn)
{
tl::log << "Loading RDB from " << fn;
diff --git a/src/rdb/rdb/rdb.h b/src/rdb/rdb/rdb.h
index d368b5332..808af53ba 100644
--- a/src/rdb/rdb/rdb.h
+++ b/src/rdb/rdb/rdb.h
@@ -2455,8 +2455,10 @@ public:
* @brief Load the database from a file
*
* Note: This clears the existing database.
+ * The argument intentionally is a copy, so we can call
+ * "load (this->filename ())" for reloading.
*/
- void load (const std::string &filename);
+ void load (std::string filename);
/**
* @brief Applies the attributes from a different database
From 14f9d579c963fd50fb5f907c6d152852d80f39ea Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 18:56:32 +0200
Subject: [PATCH 39/41] 'apply waiver DB' feature in marker browser
---
src/layui/layui/MarkerBrowserDialog.ui | 8 ++++
src/layui/layui/rdbMarkerBrowserDialog.cc | 47 +++++++++++++++++++++++
src/layui/layui/rdbMarkerBrowserDialog.h | 1 +
3 files changed, 56 insertions(+)
diff --git a/src/layui/layui/MarkerBrowserDialog.ui b/src/layui/layui/MarkerBrowserDialog.ui
index 298ac92a3..dc2e8e58a 100644
--- a/src/layui/layui/MarkerBrowserDialog.ui
+++ b/src/layui/layui/MarkerBrowserDialog.ui
@@ -376,6 +376,14 @@ to load a marker database
QAction::NoRole
+
+
+ Apply Waiver DB
+
+
+ QAction::NoRole
+
+
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.cc b/src/layui/layui/rdbMarkerBrowserDialog.cc
index e388ef7da..9f4b3d410 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.cc
+++ b/src/layui/layui/rdbMarkerBrowserDialog.cc
@@ -37,6 +37,7 @@
#include "dbLayoutUtils.h"
#include "dbRecursiveShapeIterator.h"
#include "dbStream.h"
+#include "tlFileUtils.h"
#include "ui_MarkerBrowserDialog.h"
@@ -89,6 +90,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
connect (mp_ui->save_action, SIGNAL (triggered ()), this, SLOT (save_clicked ()));
connect (mp_ui->saveas_action, SIGNAL (triggered ()), this, SLOT (saveas_clicked ()));
connect (mp_ui->saveas_waiver_db_action, SIGNAL (triggered ()), this, SLOT (saveas_waiver_db_clicked ()));
+ connect (mp_ui->apply_waiver_db_action, SIGNAL (triggered ()), this, SLOT (apply_waiver_db_clicked ()));
connect (mp_ui->export_action, SIGNAL (triggered ()), this, SLOT (export_clicked ()));
connect (mp_ui->reload_action, SIGNAL (triggered ()), this, SLOT (reload_clicked ()));
connect (mp_ui->info_action, SIGNAL (triggered ()), this, SLOT (info_clicked ()));
@@ -99,6 +101,7 @@ MarkerBrowserDialog::MarkerBrowserDialog (lay::Dispatcher *root, lay::LayoutView
mp_ui->file_menu->addAction (mp_ui->save_action);
mp_ui->file_menu->addAction (mp_ui->saveas_action);
mp_ui->file_menu->addAction (mp_ui->saveas_waiver_db_action);
+ mp_ui->file_menu->addAction (mp_ui->apply_waiver_db_action);
QAction *sep0 = new QAction (mp_ui->file_menu);
sep0->setSeparator (true);
mp_ui->file_menu->addAction (mp_ui->export_action);
@@ -395,6 +398,49 @@ BEGIN_PROTECTED
END_PROTECTED
}
+void
+MarkerBrowserDialog::apply_waiver_db_clicked ()
+{
+BEGIN_PROTECTED
+
+ rdb::Database *rdb = 0;
+ if (m_rdb_index < int (view ()->num_rdbs ()) && m_rdb_index >= 0) {
+ rdb = view ()->get_rdb (m_rdb_index);
+ }
+ if (! rdb) {
+ return;
+ }
+
+ std::string wdb_filename;
+ if (! rdb->filename ().empty () && tl::file_exists (rdb->filename () + ".w")) {
+
+ wdb_filename = rdb->filename () + ".w";
+
+ } else {
+
+ // prepare and open the file dialog
+ lay::FileDialog open_dialog (this, tl::to_string (QObject::tr ("Apply Waiver DB File")), "Waiver DB files (*.w)");
+
+ if (! rdb->filename ().empty ()) {
+ wdb_filename = rdb->filename () + ".w";
+ }
+
+ if (! open_dialog.get_open (wdb_filename)) {
+ return;
+ }
+
+ }
+
+ rdb::Database wdb;
+ wdb.load (wdb_filename);
+
+ mp_ui->browser_frame->set_rdb (0);
+ rdb->apply (wdb);
+ mp_ui->browser_frame->set_rdb (rdb);
+
+END_PROTECTED
+}
+
void
MarkerBrowserDialog::saveas_waiver_db_clicked ()
{
@@ -785,6 +831,7 @@ MarkerBrowserDialog::update_content ()
mp_ui->save_action->setEnabled (rdb != 0);
mp_ui->saveas_action->setEnabled (rdb != 0);
mp_ui->saveas_waiver_db_action->setEnabled (rdb != 0);
+ mp_ui->apply_waiver_db_action->setEnabled (rdb != 0);
mp_ui->export_action->setEnabled (rdb != 0);
mp_ui->unload_action->setEnabled (rdb != 0);
mp_ui->unload_all_action->setEnabled (rdb != 0);
diff --git a/src/layui/layui/rdbMarkerBrowserDialog.h b/src/layui/layui/rdbMarkerBrowserDialog.h
index a7844414e..a833d993d 100644
--- a/src/layui/layui/rdbMarkerBrowserDialog.h
+++ b/src/layui/layui/rdbMarkerBrowserDialog.h
@@ -78,6 +78,7 @@ public slots:
void save_clicked ();
void saveas_clicked ();
void saveas_waiver_db_clicked ();
+ void apply_waiver_db_clicked ();
void export_clicked ();
void reload_clicked ();
void open_clicked ();
From de535c711fb126fcd76608470cce64943dc745c7 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 18:58:04 +0200
Subject: [PATCH 40/41] Fixed problem by creating a default device class from
an empty template string
---
src/db/db/dbLayoutToNetlistReader.cc | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/src/db/db/dbLayoutToNetlistReader.cc b/src/db/db/dbLayoutToNetlistReader.cc
index 1f310c806..127cbc4b7 100644
--- a/src/db/db/dbLayoutToNetlistReader.cc
+++ b/src/db/db/dbLayoutToNetlistReader.cc
@@ -395,12 +395,18 @@ void LayoutToNetlistStandardReader::read_netlist (db::Netlist *netlist, db::Layo
throw tl::Exception (tl::to_string (tr ("Duplicate definition of device class: ")) + class_name);
}
- db::DeviceClassTemplateBase *dct = db::DeviceClassTemplateBase::template_by_name (templ_name);
- if (! dct) {
- throw tl::Exception (tl::to_string (tr ("Invalid device class template: ")) + templ_name);
+ db::DeviceClass *dc;
+ if (templ_name.empty ()) {
+ // generic device class (issue #1696)
+ dc = new db::DeviceClass ();
+ } else {
+ db::DeviceClassTemplateBase *dct = db::DeviceClassTemplateBase::template_by_name (templ_name);
+ if (! dct) {
+ throw tl::Exception (tl::to_string (tr ("Invalid device class template: ")) + templ_name);
+ }
+ dc = dct->create ();
}
- db::DeviceClass *dc = dct->create ();
dc->set_name (class_name);
netlist->add_device_class (dc);
From a10356fd859aa994a7fd99a510951b5407b96435 Mon Sep 17 00:00:00 2001
From: Matthias Koefferlein
Date: Mon, 29 Apr 2024 19:18:39 +0200
Subject: [PATCH 41/41] Added tests
---
.../dbLayoutToNetlistReaderTests.cc | 24 +
testdata/algo/l2n_reader_7.l2n | 1100 ++++++++++++++++
testdata/algo/l2n_reader_au_7.l2n | 1126 +++++++++++++++++
3 files changed, 2250 insertions(+)
create mode 100644 testdata/algo/l2n_reader_7.l2n
create mode 100644 testdata/algo/l2n_reader_au_7.l2n
diff --git a/src/db/unit_tests/dbLayoutToNetlistReaderTests.cc b/src/db/unit_tests/dbLayoutToNetlistReaderTests.cc
index 4b04f724e..047f6a1f1 100644
--- a/src/db/unit_tests/dbLayoutToNetlistReaderTests.cc
+++ b/src/db/unit_tests/dbLayoutToNetlistReaderTests.cc
@@ -539,3 +539,27 @@ TEST(6_ReaderLog)
compare_text_files (path, au_path);
}
+// issue #1696
+TEST(7_CustomDevice)
+{
+ db::LayoutToNetlist l2n;
+
+ std::string in_path = tl::combine_path (tl::combine_path (tl::testdata (), "algo"), "l2n_reader_7.l2n");
+ tl::InputStream is_in (in_path);
+
+ db::LayoutToNetlistStandardReader reader (is_in);
+ reader.read (&l2n);
+
+ // verify against the input
+
+ std::string path = tmp_file ("tmp.txt");
+ {
+ tl::OutputStream stream (path);
+ db::LayoutToNetlistStandardWriter writer (stream, false);
+ writer.write (&l2n);
+ }
+
+ std::string au_path = tl::combine_path (tl::combine_path (tl::testdata (), "algo"), "l2n_reader_au_7.l2n");
+
+ compare_text_files (path, au_path);
+}
diff --git a/testdata/algo/l2n_reader_7.l2n b/testdata/algo/l2n_reader_7.l2n
new file mode 100644
index 000000000..0ceaa3d44
--- /dev/null
+++ b/testdata/algo/l2n_reader_7.l2n
@@ -0,0 +1,1100 @@
+#%l2n-klayout
+W(TOP)
+U(0.001)
+L(l3 '66/20')
+L(l11 '66/44')
+L(l12 '67/20')
+L(l13 '67/5')
+L(l14 '67/44')
+L(l15 '68/20')
+L(l16 '68/5')
+L(l4)
+L(l5)
+C(l3 l3 l11)
+C(l11 l3 l11 l12 l5)
+C(l12 l11 l12 l13 l14)
+C(l13 l12 l13)
+C(l14 l12 l14 l15)
+C(l15 l14 l15 l16)
+C(l16 l15 l16)
+C(l4 l4)
+C(l5 l11 l5)
+G(l4 SUBSTRATE)
+K(MOSCAPN ''
+ E(W 1 0)
+ E(L 1 0)
+ E(N 1 1)
+ T(G)
+ T(D)
+ T(B)
+)
+K(PMOS MOS4)
+K(NMOS MOS4)
+D(D$MOSCAPN MOSCAPN
+ T(G
+ R(l3 (-8600 -12000) (17200 24000))
+ )
+ T(D
+ R(l5 (-8600 -12000) (17200 24000))
+ )
+ T(B
+ R(l4 (-8600 -12000) (17200 24000))
+ )
+)
+D(D$MOSCAPN$1 MOSCAPN
+ T(G
+ R(l3 (-8600 -7000) (17200 14000))
+ )
+ T(D
+ R(l5 (-8600 -7000) (17200 14000))
+ )
+ T(B
+ R(l4 (-8600 -7000) (17200 14000))
+ )
+)
+D(D$NMOS NMOS
+ T(S
+ R(l5 (-490 -5000) (290 10000))
+ )
+ T(G
+ R(l3 (-200 -5000) (400 10000))
+ )
+ T(D
+ R(l5 (200 -5000) (290 10000))
+ )
+ T(B
+ R(l4 (-200 -5000) (400 10000))
+ )
+)
+D(D$NMOS$1 NMOS
+ T(S
+ R(l5 (-490 -5000) (290 10000))
+ )
+ T(G
+ R(l3 (-200 -5000) (400 10000))
+ )
+ T(D
+ R(l5 (200 -5000) (290 10000))
+ )
+ T(B
+ R(l4 (-200 -5000) (400 10000))
+ )
+)
+D(D$NMOS$2 NMOS
+ T(S
+ R(l5 (-490 -5000) (290 10000))
+ )
+ T(G
+ R(l3 (-200 -5000) (400 10000))
+ )
+ T(D
+ R(l5 (200 -5000) (290 10000))
+ )
+ T(B
+ R(l4 (-200 -5000) (400 10000))
+ )
+)
+X(TOP
+ R((-9185 0) (84745 24700))
+ N(1 I(C2)
+ R(l3 (39920 5050) (17200 14600))
+ R(l3 (490 -14600) (17200 14600))
+ R(l11 (-18390 -14550) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (33500 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l12 (-1290 -190) (700 210))
+ R(l12 (-17690 -210) (16990 210))
+ R(l12 (700 -210) (16990 210))
+ R(l14 (-17780 -190) (170 170))
+ R(l14 (190 -170) (170 170))
+ R(l14 (190 -170) (170 170))
+ R(l15 (-980 -270) (1080 370))
+ R(l16 (-540 -190) (0 0))
+ )
+ N(2 I(C1)
+ R(l3 (750 50) (17200 24600))
+ R(l3 (490 -24600) (17200 24600))
+ R(l11 (-18390 -24550) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (33500 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l11 (-510 -170) (170 170))
+ R(l12 (-1290 -190) (700 210))
+ R(l12 (-17690 -210) (16990 210))
+ R(l12 (700 -210) (16990 210))
+ R(l14 (-17780 -190) (170 170))
+ R(l14 (190 -170) (170 170))
+ R(l14 (190 -170) (170 170))
+ R(l15 (-980 -270) (1080 370))
+ R(l16 (-540 -190) (0 0))
+ )
+ N(3
+ R(l11 (-5830 13120) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -2210) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (1210 8330) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -2550) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (1210 9350) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -2550) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (77870 14780) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 170) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 12410) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 170) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-21650 5950) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2890) (170 170))
+ R(l11 (-170 2210) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 -4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -9010) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 9010) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -4250) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2890) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -8670) (170 170))
+ R(l11 (-170 7990) (170 170))
+ R(l11 (-170 14450) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 8670) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2210) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -3910) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 7990) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -9350) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (17520 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2890) (170 170))
+ R(l11 (-170 2210) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 -4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -9010) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 9010) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -4250) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5610) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2890) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -8670) (170 170))
+ R(l11 (-170 7990) (170 170))
+ R(l11 (-170 14450) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-17860 8670) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 2210) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 4250) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -3910) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 7990) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -9350) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -5270) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l12 (-6480 -9155) (290 10000))
+ R(l12 (1090 -10000) (290 10000))
+ R(l12 (1090 -10000) (290 10000))
+ R(l12 (77780 -7595) (230 13000))
+ R(l12 (-17860 -750) (17800 500))
+ R(l12 (-17860 -12750) (230 13000))
+ R(l12 (-170 -2750) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17860 -750) (230 13000))
+ R(l12 (-17860 -750) (17800 500))
+ R(l12 (-17860 -12750) (230 13000))
+ R(l12 (-170 -2750) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-21650 -5750) (230 23000))
+ R(l12 (-17860 -1750) (17800 500))
+ R(l12 (-17860 -21750) (230 23000))
+ R(l12 (-170 -3750) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17860 -1750) (230 23000))
+ R(l12 (-17860 -1750) (17800 500))
+ R(l12 (-17860 -21750) (230 23000))
+ R(l12 (-170 -3750) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l12 (-17800 -2500) (17800 500))
+ R(l14 (-21320 8810) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-1550 550) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-1550 550) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (6080 550) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (39000 550) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l14 (-170 -530) (170 170))
+ R(l15 (-45655 -235) (45720 1010))
+ R(l5 (-45715 -8190) (290 10000))
+ R(l5 (1090 -10000) (290 10000))
+ R(l5 (1090 -10000) (290 10000))
+ R(l5 (77650 -8095) (400 14000))
+ R(l5 (-18000 -14000) (400 14000))
+ R(l5 (-490 -14000) (400 14000))
+ R(l5 (-18000 -14000) (400 14000))
+ R(l5 (-4280 -19000) (400 24000))
+ R(l5 (-18000 -24000) (400 24000))
+ R(l5 (-490 -24000) (400 24000))
+ R(l5 (-18000 -24000) (400 24000))
+ )
+ N(4 I(VSS)
+ R(l11 (-5140 13120) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (1210 9350) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -2210) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -2210) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (1210 9350) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -850) (170 170))
+ R(l11 (-170 850) (170 170))
+ R(l11 (-170 -2210) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1870) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (-170 510) (170 170))
+ R(l11 (-170 -1190) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -2550) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -2550) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (-170 -1530) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l12 (-2990 -325) (290 10000))
+ R(l12 (1090 -10000) (290 10000))
+ R(l12 (1090 -10000) (290 10000))
+ R(l14 (-2990 -4735) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l14 (1210 -890) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l14 (1210 -890) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l14 (-170 190) (170 170))
+ R(l15 (-6975 -945) (7040 1010))
+ R(l16 (-5360 -520) (0 0))
+ R(l5 (2305 -5700) (290 10000))
+ R(l5 (1090 -10000) (290 10000))
+ R(l5 (1090 -10000) (290 10000))
+ )
+ N(5 I(DOWN)
+ R(l3 (-5600 3225) (400 90))
+ R(l3 (-400 -700) (400 610))
+ R(l3 (-400 90) (400 10260))
+ R(l3 (290 -10350) (400 90))
+ R(l3 (-400 0) (400 10260))
+ R(l3 (-400 -10960) (400 610))
+ R(l3 (290 0) (400 90))
+ R(l3 (-400 -700) (400 610))
+ R(l3 (-400 90) (400 10260))
+ R(l3 (290 -10260) (400 10260))
+ R(l3 (-400 -10350) (400 90))
+ R(l3 (-400 -700) (400 610))
+ R(l3 (290 -610) (400 610))
+ R(l3 (-400 0) (400 90))
+ R(l3 (-400 0) (400 10260))
+ R(l11 (-3045 -10910) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (520 -510) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (520 -510) (170 170))
+ R(l11 (-170 170) (170 170))
+ R(l11 (520 -170) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l11 (520 170) (170 170))
+ R(l11 (-170 -510) (170 170))
+ R(l12 (-3045 -220) (3160 610))
+ R(l13 (-1575 -310) (0 0))
+ )
+ N(6 I(SUBSTRATE))
+ P(1 I(C2))
+ P(2 I(C1))
+ P(4 I(VSS))
+ P(5 I(DOWN))
+ P(6 I(SUBSTRATE))
+ D(1 D$NMOS
+ D(D$NMOS$1 Y(690 0))
+ D(D$NMOS$1 Y(1380 0))
+ D(D$NMOS$1 Y(2070 0))
+ D(D$NMOS$2 Y(2760 0))
+ C(0 S S)
+ C(1 S D)
+ C(2 S S)
+ C(3 S D)
+ C(4 S S)
+ C(0 G G)
+ C(1 G G)
+ C(2 G G)
+ C(3 G G)
+ C(4 G G)
+ C(0 D D)
+ C(1 D S)
+ C(2 D D)
+ C(3 D S)
+ C(4 D D)
+ C(0 B B)
+ C(1 B B)
+ C(2 B B)
+ C(3 B B)
+ C(4 B B)
+ M Y(-5400 8445)
+ E(L 0.4)
+ E(W 50)
+ E(AS 8.7)
+ E(AD 8.7)
+ E(PS 61.74)
+ E(PD 61.74)
+ T(S 3)
+ T(G 5)
+ T(D 4)
+ T(B 6)
+ )
+ D(6 D$MOSCAPN$1
+ D(D$MOSCAPN$1 Y(-17690 0))
+ O(180) Y(48520 12350)
+ E(W 14)
+ E(L 17.2)
+ E(N 2)
+ T(G 1)
+ T(D 3)
+ T(B 6)
+ )
+ D(8 D$MOSCAPN
+ D(D$MOSCAPN Y(-17690 0))
+ O(180) Y(9350 12350)
+ E(W 24)
+ E(L 17.2)
+ E(N 2)
+ T(G 2)
+ T(D 3)
+ T(B 6)
+ )
+)
diff --git a/testdata/algo/l2n_reader_au_7.l2n b/testdata/algo/l2n_reader_au_7.l2n
new file mode 100644
index 000000000..e4a9f1a1b
--- /dev/null
+++ b/testdata/algo/l2n_reader_au_7.l2n
@@ -0,0 +1,1126 @@
+#%l2n-klayout
+top(TOP)
+unit(0.001)
+
+# Layer section
+# This section lists the mask layers (drawing or derived) and their connections.
+
+# Mask layers
+layer(l3 '66/20')
+layer(l11 '66/44')
+layer(l12 '67/20')
+layer(l13 '67/5')
+layer(l14 '67/44')
+layer(l15 '68/20')
+layer(l16 '68/5')
+layer(l4)
+layer(l5)
+
+# Mask layer connectivity
+connect(l3 l3 l11)
+connect(l11 l3 l11 l12 l5)
+connect(l12 l11 l12 l13 l14)
+connect(l13 l12 l13)
+connect(l14 l12 l14 l15)
+connect(l15 l14 l15 l16)
+connect(l16 l15 l16)
+connect(l4 l4)
+connect(l5 l11 l5)
+
+# Global nets and connectivity
+global(l4 SUBSTRATE)
+
+# Device class section
+class(MOSCAPN ''
+ param(W 1 0)
+ param(L 1 0)
+ param(N 1 1)
+ terminal(G)
+ terminal(D)
+ terminal(B)
+)
+class(PMOS MOS4)
+class(NMOS MOS4)
+
+# Device abstracts section
+# Device abstracts list the pin shapes of the devices.
+device(D$MOSCAPN MOSCAPN
+ terminal(G
+ rect(l3 (-8600 -12000) (17200 24000))
+ )
+ terminal(D
+ rect(l5 (-8600 -12000) (17200 24000))
+ )
+ terminal(B
+ rect(l4 (-8600 -12000) (17200 24000))
+ )
+)
+device(D$MOSCAPN$1 MOSCAPN
+ terminal(G
+ rect(l3 (-8600 -7000) (17200 14000))
+ )
+ terminal(D
+ rect(l5 (-8600 -7000) (17200 14000))
+ )
+ terminal(B
+ rect(l4 (-8600 -7000) (17200 14000))
+ )
+)
+device(D$NMOS NMOS
+ terminal(S
+ rect(l5 (-490 -5000) (290 10000))
+ )
+ terminal(G
+ rect(l3 (-200 -5000) (400 10000))
+ )
+ terminal(D
+ rect(l5 (200 -5000) (290 10000))
+ )
+ terminal(B
+ rect(l4 (-200 -5000) (400 10000))
+ )
+)
+device(D$NMOS$1 NMOS
+ terminal(S
+ rect(l5 (-490 -5000) (290 10000))
+ )
+ terminal(G
+ rect(l3 (-200 -5000) (400 10000))
+ )
+ terminal(D
+ rect(l5 (200 -5000) (290 10000))
+ )
+ terminal(B
+ rect(l4 (-200 -5000) (400 10000))
+ )
+)
+device(D$NMOS$2 NMOS
+ terminal(S
+ rect(l5 (-490 -5000) (290 10000))
+ )
+ terminal(G
+ rect(l3 (-200 -5000) (400 10000))
+ )
+ terminal(D
+ rect(l5 (200 -5000) (290 10000))
+ )
+ terminal(B
+ rect(l4 (-200 -5000) (400 10000))
+ )
+)
+
+# Circuit section
+# Circuits are the hierarchical building blocks of the netlist.
+circuit(TOP
+
+ # Circuit boundary
+ rect((-9185 0) (84745 24700))
+
+ # Nets with their geometries
+ net(1 name(C2)
+ rect(l3 (39920 5050) (17200 14600))
+ rect(l3 (490 -14600) (17200 14600))
+ rect(l11 (-18390 -14550) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (33500 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l12 (-1290 -190) (700 210))
+ rect(l12 (-17690 -210) (16990 210))
+ rect(l12 (700 -210) (16990 210))
+ rect(l14 (-17780 -190) (170 170))
+ rect(l14 (190 -170) (170 170))
+ rect(l14 (190 -170) (170 170))
+ rect(l15 (-980 -270) (1080 370))
+ rect(l16 (-540 -190) (0 0))
+ )
+ net(2 name(C1)
+ rect(l3 (750 50) (17200 24600))
+ rect(l3 (490 -24600) (17200 24600))
+ rect(l11 (-18390 -24550) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (33500 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l11 (-510 -170) (170 170))
+ rect(l12 (-1290 -190) (700 210))
+ rect(l12 (-17690 -210) (16990 210))
+ rect(l12 (700 -210) (16990 210))
+ rect(l14 (-17780 -190) (170 170))
+ rect(l14 (190 -170) (170 170))
+ rect(l14 (190 -170) (170 170))
+ rect(l15 (-980 -270) (1080 370))
+ rect(l16 (-540 -190) (0 0))
+ )
+ net(3
+ rect(l11 (-5830 13120) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -2210) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (1210 8330) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -2550) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (1210 9350) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -2550) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (77870 14780) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 170) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 12410) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 170) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-21650 5950) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2890) (170 170))
+ rect(l11 (-170 2210) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 -4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -9010) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 9010) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -4250) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2890) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -8670) (170 170))
+ rect(l11 (-170 7990) (170 170))
+ rect(l11 (-170 14450) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 8670) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2210) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -3910) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 7990) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -9350) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (17520 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2890) (170 170))
+ rect(l11 (-170 2210) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 -4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -9010) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 9010) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -4250) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5610) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2890) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -8670) (170 170))
+ rect(l11 (-170 7990) (170 170))
+ rect(l11 (-170 14450) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-17860 8670) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 2210) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 4250) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -3910) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 7990) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -9350) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -5270) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l12 (-6480 -9155) (290 10000))
+ rect(l12 (1090 -10000) (290 10000))
+ rect(l12 (1090 -10000) (290 10000))
+ rect(l12 (77780 -7595) (230 13000))
+ rect(l12 (-17860 -750) (17800 500))
+ rect(l12 (-17860 -12750) (230 13000))
+ rect(l12 (-170 -2750) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17860 -750) (230 13000))
+ rect(l12 (-17860 -750) (17800 500))
+ rect(l12 (-17860 -12750) (230 13000))
+ rect(l12 (-170 -2750) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-21650 -5750) (230 23000))
+ rect(l12 (-17860 -1750) (17800 500))
+ rect(l12 (-17860 -21750) (230 23000))
+ rect(l12 (-170 -3750) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17860 -1750) (230 23000))
+ rect(l12 (-17860 -1750) (17800 500))
+ rect(l12 (-17860 -21750) (230 23000))
+ rect(l12 (-170 -3750) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l12 (-17800 -2500) (17800 500))
+ rect(l14 (-21320 8810) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-1550 550) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-1550 550) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (6080 550) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (39000 550) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l14 (-170 -530) (170 170))
+ rect(l15 (-45655 -235) (45720 1010))
+ rect(l5 (-45715 -8190) (290 10000))
+ rect(l5 (1090 -10000) (290 10000))
+ rect(l5 (1090 -10000) (290 10000))
+ rect(l5 (77650 -8095) (400 14000))
+ rect(l5 (-18000 -14000) (400 14000))
+ rect(l5 (-490 -14000) (400 14000))
+ rect(l5 (-18000 -14000) (400 14000))
+ rect(l5 (-4280 -19000) (400 24000))
+ rect(l5 (-18000 -24000) (400 24000))
+ rect(l5 (-490 -24000) (400 24000))
+ rect(l5 (-18000 -24000) (400 24000))
+ )
+ net(4 name(VSS)
+ rect(l11 (-5140 13120) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (1210 9350) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -2210) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -2210) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (1210 9350) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -850) (170 170))
+ rect(l11 (-170 850) (170 170))
+ rect(l11 (-170 -2210) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1870) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (-170 510) (170 170))
+ rect(l11 (-170 -1190) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -2550) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -2550) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (-170 -1530) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l12 (-2990 -325) (290 10000))
+ rect(l12 (1090 -10000) (290 10000))
+ rect(l12 (1090 -10000) (290 10000))
+ rect(l14 (-2990 -4735) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l14 (1210 -890) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l14 (1210 -890) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l14 (-170 190) (170 170))
+ rect(l15 (-6975 -945) (7040 1010))
+ rect(l16 (-5360 -520) (0 0))
+ rect(l5 (2305 -5700) (290 10000))
+ rect(l5 (1090 -10000) (290 10000))
+ rect(l5 (1090 -10000) (290 10000))
+ )
+ net(5 name(DOWN)
+ rect(l3 (-5600 3225) (400 90))
+ rect(l3 (-400 -700) (400 610))
+ rect(l3 (-400 90) (400 10260))
+ rect(l3 (290 -10350) (400 90))
+ rect(l3 (-400 0) (400 10260))
+ rect(l3 (-400 -10960) (400 610))
+ rect(l3 (290 0) (400 90))
+ rect(l3 (-400 -700) (400 610))
+ rect(l3 (-400 90) (400 10260))
+ rect(l3 (290 -10260) (400 10260))
+ rect(l3 (-400 -10350) (400 90))
+ rect(l3 (-400 -700) (400 610))
+ rect(l3 (290 -610) (400 610))
+ rect(l3 (-400 0) (400 90))
+ rect(l3 (-400 0) (400 10260))
+ rect(l11 (-3045 -10910) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (520 -510) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (520 -510) (170 170))
+ rect(l11 (-170 170) (170 170))
+ rect(l11 (520 -170) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l11 (520 170) (170 170))
+ rect(l11 (-170 -510) (170 170))
+ rect(l12 (-3045 -220) (3160 610))
+ rect(l13 (-1575 -310) (0 0))
+ )
+ net(6 name(SUBSTRATE))
+
+ # Outgoing pins and their connections to nets
+ pin(1 name(C2))
+ pin(2 name(C1))
+ pin(4 name(VSS))
+ pin(5 name(DOWN))
+ pin(6 name(SUBSTRATE))
+
+ # Devices and their connections
+ device(1 D$NMOS
+ device(D$NMOS$1 location(690 0))
+ device(D$NMOS$1 location(1380 0))
+ device(D$NMOS$1 location(2070 0))
+ device(D$NMOS$2 location(2760 0))
+ connect(0 S S)
+ connect(1 S D)
+ connect(2 S S)
+ connect(3 S D)
+ connect(4 S S)
+ connect(0 G G)
+ connect(1 G G)
+ connect(2 G G)
+ connect(3 G G)
+ connect(4 G G)
+ connect(0 D D)
+ connect(1 D S)
+ connect(2 D D)
+ connect(3 D S)
+ connect(4 D D)
+ connect(0 B B)
+ connect(1 B B)
+ connect(2 B B)
+ connect(3 B B)
+ connect(4 B B)
+ mirror location(-5400 8445)
+ param(L 0.4)
+ param(W 50)
+ param(AS 8.7)
+ param(AD 8.7)
+ param(PS 61.74)
+ param(PD 61.74)
+ terminal(S 3)
+ terminal(G 5)
+ terminal(D 4)
+ terminal(B 6)
+ )
+ device(2 D$MOSCAPN$1
+ device(D$MOSCAPN$1 location(-17690 0))
+ rotation(180) location(48520 12350)
+ param(W 14)
+ param(L 17.2)
+ param(N 2)
+ terminal(G 1)
+ terminal(D 3)
+ terminal(B 6)
+ )
+ device(3 D$MOSCAPN
+ device(D$MOSCAPN location(-17690 0))
+ rotation(180) location(9350 12350)
+ param(W 24)
+ param(L 17.2)
+ param(N 2)
+ terminal(G 2)
+ terminal(D 3)
+ terminal(B 6)
+ )
+
+)