gdsfactory.get_netlist.get_netlist

Contents

gdsfactory.get_netlist.get_netlist#

gdsfactory.get_netlist.get_netlist(component: ~gdsfactory.component.Component, exclude_port_types: list[str] | tuple[str] | None = ('placement',), get_instance_name: ~collections.abc.Callable[[...], str] = <function get_instance_name_from_alias>, allow_multiple: bool = False, connection_error_types: dict[str, list[str]] | None = None) dict[str, Any][source]#

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:
  • component – to extract netlist.

  • exclude_port_types – optional list of port types to exclude from netlisting.

  • get_instance_name – function to get instance name.

  • allow_multiple – False 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_types – optional 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