Skip to article frontmatterSkip to article content

gdsfactory.get_netlist.get_netlist

gdsfactory.get_netlist.get_netlist(component: ~kfactory.kcell.DKCell, exclude_port_types: ~collections.abc.Sequence[str] | None = ('placement', 'pad', 'bump'), get_instance_name: ~collections.abc.Callable[[...], str] = <function get_instance_name_from_alias>, allow_multiple: bool = True, connection_error_types: dict[str, list[str]] | None = None)dict[str, Any]

From Component returns a dict with instances, connections and placements.

warnings collected during netlisting are reported back into the netlist. These include warnings about mismatched port widths, orientations, shear angles, excessive offsets, etc. You can also configure warning types which should throw an error when encountered by modifying connection_error_types. A key difference in this algorithm is that we group each port type independently. This allows us to use different logic to determine i.e. if an electrical port is properly connected vs an optical port. In this function, the core logic is the same, but we employ extra validation for optical ports.

Parameters
  • componentto extract netlist.

  • exclude_port_typesoptional list of port types to exclude from netlisting.

  • get_instance_namefunction to get instance name.

  • allow_multipleFalse to raise an error if more than two ports share the same connection. if True, will return key: [value] pairs with [value] a list of all connected instances.

  • connection_error_typesoptional dictionary of port types and error types to raise an error for.

Returns

Dict of instance name and settings. nets: List of connected port pairs/groups placements: Dict of instance names and placements (x, y, rotation). port: Dict portName: ComponentName,port. name: name of component. warnings: warning messages (disconnected pins).

Return type

instances