xsection - Implantation on trench cutting through two epitaxial layers

edited March 2018 in KLayout Development
Hi,
I am using the great xsection tool.
I have a trench cutting trough two different layers on which I wish to implant. However, my implantation is not effective on the side of the trench.
For more clarity, here is my code:

# 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)

If my trench cut through only one layer, then the implant is present on the side but not with two and I don't understand why.
Thanks a lot for your help.

Sophie

Comments

  • edited March 2018

    Hi Sophie,

    thanks for reporting this issue. It's actually not obvious what is wrong, but the effect is due to snapping at the boundary of the two materials.

    I have created a ticket for this: https://github.com/klayoutmatthias/xsection/issues/4.

    A quick fix is to monkey patch the XS generator:

    # ----------------------------------------------
    # Workaround for bug #4
    # Insert this snippet into your code at the beginning:
    
    class ::MaskData
    
      def etch(*args)
    
        (xy, z, into, through, on, taper, bias, mode, buried) = parse_grow_etch_args(args, :etch)
        if !into
          raise "'etch' method: requires an 'into' specification"
        end
    
        d = produce_geom(xy, z, into, through, on, taper, bias, mode, buried, :etch)
    
        res = MaterialData.new(d, @xs)
    
        into.each do |i|
          j = LayoutData::new(i.data, @xs)
          i.sub(res)
          j.sub(i)
          @xs.air.add(j)
        end
    
      end
    
    end
    
    # until here
    # ----------------------------------------------
    
    
    # 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)
    

    Let me know whether this works for you. I can transfer this patch into the production code.

    Kind regards,

    Matthias

  • edited November -1
    Hi Matthias,

    Thank you for your quick answer and your help.
    The monkey patch works perfectly.

    Regards,
    Sophie
Sign In or Register to comment.