From 0a44b10319f9f5f7465b1ecb38d1ed4c2c038910 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 9 Apr 2018 21:20:24 +0200 Subject: [PATCH] Fixed #4, Fixed #5, updated tests, test compatibility with 0.25.x --- src/grain.xml | 2 +- src/macros/xsection.lym | 14 +++++++------- tests/au/xs_bug4.gds | Bin 0 -> 1182 bytes tests/run_tests.sh | 13 ++++++++++++- tests/xs_bug4.gds | Bin 0 -> 234 bytes tests/xs_bug4.xs | 28 ++++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 tests/au/xs_bug4.gds create mode 100644 tests/xs_bug4.gds create mode 100644 tests/xs_bug4.xs diff --git a/src/grain.xml b/src/grain.xml index 0f9f4b3..85f2bee 100644 --- a/src/grain.xml +++ b/src/grain.xml @@ -1,7 +1,7 @@ xsection - 1.1 + 1.2 Ruby script A generator for vertical cross sections of layouts using a technology description file. diff --git a/src/macros/xsection.lym b/src/macros/xsection.lym index dfb28d9..73da871 100644 --- a/src/macros/xsection.lym +++ b/src/macros/xsection.lym @@ -121,7 +121,7 @@ class LayoutData shape = shape_iter.shape if shape.is_polygon? || shape.is_path? || shape.is_box? - @polygons.push(shape.polygon.transformed_cplx(shape_iter.itrans)) + @polygons.push(shape.polygon.transformed(shape_iter.trans)) end shape_iter.next @@ -289,14 +289,13 @@ class MaskData < LayoutData res = MaterialData.new(d, @xs) # consume material and add to air - if into - into.each do |i| - i.sub(res) - end + into.each do |i| + j = LayoutData::new(i.data, @xs) + i.sub(res) + j.sub(i) + @xs.air.add(j) end - @xs.air.add(res) - end def parse_grow_etch_args(args, method) @@ -1052,6 +1051,7 @@ class XSectionScriptEnvironment app = RBA::Application.instance mw = app.main_window + mw || return @action = RBA::Action.new @action.title = "XSection Script" diff --git a/tests/au/xs_bug4.gds b/tests/au/xs_bug4.gds new file mode 100644 index 0000000000000000000000000000000000000000..b90d0121d9b09fb4dcc056d2a9123b8a98d0d673 GIT binary patch literal 1182 zcmZ{jziU)M6ov2mk(UUGtFQ`6*nL>o7|3o?1VKhLiUegX++wi|Vqp{f6D$R*RDvmN zf*?v7K`kt_NTCR#h$uE%7)6ADB4T0u=FOa!Z8F7v`yTJkoO{k4D=bY1HkqWOpDnjt zw$CQ);P8JNON(<0C(WAKh&yq8?(F)V&7-FtP2awCv2T+jJJ*dD#o)r}`ToNBp5T4C=6kKKPhsp`DNCgj=Twv^SlD*%*qBI zEWswc0uR8;umvxfbzVol3-3E0A>VaALF&5wuupdo_U%4}oYyP2$(LHgdb6nap7i=U zzp}4pjW0ud!Se>s58*es3ctf;_yb;poA4_92^ZmSh_=RGcn1E1$ISd$*(@A|N8mU- z3^6i01oy+zti_(5^3Cf)-;Vm#_Y9u+I(Ij64YIF$06E7!hMeo3Ky8xc3lW+y{tH74gse?|oDbQQxrsBKV(F{wwb~|0WIl zd1%0;?Rja(`H?^JtM*TR%HQa>{IBy+KFUk^DNp6Ayf;Fh)m+f0=A(5Z^x3{2=B=df zWQzI3H_z^Tct67|dq3n)?U($MpYm6J%YWsee3X~+Q=ZCKd9QJ<&p*zC=A*tZWbN;v W?o)lg(Bto+?qAHO$`5Pv-2MY4-=%o~ literal 0 HcmV?d00001 diff --git a/tests/run_tests.sh b/tests/run_tests.sh index d14e1d0..47e049b 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -1,5 +1,7 @@ #!/bin/bash -e +export KLAYOUT_HOME=/dev/null + echo "Using KLayout:" klayout -v echo "" @@ -25,7 +27,16 @@ for tc_file in $tc_files; do echo "---------------------------------------------------" echo "Running testcase $tc .." - klayout -rx -z -rd xs_run=$tc.xs -rd xs_cut="-1,0;1,0" -rd xs_out=run_dir/$tc.gds xs_test.gds -r $bin + xs_input=$(grep XS_INPUT $tc.xs | sed 's/.*XS_INPUT *= *//') + if [ "$xs_input" = "" ]; then + xs_input="xs_test.gds" + fi + xs_cut=$(grep XS_CUT $tc.xs | sed 's/.*XS_CUT *= *//') + if [ "$xs_cut" = "" ]; then + xs_cut="-1,0;1,0" + fi + + klayout -rx -z -rd xs_run=$tc.xs -rd xs_cut="$xs_cut" -rd xs_out=run_dir/$tc.gds "$xs_input" -r $bin if klayout -b -rd a=au/$tc.gds -rd b=run_dir/$tc.gds -rd tol=10 -r run_xor.rb; then echo "No differences found." diff --git a/tests/xs_bug4.gds b/tests/xs_bug4.gds new file mode 100644 index 0000000000000000000000000000000000000000..0d5b4411e6409c6d4d9ec457f84ce1c8e192b036 GIT binary patch literal 234 zcmZQzV_;&6V31*CVt>TI%)rAS${@v{hs^+>@@d2w)}&o%MSeo zv!g;7WLWX&V`B?(4Gv*o;b353<7HxCVqoKAVqjp<5n%rR|Gy8A6$PQoRTvnAffz=^ u#2KO(SOgj1`k9gSf4ITGAh_xOe-NF%h=D;q13|;Y1vf$TvjfdwVE_Pz$SwK+ literal 0 HcmV?d00001 diff --git a/tests/xs_bug4.xs b/tests/xs_bug4.xs new file mode 100644 index 0000000..f821a1c --- /dev/null +++ b/tests/xs_bug4.xs @@ -0,0 +1,28 @@ +# XS_INPUT=xs_bug4.gds +# XS_CUT=-8,16;12,16 + +# Prepare input layers +layer_TRENCH = layer("2/0") +layer_IMPLANT = layer("3/0") + +substrate = bulk + +# First epitaxial layer +epi = deposit(0.5) + +# Second epitaxial layer +epi2 = deposit(0.5) + +# TRENCH +# etch substrate on mask with thickness 0.7µm and angle 30° +mask(layer_TRENCH).etch(0.7, :taper => 30, :into => [substrate, epi, epi2]) + +# IMPLANT +# create an implant by growing the mask into the substrate material and both epitaxial layers. +implant=mask(layer_IMPLANT).grow(0.2, 0.05, :mode => :round, :into => [substrate, epi, epi2]) + +# finally output all result material to the target layout +output("1/0", substrate) +output("2/0", epi) +output("3/0", epi2) +output("6/0", implant)