Skip to content

Commit

Permalink
Lumerical INTERCONNECT integration
Browse files Browse the repository at this point in the history
Former-commit-id: 3740617
  • Loading branch information
lukasc-ubc committed Nov 20, 2015
1 parent f2218f5 commit 17f1809
Show file tree
Hide file tree
Showing 17 changed files with 3,585 additions and 1,325 deletions.
Binary file modified EBeam_LukasChrostowski_E_LVS.gds
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2570b387f92ce55e4214e823786dfbca66974790
Binary file modified SiEPIC_EBeam_PDK_Verification_Check.gds
Binary file not shown.
Binary file modified Spice/MZI.gds
Binary file not shown.
Binary file modified Spice/MZI.ich
Binary file not shown.
Binary file modified Spice/MZI.icp
Binary file not shown.
4,006 changes: 3,003 additions & 1,003 deletions Spice/MZI/ONA_1.csv

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions Spice/MZI2.spi
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
* EBeam Silicon photonic circuit
*

.subckt Simple_MZI N$0 N$1
ebeam_gc_te1550_0 N$0 N$2 ebeam_gc_te1550 library="Design kits/ebeam_v1.0" sch_x=150.0e-3 sch_y=700.0e-3
ebeam_gc_te1550_1 N$1 N$3 ebeam_gc_te1550 library="Design kits/ebeam_v1.0" sch_x=150.0e-3 sch_y=7.05
ebeam_y_1550_2 N$4 N$5 N$6 ebeam_y_1550 library="Design kits/ebeam_v1.0" sch_x=2.0 sch_y=6.2
ebeam_y_1550_3 N$7 N$8 N$9 ebeam_y_1550 library="Design kits/ebeam_v1.0" sch_x=2.0 sch_y=1.45
wg0 N$3 N$4 ebeam_wg_strip_1550 library="Design kits/ebeam_v1.0" wg_length=54.1e-6 wg_width=500.0e-9 sch_x=1.11625 sch_y=6.625
wg1 N$6 N$8 ebeam_wg_strip_1550 library="Design kits/ebeam_v1.0" wg_length=133.5e-6 wg_width=500.0e-9 sch_x=3.3 sch_y=3.825
wg2 N$9 N$5 ebeam_wg_strip_1550 library="Design kits/ebeam_v1.0" wg_length=154.5e-6 wg_width=500.0e-9 sch_x=3.425 sch_y=3.825
wg3 N$7 N$2 ebeam_wg_strip_1550 library="Design kits/ebeam_v1.0" wg_length=52.1e-6 wg_width=500.0e-9 sch_x=916.25e-3 sch_y=1.075
.ends Simple_MZI

* - ONA
.ona input_unit=wavelength input_parameter=start_and_stop start=1500e-9
+ stop=1600e-9 number_of_points=3000
+ minimum_loss=50
+ sensitivity=-200
+ analysis_type=scattering_data
+ multithreading=user_defined number_of_threads=1
+ input(1)=Simple_MZI,N$0
+ output=Simple_MZI,N$1

Simple_MZI N$0 N$1 Simple_MZI sch_x=-1 sch_y=-1

.end
Binary file added Spice/MZI_adiabatic.gds
Binary file not shown.
Binary file removed Spice/untitled.ich
Binary file not shown.
Binary file modified klayout_dot_config/libraries/SiEPIC-EBeam.gds
Binary file not shown.
97 changes: 90 additions & 7 deletions klayout_dot_config/pymacros/INTERCONNECT.lym
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,23 @@
<menu-path/>
<interpreter>python</interpreter>
<dsl-interpreter-name/>
<text>import pya
<text># Python script
# SiEPIC_EBeam_functions

# Enter your Python code here ..
"""
This file is part of the SiEPIC_EBeam_PDK
by Lukas Chrostowski (c) 2015

# Launch Lumerical INTERCONNECT
This Python file extract the circuit netlist from the physical layout, saves it to Spice file,
and launches Lumerical INTERCONNECT for circuit simulations.

Version history:

Lukas Chrostowski 2015/11/19
- initial version
- generating a Spice netlist including Optical Network Analyzer; launch Lumerical INTERCONNECT simulation

"""

import os
print os.name
Expand All @@ -31,9 +42,82 @@ print platform.release()
import sys
version = sys.version


import string


def netlist_extraction(topcell):
# Collection of functions to extract the circuit netlist from the physical layout

# Search the layout for the components and waveguides:
print ("")
print ("* calling find_all_components() – DevRec:")
find_all_components(topcell, LayerDevRecN, LayerPinRecN, LayerFbrTgtN)
print ("")
print ("* calling find_all_waveguides():")
find_all_waveguides(topcell, LayerSiN)

print ("")
print ("* print_Optical_all, after find_all_{components, waveguides}:")
print_Optical_all(optical_components, optical_waveguides, optical_pins, optical_nets)

# Search the arrays to identify all the nets:
print ("")
print ("* calling identify_all_nets():")
identify_all_nets(optical_pins, optical_waveguides, optical_components)

return optical_waveguides, optical_components




# find the currently selected cell:
topcell = pya.Application.instance().main_window().current_view().active_cellview().cell
if topcell == None:
raise Exception("No cell")
layout = topcell.layout()
dbu = layout.dbu

# initialize the arrays to keep track of layout objects
optical_components = []
optical_waveguides = []
optical_pins = []
optical_nets = []

# Define layers based on the PDK:
LayerSiN = layout.layer(LayerSi)
LayerTextN = layout.layer(LayerText)
LayerPinRecN = layout.layer(LayerPinRec)
LayerDevRecN = layout.layer(LayerDevRec)
LayerFbrTgtN = layout.layer(LayerFbrTgt)
LayerErrorN = layout.layer(LayerError)
LayerINTERCONNECTN = layout.layer(LayerINTERCONNECT)


# extract the circuit netlist from the physical layout:
optical_waveguides, optical_components = netlist_extraction(topcell)

# Output the Spice netlist:
text_Spice = generate_Spice_file(topcell, optical_waveguides, optical_components)
print text_Spice

filename = '/tmp/%s.spi' % topcell.name
file = open(filename, 'w')
file.write (text_Spice)
file.close()


filename2 = '/tmp/%s.lsf' % topcell.name
file = open(filename2, 'w')
text_lsf = 'switchtolayout;\n'
text_lsf += 'deleteall;\n'
text_lsf += 'importnetlist("%s");\n' % filename
text_lsf += 'run;\n'
text_lsf += 't1 = getresult("ONA_1", "input 1/mode 1/gain");\n'
text_lsf += 'visualize(t1);\n'
file.write (text_lsf)
file.close()


if sys.platform.startswith('freebsd'):
# FreeBSD-specific code here...
pass
Expand All @@ -49,9 +133,8 @@ elif sys.platform.startswith('darwin'):
if string.find(version,"2.7.") &gt; -1:
import commands
print ("Running INTERCONNECT")
# commands.getstatusoutput('open /Applications/Lumerical/INTERCONNECT/INTERCONNECT.app --args -run /Users/lukasc/SiEPIC_EBeam_PDK/Spice/test.lsf')
commands.getstatusoutput('open /Applications/Lumerical/INTERCONNECT/INTERCONNECT.app --args /Users/lukasc/SiEPIC_EBeam_PDK/Spice/MZI.spi')

# commands.getstatusoutput('open /Applications/Lumerical/INTERCONNECT/INTERCONNECT.app --args %s' % filename)
commands.getstatusoutput('open /Applications/Lumerical/INTERCONNECT/INTERCONNECT.app --args -run %s' % filename2)

</text>
</klayout-macro>
12 changes: 6 additions & 6 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_PCells.lym
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ class LumericalINTERCONNECT_Laser(pya.PCellDeclarationHelper):
height = 40/dbu
box1 = pya.Box(-width/2, -height/2, width/2, height/2)
self.cell.shapes(LayerINTERCONNECTN).insert(box1)
shrink = 1000
box1 = pya.Box(-width/2+shrink, -height/2+shrink, width/2-shrink, height/2-shrink)
self.cell.shapes(LayerINTERCONNECTN).insert(box1)
# shrink = 1000
# box1 = pya.Box(-width/2+shrink, -height/2+shrink, width/2-shrink, height/2-shrink)
# self.cell.shapes(LayerINTERCONNECTN).insert(box1)

t = pya.Trans(-width/2+3/dbu, height/2-4/dbu)
text = pya.Text ("Tunable Laser", t)
Expand Down Expand Up @@ -259,9 +259,9 @@ class LumericalINTERCONNECT_Detector(pya.PCellDeclarationHelper):
height = 40/dbu
box1 = pya.Box(-width/2, -height/2, width/2, height/2)
self.cell.shapes(LayerINTERCONNECTN).insert(box1)
shrink = 1000
box1 = pya.Box(-width/2+shrink, -height/2+shrink, width/2-shrink, height/2-shrink)
self.cell.shapes(LayerINTERCONNECTN).insert(box1)
# shrink = 1000
# box1 = pya.Box(-width/2+shrink, -height/2+shrink, width/2-shrink, height/2-shrink)
# self.cell.shapes(LayerINTERCONNECTN).insert(box1)

t = pya.Trans(-width/2+3/dbu, height/2-4/dbu)
text = pya.Text ("Detector", t)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ for o in object_selection:
# new_selection[new_selectionN].cell_index = pcell.cell_index()
# new_selection[new_selectionN].cell_index = new_cell
new_selection[new_selectionN].top = o.top
print o.top
print (o.top)
new_selection[new_selectionN].append_path = pya.InstElement.new(new_cell)
print (new_selection[new_selectionN].is_cell_inst() )
# op.append_path(RBA::InstElement::new(inst_to_select))
Expand Down
Loading

0 comments on commit 17f1809

Please sign in to comment.