Skip to content

Commit

Permalink
Attempt to provide more robustness in the geometry computation
Browse files Browse the repository at this point in the history
  • Loading branch information
klayoutmatthias committed Dec 21, 2019
1 parent f7fae93 commit 8241dd0
Show file tree
Hide file tree
Showing 4 changed files with 177 additions and 8 deletions.
128 changes: 128 additions & 0 deletions docs/klayoutrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<config>
<absolute-units>false</absolute-units>
<abstract-mode-enabled>false</abstract-mode-enabled>
<abstract-mode-width>10</abstract-mode-width>
<apply-text-trans>true</apply-text-trans>
<background-color>#000000</background-color>
<bitmap-caching>false</bitmap-caching>
<bitmap-oversampling>1</bitmap-oversampling>
<bookmarks-follow-selection>true</bookmarks-follow-selection>
<cell-list-sorting>by-name</cell-list-sorting>
<cell-selection-search-case-sensitive>false</cell-selection-search-case-sensitive>
<cell-selection-search-use-expression>true</cell-selection-search-use-expression>
<child-context-color>auto</child-context-color>
<child-context-dimming>50</child-context-dimming>
<child-context-enabled>false</child-context-enabled>
<child-context-hollow>false</child-context-hollow>
<cib-context-cell/>
<cib-context-mode>any-top</cib-context-mode>
<cib-max-inst-count>1000</cib-max-inst-count>
<cib-window-dim>1</cib-window-dim>
<cib-window-mode>center</cib-window-mode>
<circle-points>32</circle-points>
<clear-ruler-new-cell>false</clear-ruler-new-cell>
<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>
<combine-mode>add</combine-mode>
<context-color>#c0c0c0</context-color>
<context-dimming>50</context-dimming>
<context-hollow>false</context-hollow>
<current-ruler-template>0</current-ruler-template>
<dbu>0.001</dbu>
<dbu-units>false</dbu-units>
<default-add-other-layers>false</default-add-other-layers>
<default-font-size>1</default-font-size>
<default-text-size>0.25</default-text-size>
<digits-dbu>2</digits-dbu>
<digits-micron>5</digits-micron>
<draw-array-border-instances>false</draw-array-border-instances>
<drawing-workers>1</drawing-workers>
<drop-small-cells>false</drop-small-cells>
<drop-small-cells-condition>0</drop-small-cells-condition>
<drop-small-cells-value>10</drop-small-cells-value>
<edit-connect-angle-mode>any</edit-connect-angle-mode>
<edit-grid>global</edit-grid>
<edit-hier-copy-mode>0</edit-hier-copy-mode>
<edit-inst-angle>0</edit-inst-angle>
<edit-inst-array>false</edit-inst-array>
<edit-inst-cell-name>INVERTER_WITH_DIODES</edit-inst-cell-name>
<edit-inst-column_x>0</edit-inst-column_x>
<edit-inst-column_y>1</edit-inst-column_y>
<edit-inst-columns>10</edit-inst-columns>
<edit-inst-lib-name/>
<edit-inst-mirror>false</edit-inst-mirror>
<edit-inst-pcell-parameters/>
<edit-inst-place-origin>true</edit-inst-place-origin>
<edit-inst-row_x>1</edit-inst-row_x>
<edit-inst-row_y>0</edit-inst-row_y>
<edit-inst-rows>10</edit-inst-rows>
<edit-inst-scale>1</edit-inst-scale>
<edit-max-shapes-of-instances>1000</edit-max-shapes-of-instances>
<edit-mode>true</edit-mode>
<edit-move-angle-mode>any</edit-move-angle-mode>
<edit-path-ext-type>flush</edit-path-ext-type>
<edit-path-ext-var-begin>0.0</edit-path-ext-var-begin>
<edit-path-ext-var-end>0.0</edit-path-ext-var-end>
<edit-path-width>0.25</edit-path-width>
<edit-show-shapes-of-instances>true</edit-show-shapes-of-instances>
<edit-snap-to-objects>true</edit-snap-to-objects>
<edit-text-halign>center</edit-text-halign>
<edit-text-size>2</edit-text-size>
<edit-text-string>R</edit-text-string>
<edit-text-valign>center</edit-text-valign>
<edit-top-level-selection>false</edit-top-level-selection>
<fit-new-cell>true</fit-new-cell>
<flat-cell-list>true</flat-cell-list>
<full-hierarchy-new-cell>true</full-hierarchy-new-cell>
<global-trans>r0 *1 0,0</global-trans>
<grid-axis-color>auto</grid-axis-color>
<grid-color>#ffffff</grid-color>
<grid-grid-color>auto</grid-grid-color>
<grid-micron>0.01</grid-micron>
<grid-ruler-color>#404040</grid-ruler-color>
<grid-show-ruler>true</grid-show-ruler>
<grid-style0>tenths-dotted-lines</grid-style0>
<grid-style1>dots</grid-style1>
<grid-style2>dots</grid-style2>
<grid-visible>false</grid-visible>
<guiding-shape-color>#ffffff</guiding-shape-color>
<guiding-shape-line-width>0</guiding-shape-line-width>
<guiding-shape-vertex-size>4</guiding-shape-vertex-size>
<guiding-shape-visible>true</guiding-shape-visible>
<hide-empty-layers>false</hide-empty-layers>
<image-cache-size>1</image-cache-size>
<initial-hier-depth>1</initial-hier-depth>
<initial-technology>xxx</initial-technology>
<inst-color>#404040</inst-color>
<inst-label-font>0</inst-label-font>
<inst-label-transform>true</inst-label-transform>
<inst-visible>true</inst-visible>
<layers-always-show-layout-index>false</layers-always-show-layout-index>
<layers-always-show-ld>true</layers-always-show-ld>
<layers-always-show-source>false</layers-always-show-source>
<layout-file-watcher-enabled>true</layout-file-watcher-enabled>
<line-style-palette>0 2 4 1</line-style-palette>
<markers-visible>true</markers-visible>
<min-inst-label-size>16</min-inst-label-size>
<mouse-wheel-mode>0</mouse-wheel-mode>
<navigator-show-all-hier-levels>true</navigator-show-all-hier-levels>
<navigator-show-images>true</navigator-show-images>
<no-stipple>false</no-stipple>
<pan-distance>0.15</pan-distance>
<paste-display-mode>2</paste-display-mode>
<ruler-color>auto</ruler-color>
<ruler-grid-snap>true</ruler-grid-snap>
<ruler-halo>true</ruler-halo>
<ruler-obj-snap>true</ruler-obj-snap>
<ruler-snap-mode>any</ruler-snap-mode>
<ruler-snap-range>8</ruler-snap-range>
<rulers>-1</rulers>
<search-range>10</search-range>
<stipple-offset>true</stipple-offset>
<stipple-palette>0 1 2 3 4 5[1] 6 7 8 9[0] 10 11 12 13 14 15</stipple-palette>
<test-shapes-in-view>false</test-shapes-in-view>
<text-color>auto</text-color>
<text-font>0</text-font>
<text-lazy-rendering>true</text-lazy-rendering>
<text-visible>true</text-visible>
</config>
31 changes: 23 additions & 8 deletions src/ruby/mask_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Binary file added tests/au/xs_etch11.gds
Binary file not shown.
26 changes: 26 additions & 0 deletions tests/xs_etch11.xs
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 8241dd0

Please sign in to comment.