Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Former-commit-id: 419c46f
  • Loading branch information
jaspreetj committed Dec 17, 2019
2 parents 4dd3c15 + 7a0b110 commit b049007
Show file tree
Hide file tree
Showing 74 changed files with 12,101 additions and 100 deletions.
Binary file added Developers/Scripting_guide/KLayout_PCell.pdf
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
60e2467f1bc34b177146e1cd063027cdd86f4bb2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1b2d3f94e19ab007b5dd34218c67c1fe004cf1af
Binary file not shown.
Binary file added Developers/Scripting_guide/Layout_tips.pdf
Binary file not shown.
1 change: 1 addition & 0 deletions Developers/Scripting_guide/Layout_tips.pptx.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b4ed040133a27d5efca3ad8198733d8a8b12d56b
61 changes: 61 additions & 0 deletions Developers/Scripting_guide/my_first_layout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from pya import *

# Example layout function
def bent_bragg_layout():

# Configure parameter sweep
pol = 'te'
if pol == 'te':
r = 20
w = 0.5
gap = 0.2

wg_bend_radius = 5

# Import functions from SiEPIC-Tools, and get technology details
from SiEPIC.utils import select_paths, get_layout_variables
TECHNOLOGY, lv, ly, cell = get_layout_variables()
dbu = ly.dbu
from SiEPIC.extend import to_itype
from SiEPIC.scripts import path_to_waveguide

# Layer mapping:
LayerSiN = ly.layer(TECHNOLOGY['Si'])
fpLayerN = cell.layout().layer(TECHNOLOGY['FloorPlan'])
TextLayerN = cell.layout().layer(TECHNOLOGY['Text'])

# Draw the floor plan
cell.shapes(fpLayerN).insert(Box(0,0, 610/dbu, 405/dbu))

#** Create the device under test (directional coupler)
top_cell = cell

pcell = ly.create_cell("ebeam_dc_halfring_straight", "EBeam", { "r": r, "w": w, "g": gap, "bustype": 0 } )

x_pos_device = 100
y_pos_device = 100

t = Trans(Trans.R90, x_pos_device/dbu, to_itype(y_pos_device,dbu))

cell.insert(CellInstArray(pcell.cell_index(),t))


#** input/out GCs
GC_array = ly.create_cell("ebeam_gc_te1550", "EBeam").cell_index()
GC_pitch = 127
x_pos_GC = 33.1
y_pos_GC = 21.4/2
t = Trans(Trans.R0, x_pos_GC/dbu, to_itype(y_pos_GC,dbu))

cell.insert(CellInstArray(GC_array, t, DPoint(0,GC_pitch).to_itype(dbu), DPoint(0,0).to_itype(dbu), 4, 1))


#** routing
pts = [DPoint(x_pos_GC, y_pos_GC), DPoint(x_pos_device, y_pos_GC) ,DPoint(x_pos_device,y_pos_device-r-0.75), ]
dpath = DPath(pts, 0.5).transformed(DTrans(DTrans.R0,0,0))
cell.shapes(LayerSiN).insert(dpath.to_itype(dbu))

# do the other 3!


bent_bragg_layout()
185 changes: 185 additions & 0 deletions Developers/Scripting_guide/my_first_script.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
"""
This file is part of the SiEPIC_EBeam_PDK
NOTE: after changing the code, the macro needs to be rerun to install the new
implementation. The macro is also set to "auto run" to install the PCell
when KLayout is run.
"""
import math
from SiEPIC.utils import get_technology, get_technology_by_name

# Import KLayout Python API methods:
# Box, Point, Polygon, Text, Trans, LayerInfo, etc
from pya import *

"""
class ebeam_Bent_Bragg(PCellDeclarationHelper):
#The PCell declaration for the bent Bragg gratings pcell
def __init__(self):
# Important: initialize the super class
super(ebeam_Bent_Bragg, self).__init__()
TECHNOLOGY = get_technology_by_name('EBeam')
# declare the parameters
self.param("silayer", self.TypeLayer, "Si Layer", default = TECHNOLOGY['Waveguide'])
self.param("silayer_gratings", self.TypeLayer, "Si Gratings Layer", default = TECHNOLOGY['31_Si_p6nm'])
self.param("radius", self.TypeDouble, "Radius (um)", default = 25)
self.param("width", self.TypeDouble, "Width (um)", default = 0.5)
self.param("period", self.TypeDouble, "Gratings Period (nm)", default = 318)
self.param("deltaW", self.TypeDouble, "Corrugation Width (um)", default = 0.04)
self.param("gamma", self.TypeDouble, "N (number of corrugations)", default = 135)
self.param("pinrec", self.TypeLayer, "PinRec Layer", default = TECHNOLOGY['PinRec'])
self.param("devrec", self.TypeLayer, "DevRec Layer", default = TECHNOLOGY['DevRec'])
def display_text_impl(self):
# Provide a descriptive text for the cell
return "Bent_Bragg(R=" + ('%.3f' % self.radius) + ")"
def produce(self, layout, layers, parameters, cell):
#coerce parameters (make consistent)
self._layers = layers
self.cell = cell
self._param_values = parameters
self.layout = layout
# cell: layout cell to place the layout
# LayerSiN: which layer to use
# r: radius
# w: waveguide width
# length units in dbu
from math import pi, cos, sin
from SiEPIC.utils import arc_wg, arc_wg_xy
from SiEPIC._globals import PIN_LENGTH
# fetch the parameters
dbu = self.layout.dbu
ly = self.layout
LayerSi = self.silayer
LayerSiN_gratings = self.silayer_gratings_layer
LayerSiN = self.silayer_layer
LayerPinRecN = ly.layer(self.pinrec)
LayerDevRecN = ly.layer(self.devrec)
from SiEPIC.extend import to_itype
w = to_itype(self.width,dbu)
r = to_itype(self.radius,dbu)
period = self.period
deltaW = to_itype(self.deltaW,dbu)
N = int(self.gamma)
# Center of everything
x = 0
y = 0
# Angle of Bragg corrugated portion, also bend angle!
periodAngle = (180/pi) * (period/2) /r
# Bend angle
bendAngle = (180/pi) * (N*period/2) /r
N_input = N;
# Normalized number of corrugations to periodAngle
N = N*periodAngle*2;
# Bragg wide
ii = periodAngle*2
while ii < N+periodAngle*1.5:
self.cell.shapes(LayerSiN_gratings).insert(arc_wg_xy(x,y, r, w+deltaW, 90+bendAngle-ii, 90+bendAngle-ii-periodAngle))
ii = ii+periodAngle
ii = ii+periodAngle
# Bragg narrow
ii = periodAngle
while ii < N:
self.cell.shapes(LayerSiN_gratings).insert(arc_wg_xy(x,y, r, w-deltaW, 90+bendAngle-ii, 90+bendAngle-ii-periodAngle))
ii = ii+periodAngle
ii = ii+periodAngle
# bend non-corrugated left
self.cell.shapes(LayerSiN).insert(arc_wg_xy(x,y, r, w, 180-(90-bendAngle), 180))
# bend non-corrugated right
self.cell.shapes(LayerSiN).insert(arc_wg_xy(x,y, r, w, 0, 90-bendAngle))
bendAngleRad = (pi/180) * bendAngle
# Create the pins, as short paths:
from SiEPIC._globals import PIN_LENGTH as pin_length
# Pin on the bottom left side:
p1 = [Point(x-r, pin_length/2 +y), Point(x-r, -pin_length/2 +y)]
p1c = Point(x-r, y)
self.set_p1 = p1c
self.p1 = p1c
pin = Path(p1, w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = Trans(Trans.R0, x-r, y)
text = Text ("opt1", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu
# Pin on the bottom right side:
p2 = [Point(x+r, y+pin_length/2), Point(x+r,y-pin_length/2)]
p2c = Point(x+r,y)
self.set_p2 = p2c
self.p2 = p2c
pin = Path(p2, w)
self.cell.shapes(LayerPinRecN).insert(pin)
t = Trans(Trans.R0, x+r, y)
text = Text ("opt2", t)
shape = self.cell.shapes(LayerPinRecN).insert(text)
shape.text_size = 0.4/dbu
# Create the device recognition layer -- make it 1 * wg_width away from the waveguides.
self.cell.shapes(LayerDevRecN).insert(arc_wg_xy(x ,y, r, w*5, 0, 180))
class SiEPIC_Demo(Library):
#The library where we will put the PCells and GDS into
def __init__(self):
tech_name = 'EBeam_Personal'
library = tech_name
print("Initializing '%s' Library." % library)
# Set the description
# windows only allows for a fixed width, short description
self.description = ""
# OSX does a resizing:
self.description = "This is my first library!"
# Create the PCell declarations
#self.layout().register_pcell("ebeam_Bent_Bragg", ebeam_Bent_Bragg())
# Register the library with the technology name
# If a library with that name already existed, it will be replaced then.
self.register(library)
self.technology='EBeam'
# Instantiate and register the library
SiEPIC_Demo()
"""
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20983bdc4b844068e561d04c9bdfcf0ac3d9a99f
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file added Documentation/Crossing/Summary_Crossing.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cdd7776c4873882046ac02df866aacb2ce06169b
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
14b2c1fe21416edc6d336fc67d1addc1bce19fc0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
251b69a0b15c4a18d73be29b237af4d14116766f
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
19b779958926c25767ef436e0f0bec18f33e0e93
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0a2c374c0b55aac4be9a0fd581f9e66ef9d8f6b1
Binary file not shown.
Binary file not shown.
Binary file added Documentation/Ring Resonator/Ring_OFC2014.gds
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
89e52f4996559fa12410bc2873cd41cc207c30f8
Binary file added Documentation/Taper/Summary_Taper.pdf
Binary file not shown.
Binary file added Documentation/Terminator/Summary_Terminator.pdf
Binary file not shown.
Binary file added Documentation/Waveguide/Summary_Waveguide.pdf
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit b049007

Please sign in to comment.