Skip to content

Commit

Permalink
Fixed #4, Fixed #5, updated tests, test compatibility with 0.25.x
Browse files Browse the repository at this point in the history
  • Loading branch information
klayoutmatthias committed Apr 9, 2018
1 parent 37582e8 commit 0a44b10
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/grain.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<salt-grain>
<name>xsection</name>
<version>1.1</version>
<version>1.2</version>
<api-version/>
<title>Ruby script</title>
<doc>A generator for vertical cross sections of layouts using a technology description file.</doc>
Expand Down
14 changes: 7 additions & 7 deletions src/macros/xsection.lym
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -289,14 +289,13 @@ class MaskData &lt; 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)
Expand Down Expand Up @@ -1052,6 +1051,7 @@ class XSectionScriptEnvironment

app = RBA::Application.instance
mw = app.main_window
mw || return

@action = RBA::Action.new
@action.title = "XSection Script"
Expand Down
Binary file added tests/au/xs_bug4.gds
Binary file not shown.
13 changes: 12 additions & 1 deletion tests/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash -e

export KLAYOUT_HOME=/dev/null

echo "Using KLayout:"
klayout -v
echo ""
Expand All @@ -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."
Expand Down
Binary file added tests/xs_bug4.gds
Binary file not shown.
28 changes: 28 additions & 0 deletions tests/xs_bug4.xs
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 0a44b10

Please sign in to comment.