Download this example
Download this example as a Jupyter Notebook or as a Python script.
Multi-zone simulation with SIwave#
This example shows how to simulate multiple zones with SIwave.
Keywords: Circuit, multi-zone.
Perform imports and define constants#
Perform required imports, which includes importing a section.
[1]:
import os.path
import tempfile
import time
import ansys.aedt.core
from ansys.aedt.core import Circuit, Edb
Define constants.
[2]:
EDB_VERSION = "2024.2"
Create temporary directory#
Create a temporary directory where downloaded data or dumped data can be stored. If you’d like to retrieve the project data for subsequent use, the temporary folder name is given by temp_folder.name
.
[3]:
temp_folder = tempfile.TemporaryDirectory(suffix=".ansys")
Download EDB folder#
[4]:
edb_file = ansys.aedt.core.downloads.download_file(
directory="edb/siwave_multi_zones.aedb", destination=temp_folder.name
)
work_folder = os.path.join(temp_folder.name, "work")
aedt_file = os.path.splitext(edb_file)[0] + ".aedt"
circuit_project_file = os.path.join(temp_folder.name, "multizone_clipped_circuit.aedt")
print(edb_file)
PyAEDT WARNING: Argument `directory` is deprecated for method `download_file`; use `source` instead.
C:\Users\ansys\AppData\Local\Temp\tmp4byxkqko.ansys\edb/siwave_multi_zones.aedb
Set AEDT version#
[5]:
edb_version = EDB_VERSION
Define ground net#
Define the common reference net used across all subdesigns, which is mandatory for this workflow.
[6]:
common_reference_net = "GND"
Load project#
Check if the AEDT file exists and remove it to allow EDB loading. Then, load the initial EDB file.
[7]:
if os.path.isfile(aedt_file):
os.remove(aedt_file)
edb = Edb(edbversion=edb_version, edbpath=edb_file)
PyAEDT INFO: Logger is initialized in EDB.
PyAEDT INFO: legacy v0.31.0
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: Database siwave_multi_zones.aedb Opened in 2024.2
PyAEDT INFO: Cell EMDesign1 Opened
PyAEDT INFO: Builder was initialized.
PyAEDT INFO: EDB initialized.
Copy project zones#
Copy project zone into the subproject.
[8]:
edb_zones = edb.copy_zones(working_directory=work_folder)
Split zones#
Clip subdesigns along with corresponding zone definitions and create a port of clipped signal traces.
[9]:
defined_ports, project_connexions = edb.cutout_multizone_layout(
edb_zones, common_reference_net
)
PyAEDT INFO: Logger is initialized in EDB.
PyAEDT INFO: legacy v0.31.0
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: Database 60_siwave_multi_zones.aedb Opened in 2024.2
PyAEDT INFO: Cell EMDesign1 Opened
PyAEDT INFO: Builder was initialized.
PyAEDT INFO: EDB initialized.
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 4 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 8 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 2 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 0 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 6 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 0 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Terminal B2B_SIGN_71_0ZJ7OV created
PyAEDT INFO: Port B2B_SIGN_71_0ZJ7OV created
PyAEDT INFO: Terminal B2B_SIGP_72_VWY7RO created
PyAEDT INFO: Port B2B_SIGP_72_VWY7RO created
PyAEDT INFO: EDB file save time: 0.00ms
PyAEDT INFO: EDB file release time: 0.00ms
PyAEDT INFO: Logger is initialized in EDB.
PyAEDT INFO: legacy v0.31.0
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: Database 62_siwave_multi_zones.aedb Opened in 2024.2
PyAEDT INFO: Cell EMDesign1 Opened
PyAEDT INFO: Builder was initialized.
PyAEDT INFO: EDB initialized.
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 8 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 8 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 4 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 0 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 3 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 0 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Terminal B2B_SIGN_70_U0LGNN created
PyAEDT INFO: Port B2B_SIGN_70_U0LGNN created
PyAEDT INFO: Terminal B2B_SIGN_70_RFDODG created
PyAEDT INFO: Port B2B_SIGN_70_RFDODG created
PyAEDT INFO: Terminal B2B_SIGP_69_XWZG8M created
PyAEDT INFO: Port B2B_SIGP_69_XWZG8M created
PyAEDT INFO: Terminal B2B_SIGP_69_4UDS3M created
PyAEDT INFO: Port B2B_SIGP_69_4UDS3M created
PyAEDT INFO: EDB file save time: 0.00ms
PyAEDT INFO: EDB file release time: 0.00ms
PyAEDT INFO: Logger is initialized in EDB.
PyAEDT INFO: legacy v0.31.0
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: Database 64_siwave_multi_zones.aedb Opened in 2024.2
PyAEDT INFO: Cell EMDesign1 Opened
PyAEDT INFO: Builder was initialized.
PyAEDT INFO: EDB initialized.
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 4 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 8 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 2 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Cutout Multithread started.
PyAEDT INFO: Net clean up Elapsed time: 0m 0sec
PyAEDT INFO: Extent Creation Elapsed time: 0m 0sec
PyAEDT INFO: 0 Padstack Instances deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 3 Primitives deleted. Elapsed time: 0m 0sec
PyAEDT INFO: 0 components deleted
PyAEDT INFO: Cutout completed. Elapsed time: 0m 0sec
PyAEDT INFO: Terminal B2B_SIGN_70_QPZ3DH created
PyAEDT INFO: Port B2B_SIGN_70_QPZ3DH created
PyAEDT INFO: Terminal B2B_SIGP_69_JDBKOR created
PyAEDT INFO: Port B2B_SIGP_69_JDBKOR created
PyAEDT INFO: EDB file save time: 0.00ms
PyAEDT INFO: EDB file release time: 0.00ms
Create circuit#
Create circuit design, import all subprojects as EM models, and connect all corresponding pins in the circuit.
[10]:
circuit = Circuit(version=edb_version, project=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,
)
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: PyAEDT version 0.12.dev0.
PyAEDT INFO: Initializing new Desktop session.
PyAEDT INFO: Log on console is enabled.
PyAEDT INFO: Log on file C:\Users\ansys\AppData\Local\Temp\pyaedt_ansys_3b44b761-3d06-421d-bc84-49a36e912c1c.log is enabled.
PyAEDT INFO: Log on AEDT is enabled.
PyAEDT INFO: Debug logger is disabled. PyAEDT methods will not be logged.
PyAEDT INFO: Launching PyAEDT with gRPC plugin.
PyAEDT INFO: New AEDT session is starting on gRPC port 62901
PyAEDT INFO: AEDT installation Path C:\Program Files\AnsysEM\v242\Win64
PyAEDT INFO: Ansoft.ElectronicsDesktop.2024.2 version started with process ID 7524.
PyAEDT INFO: Project multizone_clipped_circuit has been created.
PyAEDT INFO: No design is present. Inserting a new design.
PyAEDT INFO: Added design 'Circuit Design_F3L' of type Circuit Design.
PyAEDT INFO: Aedt Objects correctly read
PyAEDT INFO: ModelerCircuit class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: ModelerNexxim class has been initialized!
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: PyAEDT version 0.12.dev0.
PyAEDT INFO: Returning found Desktop session with PID 7524!
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmp4byxkqko.ansys\work\60_siwave_multi_zones.aedb has been imported to project 60_siwave_multi_zones
PyAEDT INFO: Active Design set to 0;60_siwave_multi_zones
PyAEDT INFO: Aedt Objects correctly read
PyAEDT INFO: Loading Modeler.
PyAEDT INFO: Modeler loaded.
PyAEDT INFO: EDB loaded.
PyAEDT INFO: Layers loaded.
PyAEDT INFO: Primitives loaded.
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Closing the AEDT Project 60_siwave_multi_zones
PyAEDT INFO: Project 60_siwave_multi_zones closed correctly
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: PyAEDT version 0.12.dev0.
PyAEDT INFO: Returning found Desktop session with PID 7524!
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmp4byxkqko.ansys\work\62_siwave_multi_zones.aedb has been imported to project 62_siwave_multi_zones
PyAEDT INFO: Active Design set to 0;62_siwave_multi_zones
PyAEDT INFO: Aedt Objects correctly read
PyAEDT INFO: Loading Modeler.
PyAEDT INFO: Modeler loaded.
PyAEDT INFO: EDB loaded.
PyAEDT INFO: Layers loaded.
PyAEDT INFO: Primitives loaded.
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Closing the AEDT Project 62_siwave_multi_zones
PyAEDT INFO: Project 62_siwave_multi_zones closed correctly
PyAEDT INFO: Python version 3.10.11 (tags/v3.10.11:7d4cc5a, Apr 5 2023, 00:38:17) [MSC v.1929 64 bit (AMD64)]
PyAEDT INFO: PyAEDT version 0.12.dev0.
PyAEDT INFO: Returning found Desktop session with PID 7524!
PyAEDT INFO: EDB folder C:\Users\ansys\AppData\Local\Temp\tmp4byxkqko.ansys\work\64_siwave_multi_zones.aedb has been imported to project 64_siwave_multi_zones
PyAEDT INFO: Active Design set to 0;64_siwave_multi_zones
PyAEDT INFO: Aedt Objects correctly read
PyAEDT INFO: Loading Modeler.
PyAEDT INFO: Modeler loaded.
PyAEDT INFO: EDB loaded.
PyAEDT INFO: Layers loaded.
PyAEDT INFO: Primitives loaded.
PyAEDT INFO: Modeler class has been initialized! Elapsed time: 0m 0sec
PyAEDT INFO: Closing the AEDT Project 64_siwave_multi_zones
PyAEDT INFO: Project 64_siwave_multi_zones closed correctly
PyAEDT INFO: Parsing C:/Users/ansys/AppData/Local/Temp/tmp4byxkqko.ansys/multizone_clipped_circuit.aedt.
PyAEDT INFO: File C:/Users/ansys/AppData/Local/Temp/tmp4byxkqko.ansys/multizone_clipped_circuit.aedt correctly loaded. Elapsed time: 0m 0sec
PyAEDT INFO: aedt file load time 0.0156252384185791
PyAEDT INFO: Project multizone_clipped_circuit Saved correctly
[10]:
True
Set up simulation#
Add Nexxim LNA simulation setup.
[11]:
circuit_setup = circuit.create_setup("Pyedt_LNA")
Add frequency sweep#
Add a frequency sweep from 0 GHt to 20 GHz with a 10 NHz frequency step.
[12]:
circuit_setup.props["SweepDefinition"]["Data"] = "LIN {} {} {}".format(
"0GHz", "20GHz", "10MHz"
)
Start simulation#
Analyze all SIwave projects and solve the circuit.
[13]:
circuit.analyze()
PyAEDT INFO: Key Desktop/ActiveDSOConfigurations/Circuit Design correctly changed.
PyAEDT INFO: Solving all design setups.
PyAEDT INFO: Key Desktop/ActiveDSOConfigurations/Circuit Design correctly changed.
PyAEDT INFO: Design setup None solved correctly in 0.0h 1.0m 4.0s
[13]:
True
Define differential pairs
[14]:
circuit.set_differential_pair(
differential_mode="U0",
assignment="U0.via_38.B2B_SIGP",
reference="U0.via_39.B2B_SIGN",
)
circuit.set_differential_pair(
differential_mode="U1",
assignment="U1.via_32.B2B_SIGP",
reference="U1.via_33.B2B_SIGN",
)
[14]:
True
Plot results.
[15]:
circuit.post.create_report(
expressions=["dB(S(U0,U0))", "dB(S(U1,U0))"], context="Differential Pairs"
)
PyAEDT INFO: Post class has been initialized! Elapsed time: 0m 0sec
[15]:
<ansys.aedt.core.visualization.report.standard.Standard at 0x1dfcd882230>
Release AEDT#
Release AEDT and close the example.
[16]:
circuit.save_project()
circuit.release_desktop()
# Wait 3 seconds to allow AEDT to shut down before cleaning the temporary directory.
time.sleep(3)
PyAEDT INFO: Project multizone_clipped_circuit Saved correctly
PyAEDT INFO: Desktop has been released and closed.
Clean up#
All project files are saved in the folder temp_folder.name
. If you’ve run this example as a Jupyter notebook, you can retrieve those project files. The following cell removes all temporary files, including the project folder.
[17]:
temp_folder.cleanup()
Download this example
Download this example as a Jupyter Notebook or as a Python script.