From 8241dd0869a29d79f54c92dbd23c1b2c90719fe2 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 21 Dec 2019 15:56:12 +0100 Subject: [PATCH] Attempt to provide more robustness in the geometry computation --- docs/klayoutrc | 128 +++++++++++++++++++++++++++++++++++++++++ src/ruby/mask_data.rb | 31 +++++++--- tests/au/xs_etch11.gds | Bin 0 -> 478 bytes tests/xs_etch11.xs | 26 +++++++++ 4 files changed, 177 insertions(+), 8 deletions(-) create mode 100644 docs/klayoutrc create mode 100644 tests/au/xs_etch11.gds create mode 100644 tests/xs_etch11.xs diff --git a/docs/klayoutrc b/docs/klayoutrc new file mode 100644 index 0000000..5bb2d41 --- /dev/null +++ b/docs/klayoutrc @@ -0,0 +1,128 @@ + + + false + false + 10 + true + #000000 + false + 1 + true + by-name + false + true + auto + 50 + false + false + + any-top + 1000 + 1 + center + 32 + false + 255,157,157[0] 255,128,168[1] 192,128,255[2] 149,128,255[3] 128,134,255[4] 128,168,255[5] 255,0,0[6] 255,0,128[7] 255,0,255[8] 128,0,255[9] 0,0,255[10] 0,128,255[11] 128,0,0[12] 128,0,87[13] 128,0,128[14] 80,0,128[15] 0,0,128[16] 0,64,128[17] 128,255,251[18] 128,255,141[19] 175,255,128[20] 243,255,128[21] 255,194,128[22] 255,160,128[23] 0,255,255[24] 1,255,107[25] 145,255,0[26] 221,255,0[27] 255,174,0[28] 255,128,0[29] 0,128,128[30] 0,128,80[31] 0,128,0[32] 80,128,0[33] 128,128,0[34] 128,80,0[35] 255,255,255 192,192,192 128,128,128 96,96,96 64,64,64 0,0,0 + add + #c0c0c0 + 50 + false + 0 + 0.001 + false + false + 1 + 0.25 + 2 + 5 + false + 1 + false + 0 + 10 + any + global + 0 + 0 + false + INVERTER_WITH_DIODES + 0 + 1 + 10 + + false + + true + 1 + 0 + 10 + 1 + 1000 + true + any + flush + 0.0 + 0.0 + 0.25 + true + true + center + 2 + R + center + false + true + true + true + r0 *1 0,0 + auto + #ffffff + auto + 0.01 + #404040 + true + tenths-dotted-lines + dots + dots + false + #ffffff + 0 + 4 + true + false + 1 + 1 + xxx + #404040 + 0 + true + true + false + true + false + true + 0 2 4 1 + true + 16 + 0 + true + true + false + 0.15 + 2 + auto + true + true + true + any + 8 + -1 + 10 + true + 0 1 2 3 4 5[1] 6 7 8 9[0] 10 11 12 13 14 15 + false + auto + 0 + true + true + diff --git a/src/ruby/mask_data.rb b/src/ruby/mask_data.rb index fe4bf1b..7f4789d 100644 --- a/src/ruby/mask_data.rb +++ b/src/ruby/mask_data.rb @@ -525,19 +525,34 @@ def self.stitch_edges(me) # computes the surface edges (the interface between air and some material) # "enabled_by" is a material object which needs to touch with the surface - # in order to enable it. "pi" is a prebias which is applied to the air and - # enabling material to shrink the contours for later application of a full - # kernel. + # in order to enable it. "mp" are the verticalized mask polygons (vertical bands + # where the mask is open) def compute_surface_edges(mp, enabled_by) - # compute the surface edges in me - ap_masked = @ep.safe_boolean_to_polygon(mp, @air_polygons, RBA::EdgeProcessor::mode_and, true, true) - me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp))) - - # consider enabling the surface edges with "into", "on" or "through" .. + # compute the surface edges in me if enabled_by + + # pre-size the air polygons to achieve a guaranteed overlap with "enabled_by" + # (in horizontal direction) + # ap_sized = air_polygons.sized_x(delta) - enabled_by + ap_sized = @ep.size_to_polygon(@air_polygons, @xs.delta_dbu, 0, 2, true, true) + ap_sized = @ep.safe_boolean_to_polygon(ap_sized, enabled_by, RBA::EdgeProcessor::mode_anotb, true, true) + + # when masking by enabled_by, apply an additional vertical sizing to catch vertical deviations + # (we do this after the masking so we don't alter the vertical dimensions of the etch) + # me = (edges(mp & ap_sized) & ((mp & enabled_by).sized_y(delta))) - edges(mp) + ap_masked = @ep.safe_boolean_to_polygon(mp, ap_sized, RBA::EdgeProcessor::mode_and, true, true) + me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp))) + en_masked = @ep.safe_boolean_to_polygon(mp, enabled_by, RBA::EdgeProcessor::mode_and, true, true) me &= RBA::Region::new(en_masked).sized(0, @xs.delta_dbu, 2) + + else + + # me = edges(mp & air_polygons) - edges(mp) + ap_masked = @ep.safe_boolean_to_polygon(mp, @air_polygons, RBA::EdgeProcessor::mode_and, true, true) + me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp))) + end me diff --git a/tests/au/xs_etch11.gds b/tests/au/xs_etch11.gds new file mode 100644 index 0000000000000000000000000000000000000000..b61f8f8d16c4d15636e06bf22e7757b7c0b43775 GIT binary patch literal 478 zcmZ{gF-`(O7=_>dv&;gbkwiNh5@PJM(wG<%1PY=7BNT*MJC*1Ww6gI6Hg;aY0~kWA zxPupVc0&LhZyF$&a^u9LDwYo;z&v<9k<^Wn zNscDwV}6kr%)Bta>p9?i>PETnjgaoU{@1rgA4imWzf1Cy`5n*OL^n!Z z6Mwqz%J<#q_X5uS>?d>wywl7%r9|YM%z5V3!*lLD2Z?U(Js(NtqVXRWy<~iT#D5gx E7r-4(ssI20 literal 0 HcmV?d00001 diff --git a/tests/xs_etch11.xs b/tests/xs_etch11.xs new file mode 100644 index 0000000..fe1b19a --- /dev/null +++ b/tests/xs_etch11.xs @@ -0,0 +1,26 @@ + +delta(2 * dbu) + +l1 = layer("1/0") + +substrate = bulk + +m1 = mask(l1).grow(0.2, :taper => 5) +# simulate some air-to-material gap which must not change the behavior +m1.size(-1 * dbu, 0) +m2 = all.grow(0.2, :taper => 20, :on => m1) + +output("1/0", substrate) +output("1/0", m1) +output("2/0", m2) + +# tests overwrite ability +output("101/0", m1) +output("102/0", m2) + +etch(0.2, :into => [ m1, m2, substrate ]) + +output("100/0", substrate) +output("101/0", m1) +output("102/0", m2) +