mxpic.components.routing#

Route#

class mxpic.components.routing.Route(radius=None, width=None, angle=90, Ltp_mm=10, width2_mm=1.0, MM_route=False, xs=None, layer=None, adapt_width=False, adapt_xs=False, instantiate=False, pinstyle=None, offset=None, varname=None, doc='', PCB=False, modes=None, sharp_patch=True)#

Bases: Interconnect

bend_mine(radius=None, angle=None, width=None, pin=None, xs=None, length1=0, length2=0, name=None, arrow=False, offset=None, sharp_patch=True)#
bend_p2p(pin1=None, pin2=None, radius=None, width=None, xs=None, name=None, arrow=False, width_mm=None, Ltp=None, sharp_path=True)#

Another package of IC.strt_bend_strt_p2p, which gives the possiblity to attach pins with right angle

bend_route(radius=None, angle=None, width=None, pin=None, xs=None, length1=0.1, length2=0.1, name=None, arrow=False, offset=None, sharp_patch=True, original_function=False)#
bend_route_p2p(pin1=None, pin2=None, radius=None, width=None, xs=None, name=None, arrow=False, original_function=False)#
bend_strt_bend_p2p(pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1=0, length2=0, ictype='shortest', name=None, arrow=True, width_mm=None, Ltp=None)#

Generate a point-to-point bend-straight-bend interconnect.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • radius1 (float) – optional first bend radius in um

  • radius2 (float) – optional second bend radius im um

  • width (float) – optional waveguide width in um

  • xs (str) – optional xsection

  • ictype (str) – interconnection type (default=’shortest’) options: ‘shortest’, ‘ll’, ‘lr’, ‘rl’, rr’, ‘all’

  • name (str) – optional new name for the component

  • arrow (bool) – draw connection arrows (default=True)

Returns:

bend_strt_bend element

Return type:

Cell

Example

Create and place a bend-straight-bend guide to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.bend_strt_bend_p2p(pin1=(0, 0, 0), pin2=(40, 20, 90))
guide.put()
nd.export_plt()
bend_strt_bend_p2p_mine(pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1=0, length2=0, ictype='shortest', name=None, arrow=False)#

Generate a point-to-point bend-straight-bend interconnect.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • radius1 (float) – optional first bend radius in um

  • radius2 (float) – optional second bend radius im um

  • width (float) – optional waveguide width in um

  • xs (str) – optional xsection

  • ictype (str) – interconnection type (default=’shortest’) options: ‘shortest’, ‘ll’, ‘lr’, ‘rl’, rr’, ‘all’

  • name (str) – optional new name for the component

  • arrow (bool) – draw connection arrows (default=True)

Returns:

bend_strt_bend element

Return type:

Cell

Example

Create and place a bend-straight-bend guide to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.bend_strt_bend_p2p(pin1=(0, 0, 0), pin2=(40, 20, 90))
guide.put()
nd.export_plt()
connPatch()#
line_mm(length=None, width=None, xs=None, width_mm=None, Ltp=None)#
rt_bend(width=3, xs='strip', angle=90, layer=None, pin=None)#
sbend_p2p(pin1=None, pin2=None, width=None, radius=None, Amax=90, xs=None, doStrFirst=1, Lstart=0, BendEndFlag=1, ref=None, name=None, arrow=False, bsb=True, sharp_patch=None, width_mm=None, Ltp=None)#

Create point-to-point s-bend interconnect.

The direction of the end pin is ignored.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • width (float) – width of the interconnect in um

  • radius (float) – bend radius of the interconnect in um

  • xs (str) – optional xsection of sbend

  • doFirst (int) – (default=1)

  • Amax (float) – maximum bend angle (default=90)

  • Lstart (float) – straight waveguide length at beginning (positive value) or end (negative value) of sbend

  • ref (Node) – reference direction for the sbend (default=pin1).

  • name (str) – optional new name for the component

  • BendEndFlag (int) – (default=1)

  • arrow (bool) – draw connection arrows (default=True)

  • bsb (bool) – If True, use bend_straight_bend_p2p() as fallback (default=True)

Returns:

sbend element

Return type:

Cell

Example

Create and place a sbend to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.sbend_p2p(pin1=(0), pin2=(40, 20))
guide.put()
nd.export_plt()
sbend_p2p_mine(pin1=None, pin2=None, width=None, radius=None, Lstart=0, doFirst=1, arrow=False, width_mm=None, Ltp=None, sharp_patch=False)#

Create pin-to-pin s-bend interconnect. This code is made by myself to avoid the possible gap between two bend

The direction of the end pin is ignored and is assumed to be parallel with pin1.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • width (float) – width of the interconnect in um

  • radius (float) – bend radius of the interconnect in um

  • xs (str) – optional xsection of sbend

  • doFirst (int) – (default=1)

  • Lstart (float) – straight waveguide length at beginning (positive value) or end (negative value) of sbend

  • arrow (bool) – draw connection arrows (default=True)

Returns:

sbend element

Return type:

Cell

Example

Create and place a sbend to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.sbend_p2p(pin1=(0), pin2=(40, 20))
guide.put()
nd.export_plt()
sbend_route(radius=None, width=None, pin=None, xs=None, offset=20, Ltot=None, length1=0, length2=0, name=None, arrow=False, Amax=90.0, original_function=False)#
strt(length=None, width=None, pin=None, xs=None, edge1=None, edge2=None, edgepoints=50, name=None, arrow=False, gridpatch=None)#

Create a straight waveguide.

Parameters:
  • length (float) – length of guide in um

  • width (float) – width of guide in um

  • pin (Node) – optional Node for modeling info

  • xs (str) – optionals xsection of guide

  • layer (int | str) – layer number or layername

  • edge1 (function) – optional function F(t) describing edge1 of the waveguide

  • edge2 (function) – optional function G(t) describing edge2 of the waveguide

  • edgepoints (int) – optional number of points for edge1 and edge2 (default=50)

  • name (str) – optional new name for the component

  • arrow (bool) – draw connection arrows (default=True)

  • gridpatch (float) – patch gridsnap jumps at grid disconnect of cells with chamfers of size gridpatch. Default=0 is no patch.

Returns:

waveguide element

Return type:

Cell

Example

Create and place a straight waveguide:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.strt(length=20)
guide.put()
nd.export_plt()
strt_bend_strt_p2p_mine(pin1=None, pin2=None, radius=None, radius1=None, radius2=None, width=None, xs=None, length1=0, length2=0, ictype='shortest', name=None, arrow=False, width_mm=None, Ltp=None)#
strt_mm(pin=None, width2=None, Ltp=None, width1=None, Lstart=0.5, length=None, xs=None, arrow=False)#
strt_mm_p2p(pin1=None, pin2=None, width2=None, Ltp=None, width1=None, Lstart=0.5, length=None, xs=None, arrow=False, name=None)#
strt_p2p(pin1=None, pin2=None, width=None, xs=None, name=None, arrow=False)#

Create point-to-point straight interconnect.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start of waveguide

  • pin2 (Node | Instance | tuple(x, y, a)) – end of waveguide

  • width (float) – width of waveguide

  • xs (str) – optional xsection of waveguide

  • name (str) – optional new name for the component

  • arrow (bool) – draw connection arrows (default=True)

Returns:

straight waveguide element

Return type:

Cell

Example

Create and place a straight guide between points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.strt_p2p(pin1=(0, 0), pin2=(10, 10))
guide.put()
nd.export_plt()
taper(length=None, width1=None, width2=None, shift=0, xs=None, pin=None, name=None, patch=False, arrow=False)#

Create a linear taper.

Parameters:
  • length (float) – length of taper

  • width1 (float) – start width of taper

  • width2 (float) – end width of taper

  • shift (float) – lateral shift of taper end

  • xs (str) – optional xsection of taper

  • pin (Node) – optional Node for modeling info

  • name (str) – optional new name for the component

  • arrow (bool) – draw connection arrows (default=True)

Returns:

linear taper element

Return type:

Cell

Example

Create and place a linear taper:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.taper(length=10, width1=2.0, width2=5.0)
guide.put()
nd.export_plt()
taper_p2p(pin1=None, pin2=None, width1=None, width2=None, xs=None, name=None, arrow=False)#

Create point-to-point (angled) taper interconnect.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • width1 (float) – width at start (taken from pin1 if None)

  • width2 (float) – width at end (taken from pin2 if None)

  • xs (str) – optional xsection of taper

  • name (str) – optional new name for the component

  • BendEndFlag (int) – (default=1)

  • arrow (bool) – draw connection arrows (default=True)

Returns:

taper element

Return type:

Cell

Example

Create and place a taper to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2, radius=10)

guide = ic.taper_p2p(pin1=(0), pin2=(40, 10), width2=4)
guide.put()
nd.export_plt()
tube_mine(geo, showpins=False, name=None, xs=None, arrow=False, Ltp=None, width_mm=None, sharp_patch=None)#

draw interconnect based on symbols.

Returns:

Tube element based on the provided elements

Return type:

Cell

ubend_p2p(pin1=None, pin2=None, radius=None, width=None, xs=None, length=0.1, name=None, arrow=False, balance=0, end_angle=False, original_function=False, Ltp=None, width_mm=None)#

Create point-to-point u-bend interconnect.

An extra straight length can be added to the ubend with <length>.

If the sideways translation needed in the ubend is <2*radius, then the ubend automatically introduces a ‘horseshoe’ shape. The horseshoe can be made sidelobed by a <balance> parameter between -1 and 1, where 0 results in a symmetric shape.

The orientation of the output pin does not matter unless end_angle=True is set (default=False). If True an extra bend is introduced on pin2 to align its direction with pin1 before drawing an orthogonal ubend.

Parameters:
  • pin1 (Node | Instance | tuple(x, y, a)) – start pin (default=cp)

  • pin2 (Node | Instance | tuple(x, y, a)) – end pin

  • radius (float) – optional bend radius in um

  • width (float) – optional waveguide width in um

  • xs (str) – optional xsection of ubend

  • length (float) – extra straight section for longer ubend (default=0)

  • balance (float) – for a ubend <2*radius sidewyas, shift the horseshoe shape (default=0)

  • end_angle (bool) – Take pin2 angle into account when connecting if True (default=False)

Returns:

ubend element

Return type:

Cell

Example

Create and place a ubend to connect two specific points:

import nazca as nd
from nazca.interconnects import Interconnect
ic = Interconnect(width=2.0, radius=10.0)

guide = ic.ubend_p2p(pin1=(0, 0, 0), pin2=(10, 20, 90), length=10)
guide.put()
nd.export_plt()
ubend_route(pin=None, offset=20.0, radius=None, width=None, xs=None, length=0, name=None, arrow=False, balance=0, end_angle=False, width_mm=None, Ltp=None)#

ic_exception#

mxpic.components.routing.ic_exception(msg='')#

Raise interconnect exception if conditions apply.