piel.integration.gdsfactory_hdl21.conversion#

sax has very good GDSFactory integration functions, so there is a question on whether implementing our own circuit construction, and SPICE netlist parser from it, accordingly. We need in some form to connect electrical models to our parsed netlist, in order to apply SPICE passive values, and create connectivity for each particular device. Ideally, this would be done from the component instance as that way the component model can be integrated with its geometrical parameters, but does not have to be done necessarily. This comes down to implementing a backend function to compile SAX compiled circuit.

Module Contents#

Functions#

convert_connections_to_tuples(connections)

Convert from:

gdsfactory_netlist_with_hdl21_generators(...[, generators])

This function allows us to map the hdl21 models dictionary in a sax-like implementation to the GDSFactory netlist. This allows us to iterate over each instance in the netlist and construct a circuit after this function.]

convert_connections_to_tuples(connections: dict)[source]#

Convert from:

{
'straight_1,e1': 'taper_1,e2',
'straight_1,e2': 'taper_2,e2',
'taper_1,e1': 'via_stack_1,e3',
'taper_2,e1': 'via_stack_2,e1'
}

to:

[(('straight_1', 'e1'), ('taper_1', 'e2')), (('straight_1', 'e2'), ('taper_2', 'e2')), (('taper_1', 'e1'),
('via_stack_1', 'e3')), (('taper_2', 'e1'), ('via_stack_2', 'e1'))]
gdsfactory_netlist_with_hdl21_generators(gdsfactory_netlist: dict, generators=None)[source]#

This function allows us to map the hdl21 models dictionary in a sax-like implementation to the GDSFactory netlist. This allows us to iterate over each instance in the netlist and construct a circuit after this function.]

Example usage:

>>> import gdsfactory as gf
>>> from piel.integration.gdsfactory_hdl21.conversion import gdsfactory_netlist_with_hdl21_generators
>>> from piel.models.physical.electronic import get_default_models
>>> gdsfactory_netlist_with_hdl21_generators(gdsfactory_netlist=gf.components.mzi2x2_2x2_phase_shifter().get_netlist(exclude_port_types="optical"),generators=get_default_models())
Parameters:
  • gdsfactory_netlist – The netlist from GDSFactory to map to the hdl21 models dictionary.

  • generators – The hdl21 models dictionary to map to the GDSFactory netlist.

Returns:

The GDSFactory netlist with the hdl21 models dictionary.