.. 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:: default 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:: default 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_F3W\edb/siwave_multi_zones.aedb .. GENERATED FROM PYTHON SOURCE LINES 31-34 AEDT version ~~~~~~~~~~~~ Sets the Aedt version to 2023 R2. .. GENERATED FROM PYTHON SOURCE LINES 34-37 .. code-block:: default edb_version = "2023.2" .. 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:: default 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:: default if os.path.isfile(aedt_file): os.remove(aedt_file) edb = Edb(edbversion=edb_version, edbpath=edb_file) .. rst-class:: sphx-glr-script-out .. code-block:: none C:\actions-runner\_work\pyaedt\pyaedt\testenv\lib\site-packages\pyaedt\edb_core\components.py:163: 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:: default 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:: default 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\pyaedt\edb_core\stackup.py:376: 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:: default circuit = Circuit(specified_version=edb_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 Initializing new desktop! False .. GENERATED FROM PYTHON SOURCE LINES 77-80 Setup ~~~~~ Add Nexxim LNA simulation setup. .. GENERATED FROM PYTHON SOURCE LINES 80-82 .. code-block:: default 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:: default 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:: default circuit.analyze() .. rst-class:: sphx-glr-script-out .. code-block:: none False .. GENERATED FROM PYTHON SOURCE LINES 95-97 Define differential pairs ~~~~~~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 97-102 .. code-block:: default circuit.set_differential_pair(diff_name="U0", positive_terminal="U0.via_38.B2B_SIGP", negative_terminal="U0.via_39.B2B_SIGN") circuit.set_differential_pair(diff_name="U1", positive_terminal="U1.via_32.B2B_SIGP", negative_terminal="U1.via_33.B2B_SIGN") .. rst-class:: sphx-glr-script-out .. code-block:: none True .. GENERATED FROM PYTHON SOURCE LINES 103-105 Plot results ~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 105-107 .. code-block:: default 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 108-110 Release AEDT desktop ~~~~~~~~~~~~~~~~~~~~ .. GENERATED FROM PYTHON SOURCE LINES 110-110 .. code-block:: default circuit.release_desktop() .. rst-class:: sphx-glr-script-out .. code-block:: none True .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 54.607 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-python :download:`Download Python source code: Circuit_Siwave_Multizones.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: Circuit_Siwave_Multizones.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_