Skip to article frontmatterSkip to article content

gdsfactory.routing.add_pads_top

gdsfactory.routing.add_pads_top(component: ComponentSpec = 'straight_heater_metal', select_ports: SelectPorts = functools.partial(<function select_ports>, port_type='electrical'), port_names: Strs | None = None, cross_section: CrossSectionSpec = 'metal_routing', pad_port_name: str = 'e1', pad: ComponentSpec = 'pad_rectangular', bend: ComponentSpec = 'wire_corner', straight_separation: float = 15.0, pad_pitch: float = 100.0, port_type: str = 'electrical', allow_width_mismatch: bool = True, fanout_length: float | None = 0, route_width: float | None = 0, bboxes: BoundingBoxes | None = None, avoid_component_bbox: bool = False, auto_taper: bool = True, **kwargs: Any)Component

Returns new component with ports connected top pads.

Parameters
  • componentcomponent spec to connect to.

  • select_portsfunction to select_ports.

  • port_namesoptional port names. Overrides select_ports.

  • cross_sectioncross_section spec.

  • get_input_labels_functionfunction to get input labels. None skips labels.

  • layer_labeloptional layer for grating coupler label.

  • pad_port_namepad input port name.

  • pad_port_labelspad list of labels.

  • padspec for route terminations.

  • bendbend spec.

  • straight_separationfrom wire edge to edge. Defaults to xs.width+xs.gap

  • pad_pitchin um. Defaults to pad_pitch constant from the PDK.

  • port_typeport type.

  • allow_width_mismatchTrue

  • fanout_lengthif None, automatic calculation of fanout length.

  • route_widthwidth of the route. If None, defaults to cross_section.width.

  • bboxeslist of bounding boxes to avoid.

  • avoid_component_bboxTrue

  • auto_taperadds tapers to the routing.

  • kwargsadditional arguments.

Keyword Arguments
  • straightstraight spec.

  • get_input_label_text_loopback_functionfunction to get input label test.

  • get_input_label_text_functionfor labels.

  • max_y0_opticalin um.

  • with_loopbackTrue, adds loopback structures.

  • list_port_labelsNone, adds TM labels to port indices in this list.

  • connected_port_list_idsnames of ports only for type 0 optical routing.

  • nb_optical_ports_linesnumber of grating coupler lines.

  • force_manhattanFalse

  • excluded_portslist of port names to exclude when adding gratings.

  • grating_indiceslist of grating coupler indices.

  • routing_straightfunction to route.

  • routing_methodroute_single.

  • gc_rotationfiber coupler rotation in degrees. Defaults to -90.

  • input_port_indexesto connect.

  • allow_width_mismatchTrue

import gdsfactory as gf
c = gf.c.nxn(
    xsize=600,
    ysize=200,
    north=2,
    south=3,
    wg_width=10,
    layer="M3",
    port_type="electrical",
)
cc = gf.routing.add_pads_top(component=c, port_names=("e1", "e4"), fanout_length=50)
cc.plot()