.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples\07-Circuit\Circuit_Siwave_Multizones.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_examples_07-Circuit_Circuit_Siwave_Multizones.py: Circuit: Simulate multi-zones layout with Siwave ------------------------------------------------ This example shows how you can use PyAEDT simulate multi-zones with Siwave. .. GENERATED FROM PYTHON SOURCE LINES 8-11 Perform required imports ~~~~~~~~~~~~~~~~~~~~~~~~ Perform required imports, which includes importing a section. .. GENERATED FROM PYTHON SOURCE LINES 11-16 .. code-block:: Python from pyaedt import Edb, Circuit import os.path import pyaedt .. GENERATED FROM PYTHON SOURCE LINES 17-20 Download file ~~~~~~~~~~~~~ Download the AEDB file and copy it in the temporary folder. .. GENERATED FROM PYTHON SOURCE LINES 20-30 .. code-block:: Python temp_folder = pyaedt.generate_unique_folder_name() edb_file = pyaedt.downloads.download_file(destination=temp_folder, directory="edb/siwave_multi_zones.aedb") working_directory = os.path.join(temp_folder, "workdir") aedt_file = os.path.splitext(edb_file)[0] + ".aedt" circuit_project_file = os.path.join(working_directory, os.path.splitext(os.path.basename(edb_file))[0] + "multizone_clipped_circuit.aedt") print(edb_file) .. rst-class:: sphx-glr-script-out .. code-block:: none D:\Temp\pyaedt_prj_LJZ\edb/siwave_multi_zones.aedb .. GENERATED FROM PYTHON SOURCE LINES 31-34 Set AEDT version ~~~~~~~~~~~~~~~~ Set AEDT version. .. GENERATED FROM PYTHON SOURCE LINES 34-37 .. code-block:: Python aedt_version = "2024.1" .. GENERATED FROM PYTHON SOURCE LINES 38-41 Ground net ~~~~~~~~~~ Common reference net used across all sub-designs, Mandatory for this work flow. .. GENERATED FROM PYTHON SOURCE LINES 41-44 .. code-block:: Python common_reference_net = "GND" .. GENERATED FROM PYTHON SOURCE LINES 45-48 Project load ~~~~~~~~~~~~ Load initial Edb file, checking if aedt file exists and remove to allow Edb loading. .. GENERATED FROM PYTHON SOURCE LINES 48-53 .. code-block:: Python if os.path.isfile(aedt_file): os.remove(aedt_file) edb = Edb(edbversion=aedt_version, edbpath=edb_file) .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyedb\dotnet\edb_core\components.py:185: DeprecationWarning: Use new property :func:`instances` instead. warnings.warn("Use new property :func:`instances` instead.", DeprecationWarning) .. GENERATED FROM PYTHON SOURCE LINES 54-57 Project zones ~~~~~~~~~~~~~ Copy project zone into sub project. .. GENERATED FROM PYTHON SOURCE LINES 57-60 .. code-block:: Python edb_zones = edb.copy_zones(working_directory=working_directory) .. GENERATED FROM PYTHON SOURCE LINES 61-65 Split zones ~~~~~~~~~~~ Clip sub-designs along with corresponding zone definition and create port of clipped signal traces. .. GENERATED FROM PYTHON SOURCE LINES 65-67 .. code-block:: Python defined_ports, project_connexions = edb.cutout_multizone_layout(edb_zones, common_reference_net) .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyedb\dotnet\edb_core\stackup.py:627: DeprecationWarning: `stackup_mode` is deprecated. Use `mode` method instead. warnings.warn("`stackup_mode` is deprecated. Use `mode` method instead.", DeprecationWarning) .. GENERATED FROM PYTHON SOURCE LINES 68-71 Circuit ~~~~~~~ Create circuit design, import all sub-project as EM model and connect all corresponding pins in circuit. .. GENERATED FROM PYTHON SOURCE LINES 71-76 .. code-block:: Python circuit = Circuit(specified_version=aedt_version, projectname=circuit_project_file) circuit.connect_circuit_models_from_multi_zone_cutout(project_connections=project_connexions, edb_zones_dict=edb_zones, ports=defined_ports, model_inc=70) .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\_tool\Python\3.10.9\x64\lib\subprocess.py:1072: ResourceWarning: subprocess 940 is still running _warn("subprocess %s is still running" % self.pid, C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\generic\settings.py:383: ResourceWarning: unclosed file <_io.TextIOWrapper name='D:\\Temp\\pyaedt_ansys.log' mode='a' encoding='cp1252'> self._logger = val True .. GENERATED FROM PYTHON SOURCE LINES 77-80 Setup ~~~~~ Add Nexxim LNA simulation setup. .. GENERATED FROM PYTHON SOURCE LINES 80-82 .. code-block:: Python circuit_setup= circuit.create_setup("Pyedt_LNA") .. GENERATED FROM PYTHON SOURCE LINES 83-86 Frequency sweep ~~~~~~~~~~~~~~~ Add frequency sweep from 0GHt to 20GHz with 10NHz frequency step. .. GENERATED FROM PYTHON SOURCE LINES 86-88 .. code-block:: Python circuit_setup.props["SweepDefinition"]["Data"] = "LIN {} {} {}".format("0GHz", "20GHz", "10MHz") .. GENERATED FROM PYTHON SOURCE LINES 89-92 Start simulation ~~~~~~~~~~~~~~~~ Analyze all siwave projects and solves the circuit. .. GENERATED FROM PYTHON SOURCE LINES 92-94 .. code-block:: Python circuit.analyze() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 95-97 Define differential pairs ~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 97-100 .. code-block:: Python circuit.set_differential_pair(assignment="U0.via_38.B2B_SIGP", reference="U0.via_39.B2B_SIGN", differential_mode="U0") circuit.set_differential_pair(assignment="U1.via_32.B2B_SIGP", reference="U1.via_33.B2B_SIGN", differential_mode="U1") .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 101-103 Plot results ~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 103-105 .. code-block:: Python circuit.post.create_report(expressions=["dB(S(U0,U0))", "dB(S(U1,U0))"], context="Differential Pairs") .. rst-class:: sphx-glr-script-out .. code-block:: none .. GENERATED FROM PYTHON SOURCE LINES 106-108 Release AEDT desktop ~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 108-108 .. code-block:: Python circuit.release_desktop() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** (1 minutes 46.257 seconds) .. _sphx_glr_download_examples_07-Circuit_Circuit_Siwave_Multizones.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Circuit_Siwave_Multizones.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: Circuit_Siwave_Multizones.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_