Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCell DC Series Rings #122

Merged
merged 8 commits into from
Jul 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,138 @@ class ebeam_taper_te1550(pya.PCellDeclarationHelper):
return "ebeam_taper_te1550(" + ('%.3f-%.3f-%.3f' % (self.wg_width1,self.wg_width2,self.wg_length) ) + ")"


class DirectionalCoupler_SeriesRings(pya.PCellDeclarationHelper):
"""
The PCell declaration for the DirectionalCoupler_SeriesRings.

"""

def __init__(self):

# Important: initialize the super class
super(DirectionalCoupler_SeriesRings, self).__init__()

# declare the parameters
self.param("silayer", self.TypeLayer, "Si Layer", default = pya.LayerInfo(1, 0))
self.param("r2", self.TypeDouble, "Radius of Upper Ring", default = 10)
self.param("r1", self.TypeDouble, "Radius of Lower Ring", default = 10)
self.param("w", self.TypeDouble, "Waveguide Width", default = 0.5)
self.param("g", self.TypeDouble, "Gap", default = 0.2)
self.param("Lc", self.TypeDouble, "Coupler Length", default = 0.0)
self.param("pinrec", self.TypeLayer, "PinRec Layer", default = pya.LayerInfo(69, 0))
self.param("devrec", self.TypeLayer, "DevRec Layer", default = pya.LayerInfo(68, 0))
self.param("textl", self.TypeLayer, "Text Layer", default = pya.LayerInfo(10, 0))

def display_text_impl(self):
# Provide a descriptive text for the cell
return "DirectionalCoupler_SeriesRings(R1=" + ('%.3f' % self.r1)+ ",R2=" + ('%.3f' % self.r2) + ",g=" + ('%g' % (1000*self.g)) + ")"

def can_create_from_shape_impl(self):
return False

def produce_impl(self):
# This is the main part of the implementation: create the layout

from math import pi, cos, sin

# fetch the parameters
dbu = self.layout.dbu
ly = self.layout

LayerSi = self.silayer
LayerSiN = ly.layer(LayerSi)
LayerPinRecN = ly.layer(self.pinrec)
LayerDevRecN = ly.layer(self.devrec)
TextLayerN = ly.layer(self.textl)


w = int(round( self.w/dbu))
r1 = int(round( self.r1/dbu))
r2 = int(round( self.r2/dbu))
g = int(round( self.g/dbu))
Lc = int(round( self.Lc/dbu))

# draw the half-circle
x = 0
y = r1+r2+g+w
layout_arc_wg_dbu( self.cell, LayerSiN, x-Lc/2, y, r2, w, 180, 270)
layout_arc_wg_dbu( self.cell, LayerSiN, x+Lc/2, y, r2, w, 270, 360)

# Create the pins, as short paths:
pin_length = 200 # database units, = 0.2 microns

# Pins on the top side:
pin = pya.Path([pya.Point(-r2-Lc/2, y+pin_length/2), pya.Point(-r2-Lc/2, y-pin_length/2)], w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = pya.Trans(-r2-Lc/2, y)
text = pya.Text ("pin2", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu

pin = pya.Path([pya.Point(r2+Lc/2, y+pin_length/2), pya.Point(r2+Lc/2, y-pin_length/2)], w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = pya.Trans(r2+Lc/2, y)
text = pya.Text ("pin4", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu

if Lc > 0:
wg1 = pya.Box(-Lc/2,w + w/2+ g+ r1 , Lc/2, w/2 + g+ r1)
self.cell.shapes(LayerSiN).insert(wg1)


y = 0
layout_arc_wg_dbu( self.cell, LayerSiN, x-Lc/2, y, r1, w, 90, 180)
layout_arc_wg_dbu( self.cell, LayerSiN, x+Lc/2, y, r1, w, 0, 90)

# Pins on the lower side:
pin = pya.Path([pya.Point(-r1-Lc/2, y+pin_length/2), pya.Point(-r1-Lc/2, y-pin_length/2)], w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = pya.Trans(-r1-Lc/2, y)
text = pya.Text ("pin1", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu

pin = pya.Path([pya.Point(r1+Lc/2, y+pin_length/2), pya.Point(r1+Lc/2, y-pin_length/2)], w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = pya.Trans(r1+Lc/2, y)
text = pya.Text ("pin3", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu

if Lc > 0:
wg1 = pya.Box(-Lc/2, r1 -w/2, Lc/2, w/2 + r1)
self.cell.shapes(LayerSiN).insert(wg1)

if(r1>r2):
r = r1
else:
r = r2


# Create the device recognition layer -- make it 1 * wg_width away from the waveguides.
dev = pya.Box(-r-w/2-w-Lc/2,r1+r2+g+w, r+w/2+w+Lc/2, y )
self.cell.shapes(LayerDevRecN).insert(dev)


# Compact model information
t = pya.Trans(((r1+r2)/2)/4, 0)
text = pya.Text ("Lumerical_INTERCONNECT_library=Design kits/ebeam_v1.2", t)
shape = self.cell.shapes(LayerDevRecN).insert(text)
shape.text_size = r*0.017
t = pya.Trans(((r1+r2)/2)/4, ((r1+r2)/2)/4)
text = pya.Text ('Lumerical_INTERCONNECT_component=ebeam_dc_seriesrings', t)
shape = self.cell.shapes(LayerDevRecN).insert(text)
shape.text_size = r*0.017
t = pya.Trans(((r1+r2)/2)/4, ((r1+r2)/2)/2)
# text = pya.Text ('Spice_param:wg_width=%.3fu gap="%s" radius="%s"'% ( w, g,int( r)), t)
text = pya.Text ('Spice_param:wg_width=%.3fu gap=%.3fu radius1=%.3fu radius2=%.3fu'% ( w, g,int( r1), int(r2)), t)
shape = self.cell.shapes(LayerDevRecN).insert(text)
shape.text_size = r*0.017

print("Done drawing the layout for - DirectionalCoupler_SeriesRings: %.3f-%.3f-%g" % ( self.r1, self.r2, self.g) )




class SiEPIC(pya.Library):
Expand Down Expand Up @@ -2353,6 +2485,7 @@ class SiEPIC(pya.Library):
self.layout().register_pcell("SWG_waveguide", SWG_waveguide())
self.layout().register_pcell("SWG_to_strip_waveguide", SWG_to_strip_waveguide())
self.layout().register_pcell("spiral", spiral())
self.layout().register_pcell("DirectionalCoupler_SeriesRings", DirectionalCoupler_SeriesRings())

# Register us with the name "SiEPIC_EBeam_PCells".
# If a library with that name already existed, it will be replaced then.
Expand Down