Пример #1
0
        def _generate_instances(self, insts):
            # Generates taper pairs

            tp_name_list = []

            for ii in range(self.n_pairs):
                # for each pair

                # draw taper pair layout
                tp_lay = TaperPair(name=self.name + '_tp' +
                                   str(ii)).get_default_view(i3.LayoutView)
                tp_lay.set(taper_prop_dict=self.taper_prop_dict,
                           connect_length=self.connect_length)

                # set name
                tp_name = 'tp' + str(ii)
                tp_name_list.append(tp_name)

                # set transformation
                if ii > 0:

                    # set transform
                    t = i3.vector_match_transform(  tp_lay.ports['left'],
                                                    insts[ tp_name_list[ii - 1] ].ports['right']) \
                                                    + i3.Translation( ( self.pair_connect_length, 0.0 ) )

                    # print t

                    # draw next taper pair
                    insts += i3.SRef(name=tp_name,
                                     reference=tp_lay,
                                     transformation=t)

                    # route wg
                    route_wg = i3.RouteManhattan(
                        input_port=insts[tp_name_list[ii - 1]].ports['right'],
                        output_port=insts[tp_name_list[ii]].ports['left'])

                    # # make my OWN custom waveguide trace template
                    # wg_trace = f_MyIMECWaveguideTemplate( core_width = self.taper_prop_dict['width1'],
                    #                                       cladding_width = self.taper_prop_dict['width1'] + 2.0*self.taper_prop_dict['width_etch'] )

                    # make waveguide
                    wg = i3.Waveguide(trace_template=StripWgTemplate(),
                                      name=self.name + '_WG' + str(ii))

                    # add wg
                    insts += i3.SRef(name=self.name + 'connect_wg' + str(ii),
                                     reference=wg.Layout(shape=route_wg))

                else:
                    # draw first taper pair
                    insts += i3.SRef(name=tp_name, reference=tp_lay)

                    # DEBUG
                    # print insts

                # end if else

            return insts
	def _default_vline(self):
		rect=i3.Waveguide(trace_template=self.tt_cross)
		layout_rect = rect.Layout(shape=[(self.size/2.0, 0.0),(self.size/2.0,self.size)])
		print 'The trace template of the vline of the cross ', rect.trace_template 
		                          
			
		return rect  
Пример #3
0
 def _default_bend(self):
     if self.bend_type is "default":
         bend = i3.Waveguide(name=self.name + "_Bend",
                             trace_template=self.wg_temp)
     else:
         from Custom_Waveguide import CustomWaveguide
         bend = CustomWaveguide(name=self.name + "_Bend")
     return bend
	def _default_Grating_list(self):
		Grating_list = [] 
		for x in range(0,int(len(self.Lo))):
			#rect=i3.Waveguide(trace_template=self.wg_coupler)
			rect=i3.Waveguide(trace_template=self.coupler_template)
			
			#layout_rect = rect.Layout(shape=[(0.0, 0.0),(self.Lo[x],0.0)])#.visualize(annotate=True)
			layout_rect = rect.Layout(shape=[(0.0, 0.0),(self.Lo[x],0.0)])#.visualize(annotate=True)
			                          
		 		
			Grating_list.append(rect)
		return Grating_list
Пример #5
0
        def _generate_instances(self, insts):
            # generates taper pair

            # generate left taper cell
            taper_layout_left = ParabolicTaper(
                name=self.name + '_TAPER_L').get_default_view(i3.LayoutView)
            taper_layout_left.set(
                length=self.taper_prop_dict['length'],
                width1=self.taper_prop_dict['width1'],
                width2=self.taper_prop_dict['width2'],
                width_etch=self.taper_prop_dict['width_etch'])

            # generate right taper cell
            taper_layout_right = ParabolicTaper(
                name=self.name + '_TAPER_R').get_default_view(i3.LayoutView)
            taper_layout_right.set(
                length=self.taper_prop_dict['length'],
                width1=self.taper_prop_dict['width1'],
                width2=self.taper_prop_dict['width2'],
                width_etch=self.taper_prop_dict['width_etch'])

            # draw taper pairs
            insts += i3.SRef(name=self.name + '_taper1',
                             reference=taper_layout_left)
            t = i3.vector_match_transform(taper_layout_left.ports['right'],
                                          taper_layout_right.ports['right'],
                                          mirrored=True) + i3.Translation(
                                              (self.connect_length, 0.0))
            insts += i3.SRef(name=self.name + '_taper2',
                             reference=taper_layout_right,
                             transformation=t)

            # route between tapers
            if self.connect_length > 0.0:
                route_tapers = i3.RouteManhattan(
                    input_port=insts[self.name + '_taper1'].ports['right'],
                    output_port=insts[self.name + '_taper2'].ports['right'])

                # # make my OWN custom waveguide trace template
                # wg_trace = f_MyIMECWaveguideTemplate( core_width = taper_layout_left.width2,
                #                                       cladding_width = taper_layout_right.width2 + 2.0*taper_layout_right.width_etch )
                # wg_lay = i3.Waveguide(trace_template=StripWgTemplate(), name=wg_name).get_default_view(i3.LayoutView)

                # make waveguide
                wg = i3.Waveguide(trace_template=StripWgTemplate(),
                                  name=self.name + '_WG')

                # add wg
                insts += i3.SRef(name=self.name + 'connect_wg',
                                 reference=wg.Layout(shape=route_tapers))
            # end if self.connect_length > 0.0

            return insts
Пример #6
0
def smooth_wav(start_port,
               end_port,
               name=None,
               way_points=[],
               distance_straight=10.0,
               connector_kwargs={}):
    tt = get_template(start_port, end_port)
    shape = get_waveguide_shape(start_port=start_port,
                                end_port=end_port,
                                way_points=way_points,
                                distance_straight=distance_straight)
    cell = i3.Waveguide(name=name, trace_template=tt)
    cell.Layout(shape=shape)
    return cell
Пример #7
0
def FBMSwaveguide(w_core, l_core, w_ebeam=4):
    # w_core [int] -> waveguide width
    # l_core [int] -> waveguide length
    # w_ebeam [int] -> ebeam beam width

    w_core = w_core + w_ebeam
    w_clad = w_core + 2 * w_ebeam
    wgt = WireWaveguideTemplate()
    wgt.Layout(core_width=w_core, cladding_width=w_clad)
    # wg = wgt()
    wg = i3.Waveguide(trace_template=wgt)
    wg.Layout(shape=[(0, 0), (l_core, 0)])

    return (wgt, wg)
Пример #8
0
    def _default_rectV_list(self):
        print '____________ MMI 2x2 ______________'
        MMI22_list2 = []
        for l in range(0, 5, 1):

            # cell = i3.Waveguide(name="rectH{}".format(str(l)),
            #                    trace_template=self.wg_t2)
            # cell.Layout(shape=[(0.0, 0.0), (18000-4000*l, 0.0)])
            cell = i3.Waveguide(name="rectV{}_{}".format(
                str(l), str(self.offset)),
                                trace_template=self.wg_t2)
            cell.Layout(shape=[(0.0, 0.0), (0.0, -1000 - 4000 * l)])

            MMI22_list2.append(cell)

        return MMI22_list2
Пример #9
0
def sbend_fixed_length_delta(start_port,
                             end_port,
                             initial_straight=20.0,
                             length_delta=0.0,
                             max_error=1e-2,
                             connector_kwargs={},
                             name="Waveguide"):
    i_wp = get_waypoints(start_port, end_port, initial_straight)
    length = get_waveguide_shape(start_port=start_port,
                                 end_port=end_port,
                                 way_points=i_wp,
                                 distance_straight=0.0).length() + length_delta

    def to_minimize(straight):
        way_points = get_waypoints(start_port, end_port, straight)

        shape = get_waveguide_shape(start_port=start_port,
                                    end_port=end_port,
                                    way_points=way_points,
                                    distance_straight=0.0)

        trace_length = shape.length()
        #print shape.length()

        return np.abs(trace_length - length)

    res = minimize(to_minimize,
                   x0=initial_straight,
                   method='nelder-mead',
                   options={
                       'xtol': max_error,
                       'disp': False
                   })
    waypoints_final = get_waypoints(start_port, end_port, res.x[0])
    shape_final = get_waveguide_shape(start_port=start_port,
                                      end_port=end_port,
                                      way_points=waypoints_final,
                                      distance_straight=0.0)

    from routing.routing_functions import get_template
    tt = get_template(start_port, end_port)
    wav = i3.Waveguide(name=name, trace_template=tt)
    wav.Layout(shape=shape_final)
    return wav
Пример #10
0
field_Ebeamx = 500
field_Ebeamy = 25 + 0 * 50
wg_length = 500  #real length is wg_length+100
overlap_wg = 0

taper_length = 200

my_taperG_lay = my_taperG.Layout(start_position=(0.0, 0.0),
                                 end_position=(taper_length, 0.0))

my_taperG_lay.visualize()

#FBMS waveguide

wg_left = i3.Waveguide(name="my_wire_t3", trace_template=WG_T2FBMS)
layout = wg_left.Layout(shape=[(field_Ebeamx / 2 + taper_length +
                                socket_lentgh_def, field_Ebeamy),
                               (field_Ebeamx / 2 + taper_length + overlap_wg +
                                socket_lentgh_def + wg_length / 2,
                                field_Ebeamy)])

wg_rigth = i3.Waveguide(name="my_wire_t4", trace_template=WG_T2FBMS)
layout = wg_rigth.Layout(
    shape=[(-taper_length + field_Ebeamx / 2 + field_Ebeamx - overlap_wg +
            wg_length - socket_lentgh_def - wg_length / 2, field_Ebeamy),
           (-taper_length + field_Ebeamx / 2 + field_Ebeamx + wg_length -
            socket_lentgh_def, field_Ebeamy)])

from picazzo3.routing.place_route import PlaceAndAutoRoute
        def _generate_instances(self, insts):
            # Generates taper pairs w edge couplers

            # load the aim gds just to get its positions and stuff
            # main chip GDS
            fname = '../PDK_Library_Layout_GDS/ap_suny_v20a_chipframe.gds'
            main_chip_gds_cell = i3.GDSCell(filename=fname)

            # grab layout size info
            main_chip_gds_lay = main_chip_gds_cell.Layout()
            main_chip_gds_lay_size_info = main_chip_gds_lay.size_info()

            # grab relevant positions
            chip_edge_east = main_chip_gds_lay_size_info.east
            chip_edge_west = main_chip_gds_lay_size_info.west

            # make edge coupler
            edge_coupler_gds_lay = EdgeCoupler(name=self.name +
                                               'edge_coupler_sffdfi').Layout()

            # add and route input/west edgecoupler
            # position edge coupler on west side of chip
            chip_port_west = i3.OpticalPort(position=(chip_edge_west, 0.0),
                                            angle_deg=0.0)
            edge_coupler_west_port = edge_coupler_gds_lay.ports['out']
            t = i3.vector_match_transform(edge_coupler_west_port,
                                          chip_port_west)
            edge_coupler_west_name = self.name + '_EDGE_COUPLER_WEST'
            west_edge_coupler = i3.SRef(name=edge_coupler_west_name,
                                        reference=edge_coupler_gds_lay,
                                        transformation=t,
                                        flatten=False)

            # add a small linear taper to go from 0.4 to 0.5um wg
            lin_taper_lay = LinearTaper().get_default_view(i3.LayoutView)
            lin_taper_lay.set(wg_width_in=0.4, wg_width_out=0.5, length=10.0)
            t = i3.vector_match_transform(lin_taper_lay.ports['in'],
                                          west_edge_coupler.ports['in'])
            lin_taper_lay_name = self.name + '_EDGETAPER_WEST'
            insts += i3.SRef(name=lin_taper_lay_name,
                             reference=lin_taper_lay,
                             transformation=t,
                             flatten=True)

            # route wg to wg with arc
            bend_radius = 10.0
            arc_center_1 = (
                insts[lin_taper_lay_name].ports['out'].position[0],
                insts[lin_taper_lay_name].ports['out'].position[1] +
                bend_radius)
            route_wg_shape_arc1 = i3.ShapeArc(radius=bend_radius,
                                              angle_step=1.0,
                                              center=arc_center_1,
                                              start_angle=269.5,
                                              end_angle=0.5,
                                              closed=False,
                                              clockwise=False)
            wg_name_arc1 = self.name + '_ARC1'
            wg_lay_arc1 = i3.Waveguide(trace_template=StripWgTemplate(),
                                       name=wg_name_arc1).get_default_view(
                                           i3.LayoutView)
            wg_lay_arc1.set(shape=route_wg_shape_arc1)
            insts += i3.SRef(name=wg_name_arc1,
                             reference=wg_lay_arc1,
                             flatten=True)

            # add the bends
            bend_clip_lay = BendClip(
                name=self.name + '_BEND_CLIP').get_default_view(i3.LayoutView)
            bend_clip_lay.set(n_pairs=self.n_pairs)

            # add to insts
            bend_clip_lay_name = self.name + '_BEND_CLIP'
            t = i3.vector_match_transform(bend_clip_lay.ports['in'],
                                          insts[wg_name_arc1].ports['out'])
            insts += i3.SRef(name=bend_clip_lay_name,
                             reference=bend_clip_lay,
                             transformation=t,
                             flatten=True)

            # add output bend
            arc_center_2 = (
                insts[bend_clip_lay_name].ports['out'].position[0] +
                bend_radius,
                insts[bend_clip_lay_name].ports['out'].position[1])
            route_wg_shape_arc2 = i3.ShapeArc(radius=bend_radius,
                                              angle_step=1.0,
                                              center=arc_center_2,
                                              start_angle=180.5,
                                              end_angle=89.5,
                                              closed=False,
                                              clockwise=True)
            wg_name_arc2 = self.name + '_ARC2'
            wg_lay_arc2 = i3.Waveguide(trace_template=StripWgTemplate(),
                                       name=wg_name_arc2).get_default_view(
                                           i3.LayoutView)
            wg_lay_arc2.set(shape=route_wg_shape_arc2)
            insts += i3.SRef(name=wg_name_arc2,
                             reference=wg_lay_arc2,
                             flatten=True)

            # add east coupler
            chip_port_east = i3.OpticalPort(
                position=(chip_edge_east,
                          insts[wg_name_arc2].ports['out'].position[1]),
                angle_deg=180.0)
            edge_coupler_east_port = edge_coupler_gds_lay.ports['out']
            t = i3.vector_match_transform(edge_coupler_east_port,
                                          chip_port_east,
                                          mirrored=True)
            edge_coupler_east_name = self.name + '_EDGE_COUPLER_EAST'
            east_edge_coupler = i3.SRef(name=edge_coupler_east_name,
                                        reference=edge_coupler_gds_lay,
                                        transformation=t,
                                        flatten=False)

            # add a small linear taper to go from 0.4 to 0.5um wg
            lin_taper_lay = LinearTaper().get_default_view(i3.LayoutView)
            lin_taper_lay.set(wg_width_in=0.4, wg_width_out=0.5, length=10.0)
            t = i3.vector_match_transform(lin_taper_lay.ports['in'],
                                          east_edge_coupler.ports['in'],
                                          mirrored=True)
            lin_taper_lay_name = self.name + '_EDGETAPER_EAST'
            insts += i3.SRef(name=lin_taper_lay_name,
                             reference=lin_taper_lay,
                             transformation=t,
                             flatten=True)

            # route arc to arc with straight section
            route_wg_shape_out = i3.Shape([
                insts[wg_name_arc2].ports['out'].position,
                insts[lin_taper_lay_name].ports['out'].position
            ])
            wg_name_out = self.name + '_WG_CON_OUT'
            wg_lay_out = i3.Waveguide(trace_template=StripWgTemplate(),
                                      name=wg_name_out).get_default_view(
                                          i3.LayoutView)
            wg_lay_out.set(shape=route_wg_shape_out)
            insts += i3.SRef(name=wg_name_out,
                             reference=wg_lay_out,
                             flatten=True)

            return insts
Пример #12
0
 def _default_flyback(self):
     flyback = i3.Waveguide(name=self.name + "_FlybackWg",
                            trace_template=self.wg_temp)
     return flyback
Пример #13
0
	def _default_couplingWG(self):
		rect=i3.Waveguide(trace_template=self.tt_port)
		layout_rect = rect.Layout(shape=[(0.0, 0.0),(self.couplingWG_l,0.0)]
		                          )
		return rect
Пример #14
0
    def _default_WGSM(self):
        WGSM = i3.Waveguide(name="SM", trace_template=self.trace_template)

        return WGSM
Пример #15
0
 def _default_WG1(self):
     WG1 = i3.Waveguide(name="Dongbo", trace_template=self.wg_t1)
     return WG1
Пример #16
0
 def _default_WG1(self):
     WG1 = i3.Waveguide(name="dongbo{}".format(
         str(np.random.randint(0, 10000))),
                        trace_template=self.wg_t1)
     return WG1
Пример #17
0
from picazzo3.routing.place_route import PlaceAndAutoRoute

import ipkiss3.all as i3

# Define Templates

wg_t1 = WireWaveguideTemplate()
wg_t1.Layout(
    core_width=15.0,
    cladding_width=15.0 + 16.0,
)

# Define components

WG1 = i3.Waveguide(trace_template=wg_t1)

layout_WG1 = WG1.Layout(shape=[(0.0, 0.0), (50.0, 0.0)])

pr = PlaceAndAutoRoute(trace_template=wg_t1,
                       child_cells={
                           "WGup": WG1,
                           "WGdown": WG1
                       },
                       links=[
                           ("WGup:in", "WGdown:out"),
                       ])

layout = pr.Layout(child_transformations={
    "WGup": (400, 0),
    "WGdown": (-4000, 0)
Пример #18
0
	def _default_outcouplingWG(self):
		rect=i3.Waveguide(trace_template=self.wg_coupler)
		layout_rect = rect.Layout(shape=[(0.0, 0.0),(50+self.socket_length,0.0)]
	                                  )
		return rect	
from technologies import silicon_photonics
from ipkiss3 import all as i3
from picazzo3.wg.bend import WgBend90
from picazzo3.wg.splitters import WgY90Splitter
from picazzo3.wg.spirals import FixedLengthSpiralRounded
from picazzo3.fibcoup.curved import FiberCouplerCurvedGrating
from picazzo3.wg.connector import RoundedWaveguideConnector

from auto_place_and_connect import AutoPlaceAndConnect
import numpy as np
import pylab as plt

wg50 = i3.Waveguide(name="waveguide50")
wg50.Layout(shape=[(0.0, 0.0), (50.0, 0.0)])
wg100 = i3.Waveguide(name="waveguide100")
wg100.Layout(shape=[(0.0, 0.0), (100.0, 0.0)])

gc = FiberCouplerCurvedGrating(name="gc")

spiral = FixedLengthSpiralRounded(name="spiral1", n_o_loops=2)
spiral.Layout(total_length=800.0)

bend1 = WgBend90(name="bend20")
bend1.Layout(bend_radius=20.0)

bend2 = WgBend90(name="bend10")
bend2.Layout(bend_radius=10.0)

splitter = WgY90Splitter(name="split")

circuit = AutoPlaceAndConnect(name="circuit",
Пример #20
0
 def _default_WG2(self):
     WG2 = i3.Waveguide(name="20", trace_template=self.wg_sm)
     return WG2
Пример #21
0
        def _generate_instances(self, insts):
            # Generates bend pairs

            tp_name_list = []

            # arc path
            fname = '../nathan/bend_data/txbend.txt'
            path_width = np.loadtxt(fname, np.float_)
            arc_path = path_width[:, :2]

            # make a bend woo
            bend_wg_lay = i3.Waveguide(
                name=self.name + "_Bend",
                trace_template=StripWgTemplate()).get_default_view(
                    i3.LayoutView)
            bend_wg_lay.set(shape=arc_path)

            # add to insts
            insts += i3.SRef(name=self.name + '_BEND', reference=bend_wg_lay)

            # list of bend names
            bend_name_A_list = []
            bend_name_B_list = []

            # draw a bunch of bends
            for ii in range(self.n_pairs):

                # make bend A
                if ii == 0:
                    # place first bend pair

                    # make a bend woo
                    bend_name_A = self.name + '_BEND_A' + str(ii)
                    bend_wg_lay_A = i3.Waveguide(
                        trace_template=StripWgTemplate()).get_default_view(
                            i3.LayoutView)
                    bend_wg_lay_A.set(shape=arc_path)

                    # add to insts
                    insts += i3.SRef(name=bend_name_A,
                                     reference=bend_wg_lay_A,
                                     flatten=True)

                else:

                    # make a bend woo
                    bend_name_A = self.name + '_BEND_A' + str(ii)
                    bend_wg_lay_A = i3.Waveguide(
                        trace_template=StripWgTemplate()).get_default_view(
                            i3.LayoutView)
                    bend_wg_lay_A.set(shape=arc_path)

                    # add to insts
                    t = i3.vector_match_transform(
                        bend_wg_lay_A.ports['in'],
                        insts[bend_name_B_list[ii - 1]].ports['out'],
                        mirrored=False)
                    insts += i3.SRef(name=bend_name_A,
                                     reference=bend_wg_lay_A,
                                     transformation=t,
                                     flatten=True)

                # make another bend woo
                bend_name_B = self.name + '_BEND_B' + str(ii)
                bend_wg_lay_B = i3.Waveguide(
                    trace_template=StripWgTemplate()).get_default_view(
                        i3.LayoutView)
                bend_wg_lay_B.set(shape=arc_path)

                # add to insts
                t = i3.vector_match_transform(bend_wg_lay_B.ports['in'],
                                              insts[bend_name_A].ports['out'],
                                              mirrored=True)
                insts += i3.SRef(name=bend_name_B,
                                 reference=bend_wg_lay_B,
                                 transformation=t,
                                 flatten=True)

                # end if else

                # append bend names
                bend_name_A_list.append(bend_name_A)
                bend_name_B_list.append(bend_name_B)

            # end for loop

            return insts
Пример #22
0
 def _default_narrow(self):
     WGnarrow = i3.Waveguide(name="narrow",
                             trace_template=self.trace_template)
     return WGnarrow
Пример #23
0
 def _default_WG1(self):
     WG1 = i3.Waveguide(name="Dongbo{}".format(str(self.start_id + 1)),
                        trace_template=self.wg_t1)
     return WG1
Пример #24
0
        def _generate_instances(self, insts):
            # Generates taper pairs

            tp_name_list = []

            # temporary? pick taper properties
            taper_prop_dict = {
                'length': 79.0,
                'width1': 0.50,
                'width2': 6.50,
                'width_etch': 2.0
            }

            # generate a huge taper row
            tp_rows_layout = TaperPairRow().Layout(
                taper_prop_dict=taper_prop_dict,
                connect_length=0.0,
                pair_connect_length=10.0,
                n_pairs=self.n_pairs)

            # load the aim gds just to get its positions and stuff
            # main chip GDS
            fname = os.path.dirname(
                os.path.realpath(__file__)) + '/gds/ap_suny_v20a_chipframe.gds'
            main_chip_gds_cell = i3.GDSCell(filename=fname)

            # grab layout size info
            main_chip_gds_lay = main_chip_gds_cell.Layout()
            main_chip_gds_lay_size_info = main_chip_gds_lay.size_info()

            # grab relevant positions
            chip_edge_east = main_chip_gds_lay_size_info.east
            chip_edge_west = main_chip_gds_lay_size_info.west

            # make edge coupler and add to layout
            # edge coupler
            edge_coupler_gds_lay = EdgeCoupler(name=self.name +
                                               'edge_coupler_si').Layout()

            # add and route input/west edgecoupler
            # position edge coupler on west side of chip
            chip_port_west = i3.OpticalPort(position=(chip_edge_west, 0.0),
                                            angle_deg=0.0)
            edge_coupler_west_port = edge_coupler_gds_lay.ports['out']
            t = i3.vector_match_transform(edge_coupler_west_port,
                                          chip_port_west)
            edge_coupler_west_name = self.name + '_EDGE_COUPLER_WEST'
            west_edge_coupler = i3.SRef(name=edge_coupler_west_name,
                                        reference=edge_coupler_gds_lay,
                                        transformation=t,
                                        flatten=False)

            # add a small linear taper to go from 0.4 to 0.5um wg
            lin_taper_lay = LinearTaper().get_default_view(i3.LayoutView)
            lin_taper_lay.set(wg_width_in=0.4, wg_width_out=0.5, length=10.0)
            t = i3.vector_match_transform(lin_taper_lay.ports['in'],
                                          west_edge_coupler.ports['in'])
            lin_taper_lay_name = self.name + '_EDGETAPER_WEST'
            insts += i3.SRef(name=lin_taper_lay_name,
                             reference=lin_taper_lay,
                             transformation=t,
                             flatten=True)

            # add taper rows
            taper_row_name = self.name + '_TAPERSSSSSSSS'
            t = i3.vector_match_transform(
                tp_rows_layout.ports['left'],
                insts[lin_taper_lay_name].ports['out'])
            insts += i3.SRef(name=taper_row_name,
                             reference=tp_rows_layout,
                             transformation=t,
                             flatten=True)

            # add east coupler
            chip_port_east = i3.OpticalPort(position=(chip_edge_east, 0.0),
                                            angle_deg=180.0)
            edge_coupler_east_port = edge_coupler_gds_lay.ports['out']
            t = i3.vector_match_transform(edge_coupler_east_port,
                                          chip_port_east,
                                          mirrored=True)
            edge_coupler_east_name = self.name + '_EDGE_COUPLER_EAST'
            east_edge_coupler = i3.SRef(name=edge_coupler_east_name,
                                        reference=edge_coupler_gds_lay,
                                        transformation=t,
                                        flatten=False)

            # add a small linear taper to go from 0.4 to 0.5um wg
            lin_taper_lay = LinearTaper().get_default_view(i3.LayoutView)
            lin_taper_lay.set(wg_width_in=0.4, wg_width_out=0.5, length=10.0)
            t = i3.vector_match_transform(lin_taper_lay.ports['in'],
                                          east_edge_coupler.ports['in'],
                                          mirrored=True)
            lin_taper_lay_name = self.name + '_EDGETAPER_EAST'
            insts += i3.SRef(name=lin_taper_lay_name,
                             reference=lin_taper_lay,
                             transformation=t,
                             flatten=True)

            # route the east coupler to the east edge of the taper pairs
            route_wg_row_taper = i3.Shape([
                insts[taper_row_name].ports['right'].position,
                insts[lin_taper_lay_name].ports['out'].position
            ])
            wg_name = self.name + '_WG'
            wg_lay = i3.Waveguide(trace_template=StripWgTemplate(),
                                  name=wg_name).get_default_view(i3.LayoutView)
            wg_lay.set(shape=route_wg_row_taper)
            insts += i3.SRef(name=wg_name, reference=wg_lay, flatten=True)

            return insts
Пример #25
0
        def _generate_instances(self, insts):
            # Generates taper clip

            # make my OWN custom waveguide trace template
            # wg_trace = f_MyIMECWaveguideTemplate(core_width=self.taper_prop_dict['width1'],
            #                                      cladding_width=self.taper_prop_dict['width1'] + 2.0 * self.taper_prop_dict['width_etch'])

            # make waveguide
            wg = i3.Waveguide(trace_template=StripWgTemplate(),
                              name=self.name + '_WG')
            wg_round = i3.RoundedWaveguide(trace_template=StripWgTemplate(),
                                           name=self.name + '_WG_ROUND')

            # how much to translate bends left/right
            # t_left = i3.Translation((self.bend_radius + (float(self.n_rows)/2.0) ))
            t_left = i3.Translation((-2.5 * self.bend_radius, 0.0))
            t_right = i3.Translation((2.5 * self.bend_radius, 0.0))

            # draw taper pair rows
            for ii in range(self.n_rows):

                # add rows
                tp_rows_layout = TaperPairRow(name=self.name + '_TProw' +
                                              str(ii)).get_default_view(
                                                  i3.LayoutView)
                tp_rows_layout.set(
                    taper_prop_dict=self.taper_prop_dict,
                    connect_length=self.connect_length,
                    pair_connect_length=self.pair_connect_length,
                    n_pairs=self.n_taper_pairs_per_row)

                # set translation
                t = i3.Translation((0.0, float(ii) * self.row_spacing))

                # place taper pair row
                tp_row_name = self.name + '_TP_ROW' + str(ii)
                insts += i3.SRef(name=tp_row_name,
                                 reference=tp_rows_layout,
                                 transformation=t)

                # draw connecting arcs
                if ii > 0:

                    if (ii % 2) == 1:
                        # bend on the right
                        # make shape bend
                        row_name = self.name + '_TP_ROW' + str(ii - 1)
                        shape_bend = i3.ShapeBend(start_point=insts[row_name].
                                                  ports['right'].position,
                                                  radius=self.bend_radius,
                                                  start_angle=-90.05,
                                                  end_angle=90.05,
                                                  angle_step=0.1)

                        # add 180 deg bend
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_arc_r' + str(ii))
                        arc_name = self.name + '_arc' + str(ii)
                        insts += i3.SRef(
                            name=arc_name,
                            reference=wg_copy.Layout(shape=shape_bend),
                            transformation=t_right)

                        # connect bottom wgs

                        # get coords
                        in_port_coords = insts[arc_name].ports['in'].position
                        out_port_coords = insts[row_name].ports[
                            'right'].position

                        # draw bezier curve
                        bez = BezierCurve(
                            N=100,
                            P0=(in_port_coords[0] + 0.01, in_port_coords[1]),
                            P1=(in_port_coords[0] - self.bend_radius / 2.0,
                                in_port_coords[1]),
                            P2=(out_port_coords[0] + self.bend_radius / 2.0,
                                out_port_coords[1]),
                            P3=(out_port_coords[0] - 0.01, out_port_coords[1]),
                            R=(-self.bend_radius, +self.bend_radius),
                            dy_dx=(0.0, -0.0))
                        bez_coords = bez.bezier_coords()

                        # make ipkiss shape
                        s = i3.Shape(bez_coords)

                        # add bottom wg connector
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_arc_r_con' + str(ii))
                        insts += i3.SRef(name=self.name + '_con_wg_r_b_' +
                                         str(ii),
                                         reference=wg_copy.Layout(shape=s))

                        # connect top wgs
                        next_row_name = self.name + '_TP_ROW' + str(ii)
                        in_port_coords = insts[arc_name].ports['out'].position
                        out_port_coords = insts[next_row_name].ports[
                            'right'].position

                        # draw bezier curve
                        bez = BezierCurve(
                            N=500,
                            P0=(in_port_coords[0] + 0.01, in_port_coords[1]),
                            P1=(in_port_coords[0] - self.bend_radius / 2.0,
                                in_port_coords[1]),
                            P2=(out_port_coords[0] + self.bend_radius / 2.0,
                                out_port_coords[1]),
                            P3=(out_port_coords[0] - 0.01, out_port_coords[1]),
                            R=(self.bend_radius, -self.bend_radius),
                            dy_dx=(0.0, -0.0))
                        bez_coords = bez.bezier_coords()

                        # make ipkiss shape
                        s = i3.Shape(bez_coords)

                        # add wg bend
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_bez_r' + str(ii))
                        insts += i3.SRef(name=self.name + '_con_wg_r_t_' +
                                         str(ii),
                                         reference=wg_copy.Layout(shape=s))

                    else:
                        # bend on the left
                        # make shape bend
                        row_name = self.name + '_TP_ROW' + str(ii - 1)
                        shape_bend = i3.ShapeBend(start_point=(
                            insts[row_name].ports['left'].position),
                                                  radius=self.bend_radius,
                                                  start_angle=90.05,
                                                  end_angle=-90.05,
                                                  angle_step=0.1,
                                                  clockwise=False)

                        # add 180 deg bend
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_arc_l' + str(ii))
                        arc_name = self.name + '_arc' + str(ii)
                        insts += i3.SRef(
                            name=arc_name,
                            reference=wg_copy.Layout(shape=shape_bend),
                            transformation=t_left)

                        # connect bottom wgs

                        # get coords
                        in_port_coords = insts[arc_name].ports['out'].position
                        out_port_coords = insts[row_name].ports[
                            'left'].position

                        # draw bezier curve
                        bez = BezierCurve(
                            N=100,
                            P0=(in_port_coords[0] - 0.01, in_port_coords[1]),
                            P1=(in_port_coords[0] + self.bend_radius / 2.0,
                                in_port_coords[1]),
                            P2=(out_port_coords[0] - self.bend_radius / 2.0,
                                out_port_coords[1]),
                            P3=(out_port_coords[0] + 0.01, out_port_coords[1]),
                            R=(-self.bend_radius, +self.bend_radius),
                            dy_dx=(0.0, -0.0))
                        bez_coords = bez.bezier_coords()

                        # make ipkiss shape
                        s = i3.Shape(bez_coords)

                        # add bottom wg connector
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_arc_l_con' + str(ii))
                        insts += i3.SRef(name=self.name + '_con_wg_l_b_' +
                                         str(ii),
                                         reference=wg_copy.Layout(shape=s))

                        # connect top wgs
                        next_row_name = self.name + '_TP_ROW' + str(ii)
                        in_port_coords = insts[arc_name].ports['in'].position
                        out_port_coords = insts[next_row_name].ports[
                            'left'].position

                        # draw bezier curve
                        bez = BezierCurve(
                            N=500,
                            P0=(in_port_coords[0] - 0.01, in_port_coords[1]),
                            P1=(in_port_coords[0] + self.bend_radius / 2.0,
                                in_port_coords[1]),
                            P2=(out_port_coords[0] - self.bend_radius / 2.0,
                                out_port_coords[1]),
                            P3=(out_port_coords[0] + 0.01, out_port_coords[1]),
                            R=(-self.bend_radius, +self.bend_radius),
                            dy_dx=(0.0, -0.0))
                        bez_coords = bez.bezier_coords()

                        # make ipkiss shape
                        s = i3.Shape(bez_coords)

                        # add wg bend
                        wg_copy = i3.Waveguide(
                            trace_template=StripWgTemplate(),
                            name=self.name + '_bez_l' + str(ii))
                        insts += i3.SRef(name=self.name + '_con_wg_l_t_' +
                                         str(ii),
                                         reference=wg_copy.Layout(shape=s))

                    # end if bend

                # end drawing connecting arcs

            # end for ii in range(self.rows)

            # # connect the input grating
            # # pick grating layout to return
            # grating_layout = {
            #     'FGCCTE_FC1DC_625_313':     FGCCTE_FC1DC_625_313().Layout(),
            #     'FGCCTE_FCWFC1DC_630_378':  FGCCTE_FCWFC1DC_630_378().Layout(),
            #     'FGCCTM_FC1DC_984_492':     FGCCTM_FC1DC_984_492().Layout(),
            # }[self.grating_name]
            #
            #
            #
            # # place bottom grating
            # # always assuming bottom grating starts on the left
            # bot_grating_name = self.name+'_bot_grating'
            # t = i3.vector_match_transform( grating_layout.ports['waveguide'],
            #                                insts[self.name + '_TP_ROW0'].ports['left'] ) + \
            #     i3.Translation( ( -self.bot_gc_connect_length, 0.0 ) )
            #
            # insts += i3.SRef(   name            = bot_grating_name,
            #                     reference       = grating_layout,
            #                     transformation  = t )
            #
            # # connect bottom grating to taper
            # route_wg_bot = i3.RouteManhattan( input_port  = insts[bot_grating_name].ports['waveguide'],
            #                                   output_port = insts[self.name + '_TP_ROW0'].ports['left'] )
            #
            # # add wg
            # wg_bot = i3.Waveguide( trace_template = StripWgTemplate(), name = self.name + '_WG_BOT')
            # insts += i3.SRef(name=self.name + '_connect_wg_bot', reference=wg_bot.Layout(shape=route_wg_bot))
            #
            #
            #
            # # place top grating
            # top_grating_name = self.name + '_top_grating'
            # if (self.n_rows % 2) == 1:
            #     # even # of rows, output is to the right
            #     t = i3.vector_match_transform(  grating_layout.ports['waveguide'],
            #                                     insts[self.name + '_TP_ROW' + str(self.n_rows-1)].ports['right'],
            #                                     mirrored = True ) + \
            #         i3.Translation((self.top_gc_connect_length, 0.0))
            #
            #     insts += i3.SRef( name              = top_grating_name,
            #                       reference         = grating_layout,
            #                       transformation    = t)
            #
            #     # connect top grating to taper
            #     route_wg_top = i3.RouteManhattan(   input_port  = insts[top_grating_name].ports['waveguide'],
            #                                         output_port = insts[self.name + '_TP_ROW' + str(self.n_rows-1)].ports['right'])
            #
            #     # add wg
            #     wg_top = i3.Waveguide( trace_template = StripWgTemplate(), name = self.name + '_WG_TOP')
            #     insts += i3.SRef(name=self.name + '_connect_wg_top', reference=wg_top.Layout(shape=route_wg_top))
            #
            # else:
            #     # odd # of rows, output is to the left
            #     t = i3.vector_match_transform(  grating_layout.ports['waveguide'],
            #                                     insts[self.name + '_TP_ROW' + str(self.n_rows-1)].ports['left'],
            #                                     mirrored = False ) + \
            #         i3.Translation((-self.top_gc_connect_length, 0.0))
            #
            #     insts += i3.SRef( name              = top_grating_name,
            #                       reference         = grating_layout,
            #                       transformation    = t)
            #
            #     # connect top grating to taper
            #     route_wg_top = i3.RouteManhattan(   input_port  = insts[top_grating_name].ports['waveguide'],
            #                                         output_port = insts[self.name + '_TP_ROW' + str(self.n_rows-1)].ports['left'])
            #
            #     # add wg
            #     wg_top = i3.Waveguide( trace_template = StripWgTemplate(), name = self.name + '_WG_TOP')
            #     insts += i3.SRef(name=self.name + '_connect_wg_top', reference=wg_top.Layout(shape=route_wg_top))

            return insts
Пример #26
0
 def _default_WG3(self):
     wg3 = i3.Waveguide(name="route", trace_template=self.trace_template)
     wg3.Layout(shape=[(0.0, 0.0), (1.0, 0.0)])
     return wg3
Пример #27
0
 def _default_WG1(self):
     WG1 = i3.Waveguide(name="straight{}".format(str(self.width)), trace_template=self.wg_t1)
     WG1.Layout(shape=[(0.0, 0.0), (150.0, 0.0)])
     return WG1
Пример #28
0
 def _default_WG1(self):
     WG1 = i3.Waveguide(name="straight{}".format(str(self.width)),
                        trace_template=self.wg_t1)
     return WG1
Пример #29
0
wg_sm = WireWaveguideTemplate()
wg_sm.Layout(core_width=3.8, cladding_width=3.8 + 16.0)

# wg_sm2 = WireWaveguideTemplate()
# wg_sm2.Layout(core_width=3.1, cladding_width=3.1 + 16.0)

mmi_trace_template = WireWaveguideTemplate()
mmi_trace_template.Layout(core_width=20.0,
                          cladding_width=20.0 + 16.0)  # MMI_width

mmi_access_template = WireWaveguideTemplate()
mmi_access_template.Layout(core_width=9.0, cladding_width=9.0 + 16.0)

# Define components

WG1 = i3.Waveguide(name="Dongbo", trace_template=wg_t1)
layout_WG1 = WG1.Layout(shape=[(0.0, 0.0), (50.0, 0.0)])

WG2 = WireWaveguideTransitionLinear(start_trace_template=wg_t1,
                                    end_trace_template=wg_sm)
layout_WG2 = WG2.Layout(start_position=(50.0, 0.0), end_position=(350.0, 0.0))

# layout_WG2.visualize()

WG3 = WireWaveguideTransitionLinear(start_trace_template=wg_sm,
                                    end_trace_template=wg_t1)
layout_WG3 = WG3.Layout(start_position=(50.0, 0.0), end_position=(350.0, 0.0))

mmi1_12 = MMI1x2Tapered(
    mmi_trace_template=mmi_trace_template,
    input_trace_template=mmi_access_template,
wg_tpl_lay = wg_tmpl.Layout(windows=[
    i3.PathTraceWindow(layer=core_layer,
                       start_offset=-0.5 * wg_width,
                       end_offset=+0.5 * wg_width),
    i3.PathTraceWindow(layer=clad_layer,
                       start_offset=-0.5 * wg_width - 2.0,
                       end_offset=0.5 * wg_width + 2.0)
    ]
)

vfab_process = vfab()
xsection = wg_tpl_lay.cross_section(process_flow=vfab_process)
xsection.visualize()

# waveguide
wg = i3.Waveguide(trace_template=wg_tmpl)
wg_lo = wg.Layout(shape=[(-wg_length /2., 0.0), (wg_length/2., 0.0)])
wg_lo.visualize_2d(vfabrication_process_flow=vfab_process)


wg_lo_si = wg_lo.size_info()
geometry = i3.device_sim.SimulationGeometry(
    layout=wg_lo,
    process_flow=vfab_process,
    bounding_box=[
        (wg_lo_si.west - 1.0, wg_lo_si.east + 1.0),
        (wg_lo_si.south - 1.0, wg_lo_si.north + 1.0),
        None,
    ]
)