-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into upgrade_2025r1_jv
- Loading branch information
Showing
61 changed files
with
4,320 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ test_results-*.xml | |
.env | ||
.venv | ||
env/ | ||
venv/ | ||
venv*/ | ||
/venv/ | ||
ENV/ | ||
env.bak/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# # EDB: Edit Control File and import gds | ||
# | ||
# This example demonstrates how to import a gds layout for subsequent | ||
# simulation with HFSS. | ||
|
||
# Perform imports. | ||
|
||
# + | ||
import os | ||
import shutil | ||
import tempfile | ||
|
||
import pyedb | ||
from pyedb.dotnet.edb_core.edb_data.control_file import ControlFile | ||
from pyedb.misc.downloads import download_file | ||
|
||
# - | ||
|
||
# ## Fetch Example Data | ||
# | ||
# Download the EDB folder and copy it to a temporary folder. | ||
# The following files are used in this example: | ||
# | ||
# - _sky130_fictious_dtc_exmple_contol_no_map.xml_ | ||
# defines physical information such | ||
# as material properties, stackup layers, and boundary conditions. | ||
# - _dummy_layermap.map_ | ||
# maps properties to stackup layers. | ||
|
||
# + | ||
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") | ||
control_fn = "sky130_fictitious_dtc_example_control_no_map.xml" | ||
gds_fn = "sky130_fictitious_dtc_example.gds" | ||
layer_map = "dummy_layermap.map" | ||
|
||
local_path = download_file("gds", destination=temp_dir.name) | ||
c_file_in = os.path.join(local_path, control_fn) | ||
c_map = os.path.join(local_path, layer_map) | ||
gds_in = os.path.join(local_path, gds_fn) | ||
gds_out = os.path.join(temp_dir.name, "gds_out.gds") | ||
shutil.copy2(gds_in, gds_out) | ||
# - | ||
|
||
# ## Control file | ||
# | ||
# A Control file is an xml file which purpose if to provide additional information during | ||
# import phase. It can include, materials, stackup, setup, boundaries and settings. | ||
# In this example we will import an existing xml, integrate it with a layer mapping file of gds | ||
# and then adding setup and boundaries. | ||
|
||
c = ControlFile(c_file_in, layer_map=c_map) | ||
|
||
# ## Set up simulation | ||
# | ||
# This code sets up a simulation with HFSS and adds a frequency sweep. | ||
|
||
setup = c.setups.add_setup("Setup1", "1GHz", 0.02, 10) | ||
setup.add_sweep("Sweep1", "0.01GHz", "5GHz", "0.1GHz") | ||
|
||
# ## Provide additional stackup settings | ||
# | ||
# After import, you can change the stackup settings and add or remove layers or materials. | ||
|
||
c.stackup.units = "um" | ||
c.stackup.dielectrics_base_elevation = -100 | ||
c.stackup.metal_layer_snapping_tolerance = "10nm" | ||
for via in c.stackup.vias: | ||
via.create_via_group = True | ||
via.snap_via_group = True | ||
|
||
# ## Define boundary settings | ||
# | ||
# Boundaries can include ports, components and boundary extent. | ||
|
||
c.boundaries.units = "um" | ||
c.boundaries.add_port("P1", x1=223.7, y1=222.6, layer1="Metal6", x2=223.7, y2=100, layer2="Metal6") | ||
c.boundaries.add_extent() | ||
comp = c.components.add_component("B1", "BGA", "IC", "Flip chip", "Cylinder") | ||
comp.solder_diameter = "65um" | ||
comp.add_pin("1", "81.28", "84.6", "met2") | ||
comp.add_pin("2", "211.28", "84.6", "met2") | ||
comp.add_pin("3", "211.28", "214.6", "met2") | ||
comp.add_pin("4", "81.28", "214.6", "met2") | ||
c.import_options.import_dummy_nets = True | ||
|
||
# ## Write XML file | ||
# | ||
# After all settings are ready, you can write an XML file. | ||
|
||
c.write_xml(os.path.join(temp_dir.name, "output.xml")) | ||
|
||
# ## Open EDB | ||
# | ||
# Import the gds and open the edb. | ||
|
||
# + | ||
# Select EDB version (change it manually if needed, e.g. "2024.2") | ||
edb_version = "2024.2" | ||
print(f"EDB version: {edb_version}") | ||
|
||
edb = pyedb.Edb(gds_out, edbversion=edb_version, technology_file=os.path.join(temp_dir.name, "output.xml")) | ||
# - | ||
|
||
# ## Plot stackup | ||
# | ||
# Plot the stackup. | ||
|
||
edb.stackup.plot(first_layer="met1") | ||
|
||
# ## Close EDB | ||
# | ||
# Close the project. | ||
|
||
edb.close_edb() | ||
|
||
# Clean up the temporary folder. | ||
|
||
temp_dir.cleanup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# # EDB: plot nets with Matplotlib | ||
# | ||
# This example shows how to use the ``Edb`` class to view nets, layers and | ||
# via geometry directly in Python. The methods demonstrated in this example | ||
# rely on | ||
# [matplotlib](https://matplotlib.org/cheatsheets/_images/cheatsheets-1.png). | ||
|
||
# ## Perform required imports | ||
# | ||
# Perform required imports, which includes importing a section. | ||
|
||
# + | ||
import tempfile | ||
|
||
import pyedb | ||
from pyedb.misc.downloads import download_file | ||
|
||
# - | ||
|
||
# ## Download the EDB and copy it into the temporary folder. | ||
|
||
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") | ||
targetfolder = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) | ||
|
||
# ## Create an instance of the Electronics Database using the `pyedb.Edb` class. | ||
# | ||
# > Note that units are SI. | ||
|
||
# + | ||
# Select EDB version (change it manually if needed, e.g. "2024.2") | ||
edb_version = "2024.2" | ||
print(f"EDB version: {edb_version}") | ||
|
||
edb = pyedb.Edb(edbpath=targetfolder, edbversion=edb_version) | ||
# - | ||
|
||
# Display the nets on a layer. You can display the net geometry directly in Python using | ||
# ``matplotlib`` from the ``pyedb.Edb`` class. | ||
|
||
edb.nets.plot("AVCC_1V3") | ||
|
||
# You can view multiple nets by passing a list containing the net | ||
# names to the ``plot()`` method. | ||
|
||
edb.nets.plot(["GND", "GND_DP", "AVCC_1V3"], color_by_net=True) | ||
|
||
# You can display all copper on a single layer by passing ``None`` | ||
# as the first argument. The second argument is a list | ||
# of layers to plot. In this case, only one | ||
# layer is to be displayed. | ||
|
||
edb.nets.plot(None, ["1_Top"], color_by_net=True, plot_components_on_top=True) | ||
|
||
# Display a side view of the layers and padstack geometry using the | ||
# ``Edb.stackup.plot()`` method. | ||
|
||
edb.stackup.plot(scale_elevation=False, plot_definitions=["c100hn140", "c35"]) | ||
|
||
# ## Creating coaxial port on component U1 and all ddr4_dqs nets | ||
# Selecting all nets from ddr4_dqs and component U1 and create coaxial ports | ||
# On corresponding pins. | ||
|
||
comp_u1 = edb.components.instances["U1"] | ||
signal_nets = [net for net in comp_u1.nets if "ddr4_dqs" in net.lower()] | ||
edb.hfss.create_coax_port_on_component("U1", net_list=signal_nets) | ||
edb.components.set_solder_ball(component="U1", sball_diam="0.3mm", sball_height="0.3mm") | ||
|
||
# ## Renaming all ports | ||
# Renaming all port with _renamed string as suffix example. | ||
|
||
for port_name, port in edb.ports.items(): | ||
port.name = f"{port_name}_renamed" | ||
|
||
|
||
# Close the EDB. | ||
|
||
edb.close_edb() | ||
|
||
# Remove all files and the temporary directory. | ||
|
||
temp_dir.cleanup() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# # EDB: geometry creation | ||
|
||
# This example shows how you can use EDB to create a layout. | ||
# ## Final expected project | ||
# | ||
# <img src="_static/diff_via.png" width="500"> | ||
# | ||
# ## Import EDB layout object | ||
# Import the EDB layout object and initialize it on version 2023 R2. | ||
|
||
# + | ||
import os | ||
import tempfile | ||
|
||
import pyedb | ||
|
||
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") | ||
aedb_path = os.path.join(temp_dir.name, "create_via.aedb") | ||
print(f"AEDB file path: {aedb_path}") | ||
|
||
# Select EDB version (change it manually if needed, e.g. "2024.2") | ||
edb_version = "2024.2" | ||
print(f"EDB version: {edb_version}") | ||
|
||
edb = pyedb.Edb(edbpath=aedb_path, edbversion=edb_version) | ||
# - | ||
|
||
# ## Add stackup layers | ||
# Add stackup layers. | ||
# A stackup can be created layer by layer or imported from a CSV file or XML file. | ||
|
||
edb.stackup.add_layer("GND") | ||
edb.stackup.add_layer("Diel", "GND", layer_type="dielectric", thickness="0.1mm", material="FR4_epoxy") | ||
edb.stackup.add_layer("TOP", "Diel", thickness="0.05mm") | ||
|
||
# ## Create signal net and ground planes | ||
# Create a signal net and ground planes. | ||
|
||
points = [[0.0, 0], [100e-3, 0.0]] | ||
edb.modeler.create_trace(points, "TOP", width=1e-3) | ||
points = [[0.0, 1e-3], [0.0, 10e-3], [100e-3, 10e-3], [100e-3, 1e-3], [0.0, 1e-3]] | ||
edb.modeler.create_polygon(points, "TOP") | ||
points = [[0.0, -1e-3], [0.0, -10e-3], [100e-3, -10e-3], [100e-3, -1e-3], [0.0, -1e-3]] | ||
edb.modeler.create_polygon(points, "TOP") | ||
|
||
|
||
# ## Create vias with parametric positions | ||
# Create vias with parametric positions. | ||
|
||
edb.padstacks.create("MyVia") | ||
edb.padstacks.place([5e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([15e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([35e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([45e-3, 5e-3], "MyVia") | ||
edb.padstacks.place([5e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([15e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([35e-3, -5e-3], "MyVia") | ||
edb.padstacks.place([45e-3, -5e-3], "MyVia") | ||
|
||
|
||
# ## Generate geometry plot | ||
|
||
edb.nets.plot(None, color_by_net=True) | ||
|
||
# ## Generate stackup plot | ||
|
||
edb.stackup.plot(plot_definitions="MyVia") | ||
|
||
# ## Save and close EDB | ||
# Save and close EDB. | ||
|
||
if edb: | ||
edb.save_edb() | ||
edb.close_edb() | ||
print("EDB saved correctly to {}. You can import in AEDT.".format(aedb_path)) | ||
|
||
# ### Clean up temporary directory | ||
# | ||
# The following command removes the project and the temporary directory. | ||
# If you'd like to save this project, save it to a folder of your choice | ||
# prior to running the following cell. | ||
|
||
temp_dir.cleanup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# # EDB: IPC2581 export | ||
# | ||
# This example shows how you can use PyAEDT to export an IPC2581 file. | ||
# | ||
# Perform required imports, which includes importing a section. | ||
|
||
# + | ||
import os | ||
import tempfile | ||
|
||
import pyedb | ||
from pyedb.generic.general_methods import generate_unique_name | ||
from pyedb.misc.downloads import download_file | ||
|
||
# - | ||
|
||
# ## Download the AEDB file and copy it in the temporary folder. | ||
|
||
temp_dir = tempfile.TemporaryDirectory(suffix=".ansys") | ||
targetfile = download_file("edb/ANSYS-HSD_V1.aedb", destination=temp_dir.name) | ||
ipc2581_file_name = os.path.join(temp_dir.name, "Ansys_Hsd.xml") | ||
print(targetfile) | ||
|
||
# ## Launch EDB | ||
# | ||
# Launch the `pyedb.Edb` class, using EDB 2023. | ||
# > Note that length dimensions passed to EDB are in SI units. | ||
|
||
# + | ||
# Select EDB version (change it manually if needed, e.g. "2024.2") | ||
edb_version = "2024.2" | ||
print(f"EDB version: {edb_version}") | ||
|
||
edb = pyedb.Edb(edbpath=targetfile, edbversion=edb_version) | ||
# - | ||
|
||
# ## Parametrize the width of a trace. | ||
|
||
edb.modeler.parametrize_trace_width("A0_N", parameter_name=generate_unique_name("Par"), variable_value="0.4321mm") | ||
|
||
# ## Create a cutout and plot it. | ||
|
||
signal_list = [] | ||
for net in edb.nets.netlist: | ||
if "PCIe" in net: | ||
signal_list.append(net) | ||
power_list = ["GND"] | ||
edb.cutout( | ||
signal_list=signal_list, | ||
reference_list=power_list, | ||
extent_type="ConvexHull", | ||
expansion_size=0.002, | ||
use_round_corner=False, | ||
number_of_threads=4, | ||
remove_single_pin_components=True, | ||
use_pyaedt_extent_computing=True, | ||
extent_defeature=0, | ||
) | ||
edb.nets.plot(None, None, color_by_net=True) | ||
|
||
# ## Export the EDB to an IPC2581 file. | ||
|
||
edb.export_to_ipc2581(ipc2581_file_name, "inch") | ||
print("IPC2581 File has been saved to {}".format(ipc2581_file_name)) | ||
|
||
# ## Close EDB | ||
|
||
edb.close_edb() | ||
|
||
# ## Clean up the temporary directory | ||
|
||
temp_dir.cleanup() |
Oops, something went wrong.