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

Commit 0a44b10

Browse files
Fixed #4, Fixed #5, updated tests, test compatibility with 0.25.x
1 parent 37582e8 commit 0a44b10

File tree

6 files changed

+48
-9
lines changed

6 files changed

+48
-9
lines changed

src/grain.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<salt-grain>
33
<name>xsection</name>
4-
<version>1.1</version>
4+
<version>1.2</version>
55
<api-version/>
66
<title>Ruby script</title>
77
<doc>A generator for vertical cross sections of layouts using a technology description file.</doc>

src/macros/xsection.lym

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class LayoutData
121121

122122
shape = shape_iter.shape
123123
if shape.is_polygon? || shape.is_path? || shape.is_box?
124-
@polygons.push(shape.polygon.transformed_cplx(shape_iter.itrans))
124+
@polygons.push(shape.polygon.transformed(shape_iter.trans))
125125
end
126126

127127
shape_iter.next
@@ -289,14 +289,13 @@ class MaskData &lt; LayoutData
289289
res = MaterialData.new(d, @xs)
290290

291291
# consume material and add to air
292-
if into
293-
into.each do |i|
294-
i.sub(res)
295-
end
292+
into.each do |i|
293+
j = LayoutData::new(i.data, @xs)
294+
i.sub(res)
295+
j.sub(i)
296+
@xs.air.add(j)
296297
end
297298

298-
@xs.air.add(res)
299-
300299
end
301300

302301
def parse_grow_etch_args(args, method)
@@ -1052,6 +1051,7 @@ class XSectionScriptEnvironment
10521051

10531052
app = RBA::Application.instance
10541053
mw = app.main_window
1054+
mw || return
10551055

10561056
@action = RBA::Action.new
10571057
@action.title = "XSection Script"

tests/au/xs_bug4.gds

1.15 KB
Binary file not shown.

tests/run_tests.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash -e
22

3+
export KLAYOUT_HOME=/dev/null
4+
35
echo "Using KLayout:"
46
klayout -v
57
echo ""
@@ -25,7 +27,16 @@ for tc_file in $tc_files; do
2527
echo "---------------------------------------------------"
2628
echo "Running testcase $tc .."
2729

28-
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
30+
xs_input=$(grep XS_INPUT $tc.xs | sed 's/.*XS_INPUT *= *//')
31+
if [ "$xs_input" = "" ]; then
32+
xs_input="xs_test.gds"
33+
fi
34+
xs_cut=$(grep XS_CUT $tc.xs | sed 's/.*XS_CUT *= *//')
35+
if [ "$xs_cut" = "" ]; then
36+
xs_cut="-1,0;1,0"
37+
fi
38+
39+
klayout -rx -z -rd xs_run=$tc.xs -rd xs_cut="$xs_cut" -rd xs_out=run_dir/$tc.gds "$xs_input" -r $bin
2940

3041
if klayout -b -rd a=au/$tc.gds -rd b=run_dir/$tc.gds -rd tol=10 -r run_xor.rb; then
3142
echo "No differences found."

tests/xs_bug4.gds

234 Bytes
Binary file not shown.

tests/xs_bug4.xs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# XS_INPUT=xs_bug4.gds
2+
# XS_CUT=-8,16;12,16
3+
4+
# Prepare input layers
5+
layer_TRENCH = layer("2/0")
6+
layer_IMPLANT = layer("3/0")
7+
8+
substrate = bulk
9+
10+
# First epitaxial layer
11+
epi = deposit(0.5)
12+
13+
# Second epitaxial layer
14+
epi2 = deposit(0.5)
15+
16+
# TRENCH
17+
# etch substrate on mask with thickness 0.7µm and angle 30°
18+
mask(layer_TRENCH).etch(0.7, :taper => 30, :into => [substrate, epi, epi2])
19+
20+
# IMPLANT
21+
# create an implant by growing the mask into the substrate material and both epitaxial layers.
22+
implant=mask(layer_IMPLANT).grow(0.2, 0.05, :mode => :round, :into => [substrate, epi, epi2])
23+
24+
# finally output all result material to the target layout
25+
output("1/0", substrate)
26+
output("2/0", epi)
27+
output("3/0", epi2)
28+
output("6/0", implant)

0 commit comments

Comments
 (0)