.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_basic/07_multiple_instance_feedthrough.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_basic_07_multiple_instance_feedthrough.py: ============================================== Generating feedthrough from multiple instances ============================================== This example demonstrates how to generate feedthrough from multiple instances. If multiple instances belong to the same reference module it should reuser the feedthrough instead of creating independent feedthrough to pass through each instance. This example creates new wire ``A`` and create feedthrough port and connection from ``inst_1_0`` and ``inst_1_1`` in sequence. **Before feedthrough** .. image:: ../../../examples/basic/_basic_hierarchy_design.svg :align: center **After feedthrough** .. image:: ../../../examples/basic/_Feedthrough_basic_hierarchy_design.svg :align: center .. GENERATED FROM PYTHON SOURCE LINES 27-72 .. code-block:: Python import logging import spydrnet as sdn import spydrnet_physical as sdnphy from spydrnet_physical.composers.html.composer import HTMLComposer from spydrnet_physical.composers.svg.composer import SVGComposer logger = logging.getLogger('spydrnet_logs') sdn.enable_file_logging(LOG_LEVEL='INFO') # logger.warning("NotImplemented") netlist = sdnphy.load_netlist_by_name('basic_hierarchy') top = netlist.top_instance.reference cable = top.create_cable(name='A', wires=1) top.create_port(name='A', direction=sdn.IN, pins=1) cable_out = top.create_cable(name='Aout', wires=1) top.create_port(name='Aout', direction=sdn.OUT, pins=1) cable_out.assign_cable(cable) composer = HTMLComposer() composer.run(netlist, file_out="_basic_hierarchy_design.html") composer = SVGComposer() composer.run(netlist, file_out="_basic_hierarchy_design.svg") inst1 = next(top.get_instances('inst_1_0')) inst2 = next(top.get_instances('inst_1_1')) inst_list = (cable, [inst1, inst2]) top.create_feedthrough_multiple(inst_list) top.create_unconn_wires() composer = HTMLComposer() composer.run(netlist, file_out="_Feedthrough_basic_hierarchy_design.html") composer = SVGComposer() composer.expand(modules=["module1"]) composer.run(netlist, file_out="_Feedthrough_basic_hierarchy_design.svg", netlistsvg="netlistsvg-hierarchy") sdn.compose(netlist, '_basic_hierarchy_after_multiple_feedthrough.v', skip_constraints=True) .. _sphx_glr_download_auto_basic_07_multiple_instance_feedthrough.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 07_multiple_instance_feedthrough.ipynb <07_multiple_instance_feedthrough.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 07_multiple_instance_feedthrough.py <07_multiple_instance_feedthrough.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 07_multiple_instance_feedthrough.zip <07_multiple_instance_feedthrough.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_