Skip to content

Commit

Permalink
FEAT: Via fencing improvement supporting specific angle (#693)
Browse files Browse the repository at this point in the history
* hfsspi SimsetupInfo bug fixed

* temp

* via fence improved

* via fence improved
  • Loading branch information
svandenb-dev authored Jul 24, 2024
1 parent a69b72b commit 32ea833
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
10 changes: 9 additions & 1 deletion src/pyedb/dotnet/edb_core/padstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,9 @@ def get_padstack_instances_intersecting_bounding_box(self, bounding_box, nets=No
bounding_box = tuple(bounding_box)
return list(index.intersection(bounding_box))

def merge_via_along_lines(self, net_name="GND", distance_threshold=5e-3, minimum_via_number=6):
def merge_via_along_lines(
self, net_name="GND", distance_threshold=5e-3, minimum_via_number=6, selected_angles=None
):
"""Replace padstack instances along lines into a single polygon.
Detect all padstack instances that are placed along lines and replace them by a single polygon based one
Expand All @@ -1598,6 +1600,11 @@ def merge_via_along_lines(self, net_name="GND", distance_threshold=5e-3, minimum
minimum_via_number : int, optional
The minimum number of points that a line must contain. Default is ``6``.
selected_angles : list[int, float]
Specify angle in degrees to detected, for instance [0, 180] is only detecting horizontal and vertical lines.
Other values can be assigned like 45 degrees. When `None` is provided all lines are detected. Default value
is `None`.
Returns
-------
bool
Expand All @@ -1622,6 +1629,7 @@ def merge_via_along_lines(self, net_name="GND", distance_threshold=5e-3, minimum
points=instances_location,
minimum_number_of_points=minimum_via_number,
distance_threshold=distance_threshold,
selected_angles=selected_angles,
)
for line in line_indexes:
[_instances_to_delete.append(pdstk_series[ind]) for ind in line]
Expand Down
15 changes: 12 additions & 3 deletions tests/legacy/system/test_edb_padstacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,13 +430,22 @@ def test_polygon_based_padsatck(self):

def test_via_fence(self):
source_path = os.path.join(local_path, "example_models", test_subfolder, "via_fence_generic_project.aedb")
target_path = os.path.join(self.local_scratch.path, "test_pvia_fence", "via_fence.aedb")
self.local_scratch.copyfolder(source_path, target_path)
edbapp = Edb(target_path, edbversion=desktop_version)
target_path1 = os.path.join(self.local_scratch.path, "test_pvia_fence", "via_fence1.aedb")
target_path2 = os.path.join(self.local_scratch.path, "test_pvia_fence", "via_fence2.aedb")
self.local_scratch.copyfolder(source_path, target_path1)
self.local_scratch.copyfolder(source_path, target_path2)
edbapp = Edb(target_path1, edbversion=desktop_version)
assert edbapp.padstacks.merge_via_along_lines(net_name="GND", distance_threshold=2e-3, minimum_via_number=6)
assert not edbapp.padstacks.merge_via_along_lines(
net_name="test_dummy", distance_threshold=2e-3, minimum_via_number=6
)
assert "main_via" in edbapp.padstacks.definitions
assert "via_central" in edbapp.padstacks.definitions
edbapp.close()
edbapp = Edb(target_path2, edbversion=desktop_version)
assert edbapp.padstacks.merge_via_along_lines(
net_name="GND", distance_threshold=2e-3, minimum_via_number=6, selected_angles=[0, 180]
)
assert "main_via" in edbapp.padstacks.definitions
assert "via_central" in edbapp.padstacks.definitions
edbapp.close()

0 comments on commit 32ea833

Please sign in to comment.