Skip to content

Circuit From Netlist

Imports

import gdsfactory as gf
from cspdk.si220.cband import PDK
from doroutes import add_bundle_astar

PDK.activate()
PDK.routing_strategies["doroute_astar"] = add_bundle_astar

Yaml Netlist

yaml = """
instances:
  mzi1:
    component: mzi
    settings: {}
  mzi2:
    component: mzi
    settings:
      delta_length: 20
connections: {}
routes:
  bundle:
    links:
      mzi1,o3: mzi2,o1
    routing_strategy: doroute_astar
    settings:
        spacing: 1.0
        bend:
            component: bend_euler
            settings:
                radius: 5
        straight: straight
        layers:
            - WG
nets: []
ports:
  o1: mzi1,o1
  o2: mzi2,o2
  o3: mzi2,o3
placements:
  mzi1:
    mirror: 0
    rotation: 0
    x: 0
    y: 0
  mzi2:
    dx: 100
    dy: 100
    mirror: 0
    rotation: 0
    x: mzi1,o2
    y: 0
"""

Build

c = gf.read.from_yaml(yaml)
c
API key for superuser found.

png

yaml2 = """
instances:
  s1:
    component: straight
    settings: {}
  s2:
    component: straight
    settings: {}
  s3:
    component: straight
    settings: {}
  s4:
    component: straight
    settings: {}
connections: {}
routes:
  my_bundle:
    links:
      s3-4,o1: s1-2,o2
    routing_strategy: 'doroute_astar'
    settings:
        spacing: 1.0
        bend:
            component: bend_euler
            settings:
                radius: 5
        straight: straight
        layers:
            - WG
nets: []
ports: {}
placements:
  s1:
    y: 100
  s2:
    y: -100
  s3:
    x: 200
    y: 100
  s4:
    x: 200
    y: -100
"""
c = gf.read.from_yaml(yaml2)
c.show()
c
API key for superuser found.


2026-01-08 15:56:58.654 | WARNING  | kfactory.kcell:show:3958 - Could not connect to klive server

png