Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

Commit 8241dd0

Browse files
Attempt to provide more robustness in the geometry computation
1 parent f7fae93 commit 8241dd0

File tree

4 files changed

+177
-8
lines changed

4 files changed

+177
-8
lines changed

docs/klayoutrc

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<config>
3+
<absolute-units>false</absolute-units>
4+
<abstract-mode-enabled>false</abstract-mode-enabled>
5+
<abstract-mode-width>10</abstract-mode-width>
6+
<apply-text-trans>true</apply-text-trans>
7+
<background-color>#000000</background-color>
8+
<bitmap-caching>false</bitmap-caching>
9+
<bitmap-oversampling>1</bitmap-oversampling>
10+
<bookmarks-follow-selection>true</bookmarks-follow-selection>
11+
<cell-list-sorting>by-name</cell-list-sorting>
12+
<cell-selection-search-case-sensitive>false</cell-selection-search-case-sensitive>
13+
<cell-selection-search-use-expression>true</cell-selection-search-use-expression>
14+
<child-context-color>auto</child-context-color>
15+
<child-context-dimming>50</child-context-dimming>
16+
<child-context-enabled>false</child-context-enabled>
17+
<child-context-hollow>false</child-context-hollow>
18+
<cib-context-cell/>
19+
<cib-context-mode>any-top</cib-context-mode>
20+
<cib-max-inst-count>1000</cib-max-inst-count>
21+
<cib-window-dim>1</cib-window-dim>
22+
<cib-window-mode>center</cib-window-mode>
23+
<circle-points>32</circle-points>
24+
<clear-ruler-new-cell>false</clear-ruler-new-cell>
25+
<color-palette>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</color-palette>
26+
<combine-mode>add</combine-mode>
27+
<context-color>#c0c0c0</context-color>
28+
<context-dimming>50</context-dimming>
29+
<context-hollow>false</context-hollow>
30+
<current-ruler-template>0</current-ruler-template>
31+
<dbu>0.001</dbu>
32+
<dbu-units>false</dbu-units>
33+
<default-add-other-layers>false</default-add-other-layers>
34+
<default-font-size>1</default-font-size>
35+
<default-text-size>0.25</default-text-size>
36+
<digits-dbu>2</digits-dbu>
37+
<digits-micron>5</digits-micron>
38+
<draw-array-border-instances>false</draw-array-border-instances>
39+
<drawing-workers>1</drawing-workers>
40+
<drop-small-cells>false</drop-small-cells>
41+
<drop-small-cells-condition>0</drop-small-cells-condition>
42+
<drop-small-cells-value>10</drop-small-cells-value>
43+
<edit-connect-angle-mode>any</edit-connect-angle-mode>
44+
<edit-grid>global</edit-grid>
45+
<edit-hier-copy-mode>0</edit-hier-copy-mode>
46+
<edit-inst-angle>0</edit-inst-angle>
47+
<edit-inst-array>false</edit-inst-array>
48+
<edit-inst-cell-name>INVERTER_WITH_DIODES</edit-inst-cell-name>
49+
<edit-inst-column_x>0</edit-inst-column_x>
50+
<edit-inst-column_y>1</edit-inst-column_y>
51+
<edit-inst-columns>10</edit-inst-columns>
52+
<edit-inst-lib-name/>
53+
<edit-inst-mirror>false</edit-inst-mirror>
54+
<edit-inst-pcell-parameters/>
55+
<edit-inst-place-origin>true</edit-inst-place-origin>
56+
<edit-inst-row_x>1</edit-inst-row_x>
57+
<edit-inst-row_y>0</edit-inst-row_y>
58+
<edit-inst-rows>10</edit-inst-rows>
59+
<edit-inst-scale>1</edit-inst-scale>
60+
<edit-max-shapes-of-instances>1000</edit-max-shapes-of-instances>
61+
<edit-mode>true</edit-mode>
62+
<edit-move-angle-mode>any</edit-move-angle-mode>
63+
<edit-path-ext-type>flush</edit-path-ext-type>
64+
<edit-path-ext-var-begin>0.0</edit-path-ext-var-begin>
65+
<edit-path-ext-var-end>0.0</edit-path-ext-var-end>
66+
<edit-path-width>0.25</edit-path-width>
67+
<edit-show-shapes-of-instances>true</edit-show-shapes-of-instances>
68+
<edit-snap-to-objects>true</edit-snap-to-objects>
69+
<edit-text-halign>center</edit-text-halign>
70+
<edit-text-size>2</edit-text-size>
71+
<edit-text-string>R</edit-text-string>
72+
<edit-text-valign>center</edit-text-valign>
73+
<edit-top-level-selection>false</edit-top-level-selection>
74+
<fit-new-cell>true</fit-new-cell>
75+
<flat-cell-list>true</flat-cell-list>
76+
<full-hierarchy-new-cell>true</full-hierarchy-new-cell>
77+
<global-trans>r0 *1 0,0</global-trans>
78+
<grid-axis-color>auto</grid-axis-color>
79+
<grid-color>#ffffff</grid-color>
80+
<grid-grid-color>auto</grid-grid-color>
81+
<grid-micron>0.01</grid-micron>
82+
<grid-ruler-color>#404040</grid-ruler-color>
83+
<grid-show-ruler>true</grid-show-ruler>
84+
<grid-style0>tenths-dotted-lines</grid-style0>
85+
<grid-style1>dots</grid-style1>
86+
<grid-style2>dots</grid-style2>
87+
<grid-visible>false</grid-visible>
88+
<guiding-shape-color>#ffffff</guiding-shape-color>
89+
<guiding-shape-line-width>0</guiding-shape-line-width>
90+
<guiding-shape-vertex-size>4</guiding-shape-vertex-size>
91+
<guiding-shape-visible>true</guiding-shape-visible>
92+
<hide-empty-layers>false</hide-empty-layers>
93+
<image-cache-size>1</image-cache-size>
94+
<initial-hier-depth>1</initial-hier-depth>
95+
<initial-technology>xxx</initial-technology>
96+
<inst-color>#404040</inst-color>
97+
<inst-label-font>0</inst-label-font>
98+
<inst-label-transform>true</inst-label-transform>
99+
<inst-visible>true</inst-visible>
100+
<layers-always-show-layout-index>false</layers-always-show-layout-index>
101+
<layers-always-show-ld>true</layers-always-show-ld>
102+
<layers-always-show-source>false</layers-always-show-source>
103+
<layout-file-watcher-enabled>true</layout-file-watcher-enabled>
104+
<line-style-palette>0 2 4 1</line-style-palette>
105+
<markers-visible>true</markers-visible>
106+
<min-inst-label-size>16</min-inst-label-size>
107+
<mouse-wheel-mode>0</mouse-wheel-mode>
108+
<navigator-show-all-hier-levels>true</navigator-show-all-hier-levels>
109+
<navigator-show-images>true</navigator-show-images>
110+
<no-stipple>false</no-stipple>
111+
<pan-distance>0.15</pan-distance>
112+
<paste-display-mode>2</paste-display-mode>
113+
<ruler-color>auto</ruler-color>
114+
<ruler-grid-snap>true</ruler-grid-snap>
115+
<ruler-halo>true</ruler-halo>
116+
<ruler-obj-snap>true</ruler-obj-snap>
117+
<ruler-snap-mode>any</ruler-snap-mode>
118+
<ruler-snap-range>8</ruler-snap-range>
119+
<rulers>-1</rulers>
120+
<search-range>10</search-range>
121+
<stipple-offset>true</stipple-offset>
122+
<stipple-palette>0 1 2 3 4 5[1] 6 7 8 9[0] 10 11 12 13 14 15</stipple-palette>
123+
<test-shapes-in-view>false</test-shapes-in-view>
124+
<text-color>auto</text-color>
125+
<text-font>0</text-font>
126+
<text-lazy-rendering>true</text-lazy-rendering>
127+
<text-visible>true</text-visible>
128+
</config>

src/ruby/mask_data.rb

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,19 +525,34 @@ def self.stitch_edges(me)
525525

526526
# computes the surface edges (the interface between air and some material)
527527
# "enabled_by" is a material object which needs to touch with the surface
528-
# in order to enable it. "pi" is a prebias which is applied to the air and
529-
# enabling material to shrink the contours for later application of a full
530-
# kernel.
528+
# in order to enable it. "mp" are the verticalized mask polygons (vertical bands
529+
# where the mask is open)
531530
def compute_surface_edges(mp, enabled_by)
532531

533-
# compute the surface edges in me
534-
ap_masked = @ep.safe_boolean_to_polygon(mp, @air_polygons, RBA::EdgeProcessor::mode_and, true, true)
535-
me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp)))
536-
537-
# consider enabling the surface edges with "into", "on" or "through" ..
532+
# compute the surface edges in me
538533
if enabled_by
534+
535+
# pre-size the air polygons to achieve a guaranteed overlap with "enabled_by"
536+
# (in horizontal direction)
537+
# ap_sized = air_polygons.sized_x(delta) - enabled_by
538+
ap_sized = @ep.size_to_polygon(@air_polygons, @xs.delta_dbu, 0, 2, true, true)
539+
ap_sized = @ep.safe_boolean_to_polygon(ap_sized, enabled_by, RBA::EdgeProcessor::mode_anotb, true, true)
540+
541+
# when masking by enabled_by, apply an additional vertical sizing to catch vertical deviations
542+
# (we do this after the masking so we don't alter the vertical dimensions of the etch)
543+
# me = (edges(mp & ap_sized) & ((mp & enabled_by).sized_y(delta))) - edges(mp)
544+
ap_masked = @ep.safe_boolean_to_polygon(mp, ap_sized, RBA::EdgeProcessor::mode_and, true, true)
545+
me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp)))
546+
539547
en_masked = @ep.safe_boolean_to_polygon(mp, enabled_by, RBA::EdgeProcessor::mode_and, true, true)
540548
me &= RBA::Region::new(en_masked).sized(0, @xs.delta_dbu, 2)
549+
550+
else
551+
552+
# me = edges(mp & air_polygons) - edges(mp)
553+
ap_masked = @ep.safe_boolean_to_polygon(mp, @air_polygons, RBA::EdgeProcessor::mode_and, true, true)
554+
me = ap_masked.empty? ? RBA::Edges::new : (RBA::Edges::new(ap_masked) - (mp.empty? ? RBA::Edges::new : RBA::Edges::new(mp)))
555+
541556
end
542557

543558
me

tests/au/xs_etch11.gds

478 Bytes
Binary file not shown.

tests/xs_etch11.xs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
delta(2 * dbu)
3+
4+
l1 = layer("1/0")
5+
6+
substrate = bulk
7+
8+
m1 = mask(l1).grow(0.2, :taper => 5)
9+
# simulate some air-to-material gap which must not change the behavior
10+
m1.size(-1 * dbu, 0)
11+
m2 = all.grow(0.2, :taper => 20, :on => m1)
12+
13+
output("1/0", substrate)
14+
output("1/0", m1)
15+
output("2/0", m2)
16+
17+
# tests overwrite ability
18+
output("101/0", m1)
19+
output("102/0", m2)
20+
21+
etch(0.2, :into => [ m1, m2, substrate ])
22+
23+
output("100/0", substrate)
24+
output("101/0", m1)
25+
output("102/0", m2)
26+

0 commit comments

Comments
 (0)