Skip to content

Commit

Permalink
PCM for straight WG loss
Browse files Browse the repository at this point in the history
Former-commit-id: f60c855
  • Loading branch information
lukasc-ubc committed Nov 27, 2016
1 parent 8cb9fdd commit b87ce75
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PCM/EBL_Framework_1cm_PCM.gds.REMOVED.git-id
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f666b8613e81208b4a16ac66a3c8994442007d6c
b43ff2de2068db57552140e24b826cb7c1aebe6c
175 changes: 175 additions & 0 deletions klayout_dot_config/pymacros/Layout_StraightWG_delayline.lym
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
<?xml version="1.0" encoding="utf-8"?>
<klayout-macro>
<description/>
<version/>
<category>pymacros</category>
<prolog/>
<epilog/>
<doc/>
<autorun>false</autorun>
<autorun-early>false</autorun-early>
<shortcut/>
<show-in-menu>false</show-in-menu>
<group-name/>
<menu-path/>
<interpreter>python</interpreter>
<dsl-interpreter-name/>
<text># Python script
# Layout_DoubleBus_RingResonator

"""
This file is part of the SiEPIC_EBeam_PDK
by Lukas Chrostowski (c) 2016

This Python file creates a layout for a long waveguide delay line, using straight waveguides

uses:
- the SiEPIC EBeam GDS Library
- the SiEPIC EBeam PCell Library
it does:
- creates the layout in the presently selected cell
- deletes everything first within the current cell

Version history:

Lukas Chrostowski 2016/11/26
- Initial version

"""

import pya

pol = 'te'

if pol == 'te':
sweep_wgL = [0, 150,300, 450] # length of the straight section
x_offset = 50
else:
sweep_wgL = [0, 150,300, 450] # length of the straight section
x_offset = 67

# Configure variables to draw structures in the presently selected cell:
lv = pya.Application.instance().main_window().current_view()
if lv == None:
raise Exception("No view selected")
# Find the currently selected layout.
ly = pya.Application.instance().main_window().current_view().active_cellview().layout()
if ly == None:
raise Exception("No layout")
# find the currently selected cell:
cell = pya.Application.instance().main_window().current_view().active_cellview().cell
if cell == None:
raise Exception("No cell")
# fetch the database parameters
dbu = 1 / ly.dbu

# clean all cells within "cell"
#ly.prune_subcells(cell.cell_index(), 10)
#delete_extra_top_cells(cell)

# Layer mapping:
LayerSi = pya.LayerInfo(1, 0)
LayerSiN = cell.layout().layer(LayerSi)
fpLayer = pya.LayerInfo(99, 0)
fpLayerN = cell.layout().layer(fpLayer)
TextLayer = pya.LayerInfo(10, 0)
TextLayerN = cell.layout().layer(TextLayer)

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

# Create a sub-cell
top_cell = cell
cell = cell.layout().create_cell("StraightWGs%s"%pol.upper())
if pol == 'te':
t = pya.Trans(pya.Trans.R0, 40 * dbu, 12 * dbu)
else:
# t = pya.Trans(pya.Trans.R180, 560 * dbu, 393 * dbu)
t = pya.Trans(pya.Trans.M90, 560 * dbu, 393 * dbu)
# place "cell" in the top cell
top_cell.insert(pya.CellInstArray(cell.cell_index(), t))


# Import cells from the SiEPIC GDS Library, and instantiate them

# Grating couplers, Ports 1, 2, 3, 4 (top-down):
GC_imported = ly.create_cell("ebeam_gc_%s1550" % pol, "SiEPIC-EBeam").cell_index()
print ("Cell: GC_imported: #%s" % GC_imported)
gc_length = 41

if pol == 'te':
wg_bend_radius = 5
wgL0 = 7.418036E3
else:
wg_bend_radius = 15
wgL0 = 10.000031E3

x = 0
for i in range(len(sweep_wgL)):

# place layout at location:
wgL = sweep_wgL[i]

t = pya.Trans(pya.Trans.R0, x*dbu, 0)
cell.insert(pya.CellInstArray(GC_imported, t, pya.Point(0,127*dbu), pya.Point(0,0), 2, 1))

wg_width = 0.5
wg_sp = 2.5 # space between waveguides
wg_loops = 12

# Create paths for waveguides

points = [[0,0]]
points.append([0,-wg_bend_radius*2-wg_sp])
points.append([-wg_bend_radius*2,-wg_bend_radius*2-wg_sp])
points.append([-wg_bend_radius*2,-wg_sp])
points.append([-wg_bend_radius*4-wgL,-wg_sp])
points.insert(0,[-wg_bend_radius*4-wgL-wg_sp,0])

for k in range(wg_loops):
extra=k*wg_sp*2
# down:
points.append([-wg_bend_radius*4-wgL-extra,-wg_bend_radius*2-wg_sp*2-extra])
points.insert(0,[-wg_bend_radius*4-wgL-wg_sp-extra,-wg_bend_radius*2-wg_sp*3-extra])
# right:
points.append([wg_sp+extra,-wg_bend_radius*2-wg_sp*2-extra])
points.insert(0,[wg_sp*2+extra,-wg_bend_radius*2-wg_sp*3-extra])
# up:
points.append([wg_sp+extra,wg_sp*1+extra])
points.insert(0,[wg_sp*2+extra,wg_sp*2+extra])
# left:
points.append([-wg_bend_radius*4-wgL-wg_sp*2-extra,wg_sp*1+extra])
points.insert(0,[-wg_bend_radius*4-wgL-wg_sp*3-extra,wg_sp*2+extra])

# to GCs:
points.pop(0)
points.append([-wg_bend_radius*4-wgL-wg_sp*2-extra,wg_sp*2+extra-127])
points.append([-wg_bend_radius*5-wgL-wg_sp*2-extra,wg_sp*2+extra-127])
points.insert(0,[-wg_bend_radius*5-wgL-wg_sp*2-extra,wg_sp*2+extra])

start_point = [x-(-wg_bend_radius*5-wgL-wg_sp*2-extra),-(wg_sp*2+extra)+127]
layout_waveguide_rel(cell, LayerSi, start_point, points, wg_width, wg_bend_radius)


# Label for automated measurements, laser on Port 2, detectors on Ports 1, 3, 4
wg_length = wgL0 + wg_loops * 4 * wgL
t = pya.Trans(x*dbu, 127*1*dbu)
text = pya.Text ("opt_in_%s_1550_PCM_PCM_StraightWGloss%s%s" % (pol.upper(), int(wg_length), pol.upper()), t)
shape = cell.shapes(TextLayerN).insert(text)
shape.text_size = 3*dbu


# next device placement:
x = x + x_offset - (-wg_bend_radius*5-wgL-wg_sp*2-extra) + wg_sp+extra

pcell = ly.create_cell("LumericalINTERCONNECT_Detector", "SiEPIC", { "number": 1 } )
t = pya.Trans(pya.Trans.R0, -20*dbu, 127*0 * dbu)
instance = cell.insert(pya.CellInstArray(pcell.cell_index(), t))

pcell = ly.create_cell("LumericalINTERCONNECT_Laser", "SiEPIC", { "npoints": 5000 } )
t = pya.Trans(pya.Trans.R0, -20*dbu, 127*1 * dbu)
instance = cell.insert(pya.CellInstArray(pcell.cell_index(), t))

print ("done layout...")
</text>
</klayout-macro>
1 change: 0 additions & 1 deletion klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ class waveguide_bump(pya.PCellDeclarationHelper):
LayerTextN = ly.layer(LayerText)


# draw spiral
from math import pi, cos, sin, log, sqrt

x = 0
Expand Down

0 comments on commit b87ce75

Please sign in to comment.