Skip to content

Commit

Permalink
CML update for TM (disconnected, taper)
Browse files Browse the repository at this point in the history
Former-commit-id: 08b02b4
  • Loading branch information
lukasc-ubc committed Apr 21, 2016
1 parent 7b1149e commit ea096db
Show file tree
Hide file tree
Showing 15 changed files with 102 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
061515fbb2c1bb93d11088f2c871d25ff7043c5d
9acd87f027b77670e2c37589428c453faa4a457c
Binary file modified Lumerical_EBeam_CML/ebeam_v1.2/ebeam_disconnected_tm1550.ice
Binary file not shown.
Binary file modified Lumerical_EBeam_CML/ebeam_v1.2/ebeam_terminator_tm1550.ice
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
('port 1','TE',1,'port 1',1,'transmission')
('port 1','TM',1,'port 1',1,'transmission')
(101,3)
1.81692e+14 0.190171 1.74605
1.81943e+14 0.190676 1.75695
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
('port 1','TE',1,'port 1',1,'transmission')
('port 1','TM',1,'port 1',1,'transmission')
(101,3)
1.81692e+14 0.0338205 -2.07637
1.81943e+14 0.029838 -1.84411
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6ccc61b81accbd732eb0258e1615c7c1c4ce8d4c
98 changes: 98 additions & 0 deletions klayout_dot_config/pymacros/SiEPIC_EBeam_functions.lym
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,104 @@ def find_optical_IO_pins(optical_pins):
return pins_text



def generate_short_Spice_file(topcell, optical_waveguides, optical_components):
# variant of generate_Spice_file
# - only return components that are connected to the laser.

# list all Optical_component objects from an array
# input array, optical_components
# example output:
# X_grating_coupler_1 N$7 N$6 grating_coupler library="custom/genericcml" sch_x=-1.42 sch_y=-0.265 sch_r=0 sch_f=false

text = '* Spice output from KLayout SiEPIC_EBeam_PDK v%s, %s.\n\n' % (SiEPIC_Version, strftime("%Y-%m-%d %H:%M:%S") )


Lumerical_schematic_scaling = 5e-2
# Lumerical_schematic_scaling = 20e-2

# convert KLayout GDS rotation/flip to Lumerical INTERCONNECT
# KLayout defines mirror as an x-axis flip, whereas INTERCONNECT does y-axis flip
# KLayout defines rotation as counter-clockwise, whereas INTERCONNECT does clockwise
# input is KLayout Rotation,Flip; output is INTERCONNECT:
KLayoutInterconnectRotFlip = \
{(0, False):[0, False], \
(90, False):[270, False], \
(180, False):[180, False], \
(270, False):[90, False], \
(0, True):[180,True], \
(90, True):[90, True], \
(180, True):[0,True], \
(270, True):[270, False]}

from time import strftime


# Get information about the laser and detectors:
laser_net, detector_nets, wavelength_start, wavelength_stop, wavelength_points = \
get_LumericalINTERCONNECT_analyzers(topcell, optical_pins)
if laser_net > -1:
pass


# example of finding a component connected to optical_components(i)
# from pin j:
i,j=1,0
component1_index = optical_components[i].idx
pin1_index = optical_components[i].pins[j]
net_index = optical_pins[pin1_index].net
net_component1 = optical_nets[net_index].pin1_n
net_component2 = optical_nets[net_index].pin2_n
if net_component1 != component1_index & net_component2 == component1_index:
component2_index = net_component1_index
if net_component2 != component1_index & net_component1 == component1_index:
component2_index = net_component2_index


text += '* Optical Network Analyzer:\n'
text += '.ona input_unit=wavelength input_parameter=start_and_stop\n + minimum_loss=80\n + analysis_type=scattering_data\n + multithreading=user_defined number_of_threads=1\n'
text += ' + start=%4.3fe-9\n' % wavelength_start
text += ' + stop=%4.3fe-9\n' % wavelength_stop
text += ' + number_of_points=%s\n' % wavelength_points
for i in range(0,len(detector_nets)):
text += ' + input(%s)=%s,N$%s\n' % (i+1, topcell.name, detector_nets[i])
text += ' + output=%s,N$%s\n' % (topcell.name, laser_net)

# main circuit
text += '%s%s %s sch_x=-1 sch_y=-1\n\n' % (topcell.name, opticalIO_pins, topcell.name)

return text, len(detector_nets)

def connected_component(i,j):
# find a component connected to optical_components(i) from pin j:

# find all connected components and waveguides, starting at component i
# need to make a graph containing only components and their connections.
# our SiEPIC data structures has components & waveguides, which need to be merged.
# offset the waveguide indexes by 1e6 to ensure unique index values

component1_index = optical_components[i].idx
print ("component1_index: %s" % component1_index)
print ("component1's nets: %s" % optical_components[i].nets)
pin1_index = optical_components[i].pins[j]
if optical_pins[pin1_index].pin_type == 2:
print ("pin is an OpticalIO; stopping.")
else:
net_index = optical_pins[pin1_index].net
print ("net: %s" % net_index)

net_component1 = optical_nets[net_index].pin1_n
print ("net's pin1 component: %s" % net_component1)
net_component2 = optical_nets[net_index].pin2_n
print ("net's pin2 component: %s" % net_component2)
if net_component1 != component1_index & net_component2 == component1_index:
component2_index = net_component1_index
print component2_index
if net_component2 != component1_index & net_component1 == component1_index:
component2_index = net_component2_index
print component1_index


def generate_Spice_file(topcell, optical_waveguides, optical_components):
# list all Optical_component objects from an array
# input array, optical_components
Expand Down

0 comments on commit ea096db

Please sign in to comment.