diff --git a/PCM/EBL_Framework_1cm_PCM.gds.REMOVED.git-id b/PCM/EBL_Framework_1cm_PCM.gds.REMOVED.git-id index f48f3a5e..e3526ae4 100644 --- a/PCM/EBL_Framework_1cm_PCM.gds.REMOVED.git-id +++ b/PCM/EBL_Framework_1cm_PCM.gds.REMOVED.git-id @@ -1 +1 @@ -f666b8613e81208b4a16ac66a3c8994442007d6c \ No newline at end of file +b43ff2de2068db57552140e24b826cb7c1aebe6c \ No newline at end of file diff --git a/klayout_dot_config/pymacros/Layout_StraightWG_delayline.lym b/klayout_dot_config/pymacros/Layout_StraightWG_delayline.lym new file mode 100644 index 00000000..9296975e --- /dev/null +++ b/klayout_dot_config/pymacros/Layout_StraightWG_delayline.lym @@ -0,0 +1,175 @@ + + + + + pymacros + + + + false + false + + false + + + python + + # 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...") + + diff --git a/klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym b/klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym index 62a08f02..a6c9c23f 100644 --- a/klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym +++ b/klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym @@ -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