Skip to content

Commit

Permalink
test #93 done
Browse files Browse the repository at this point in the history
  • Loading branch information
svandenb-dev committed Oct 29, 2024
1 parent a5c5779 commit cdf2125
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 56 deletions.
11 changes: 6 additions & 5 deletions src/pyedb/grpc/edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,9 @@ def _create_convex_hull(
p = insts[i].position
pos_1 = [i - 1e-12 for i in p]
pos_2 = [i + 1e-12 for i in p]
plane = self.modeler.Shape("rectangle", pointA=pos_1, pointB=pos_2)
rectangle_data = self.modeler.shape_to_polygon_data(plane)
pos_3 = [pos_2[0], pos_1[1]]
pos_4 = pos_1[0], pos_2[1]
rectangle_data = GrpcPolygonData(points=[pos_1, pos_3, pos_2, pos_4])
_polys.append(rectangle_data)
for prim in self.modeler.primitives:
if not prim.is_null and not prim.net.is_null:
Expand Down Expand Up @@ -1890,21 +1891,21 @@ def _create_cutout_multithread(
"SParameterModel",
"NetlistModel",
] and list(set(el.nets[:]) & set(signal_list[:])):
pins_to_preserve.extend([i.id for i in el.pins.values()])
pins_to_preserve.extend([i.edb_uid for i in el.pins.values()])
nets_to_preserve.extend(el.nets)
if include_pingroups:
for pingroup in self.layout.pin_groups:
for pin in pingroup.pins.values():
if pin.net_name in reference_list:
pins_to_preserve.append(pin.id)
pins_to_preserve.append(pin.edb_uid)
if check_terminals:
terms = [
term for term in self.layout.terminals if term.boundary_type in get_terminal_supported_boundary_types()
]
for term in terms:
if isinstance(term, PadstackInstanceTerminal):
if term.net.name in reference_list:
pins_to_preserve.append(term.id)
pins_to_preserve.append(term.edb_uid)

for i in self.nets.nets.values():
name = i.name
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
local_path = os.path.dirname(os.path.realpath(__file__))

# Initialize default desktop configuration
desktop_version = "2024.2"
desktop_version = "2025.2"
if "ANSYSEM_ROOT{}".format(desktop_version[2:].replace(".", "")) not in list_installed_ansysem():
desktop_version = list_installed_ansysem()[0][12:].replace(".", "")
desktop_version = "20{}.{}".format(desktop_version[:2], desktop_version[-1])
Expand Down
67 changes: 17 additions & 50 deletions tests/grpc/system/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,56 +336,23 @@ def test_create_custom_cutout_3(self, edb_examples):

def test_create_custom_cutout_4(self, edb_examples):
"""Create custom cutout 4."""
pass
# edbapp = edb_examples.get_si_verse()
# edbapp.components.create_pingroup_from_pins(
# [i for i in list(edbapp.components.instances["U1"].pins.values()) if i.net_name == "GND"]
# )
#
# assert edbapp.cutout(
# signal_list=["DDR4_DQS0_P", "DDR4_DQS0_N"],
# reference_list=["GND"],
# number_of_threads=4,
# extent_type="ConvexHull",
# use_pyaedt_extent_computing=True,
# include_pingroups=True,
# check_terminals=True,
# expansion_factor=4,
# )
# edbapp.close()
# source_path = os.path.join(local_path, "example_models", test_subfolder, "MicrostripSpliGnd.aedb")
# target_path = os.path.join(self.local_scratch.path, "MicrostripSpliGnd.aedb")
# self.local_scratch.copyfolder(source_path, target_path)
#
# edbapp = Edb(target_path, edbversion=desktop_version, restart_rpc_server=True)
#
# assert edbapp.cutout(
# signal_list=["trace_n"],
# reference_list=["ground"],
# number_of_threads=4,
# extent_type="Conformal",
# use_pyaedt_extent_computing=True,
# check_terminals=True,
# expansion_factor=2,
# include_voids_in_extents=True,
# )
# edbapp.close()
# source_path = os.path.join(local_path, "example_models", test_subfolder, "Multizone_GroundVoids.aedb")
# target_path = os.path.join(self.local_scratch.path, "Multizone_GroundVoids.aedb")
# self.local_scratch.copyfolder(source_path, target_path)
#
# edbapp = Edb(target_path, edbversion=desktop_version)
#
# assert edbapp.cutout(
# signal_list=["DIFF_N", "DIFF_P"],
# reference_list=["GND"],
# number_of_threads=4,
# extent_type="Conformal",
# use_pyaedt_extent_computing=True,
# check_terminals=True,
# expansion_factor=3,
# )
# edbapp.close()
# Done
edbapp = edb_examples.get_si_verse()
edbapp.components.create_pingroup_from_pins(
[i for i in list(edbapp.components.instances["U1"].pins.values()) if i.net_name == "GND"]
)

assert edbapp.cutout(
signal_list=["DDR4_DQS0_P", "DDR4_DQS0_N"],
reference_list=["GND"],
number_of_threads=4,
extent_type="ConvexHull",
use_pyaedt_extent_computing=True,
include_pingroups=True,
check_terminals=True,
expansion_factor=4,
)
edbapp.close()

def test_export_to_hfss(self):
"""Export EDB to HFSS."""
Expand Down

0 comments on commit cdf2125

Please sign in to comment.