Skip to content

Commit 7949740

Browse files
committed
Correct bottom unflipped placement
Add a test for correct placement when the source design is unflipped and the target design has a dielectric layer on the bottom. To get it working remove the dielectric elevation calculation from the Z-offset calculation in place_in_layout_3d_placement and then clean up unused top/bottom signal layers from the source stackup. Behavior now should be to align the top/bottom source stackup layer with the top/bottom target signal layer depending on the values of (flipped_stackup, place_on_top).
1 parent 88bc58b commit 7949740

File tree

5 files changed

+53
-22
lines changed

5 files changed

+53
-22
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,3 +367,12 @@ scratch_notebooks/
367367

368368
# Visual studio code local settings
369369
.vscode/
370+
371+
# EDB temp and backup files
372+
*.aedb.bak/
373+
edb.def.bak
374+
edb.def.tmp
375+
edb.def\+
376+
model.index.bak
377+
model.index.tmp
378+
model.index\+
Binary file not shown.
365 Bytes
Binary file not shown.

_unittest/test_00_EDB.py

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import _unittest_ironpython.conf_unittest as pytest
2121

2222

23-
class TestGalileo(BasisTest, object):
23+
class TestClass(BasisTest, object):
2424
def setup_class(self):
2525
BasisTest.my_setup(self)
2626
self.edbapp = BasisTest.add_edb(self, test_project_name)
@@ -766,9 +766,7 @@ def test_81_edb_with_dxf(self):
766766
edb3.close_edb()
767767
del edb3
768768

769-
770-
class TestOthers(BasisTest, object):
771-
def test_00_place_on_lam_with_mold(self):
769+
def test_82_place_on_lam_with_mold(self):
772770
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
773771
chipEdb = Edb(os.path.join(local_path, "example_models", "chip.aedb"), edbversion=desktop_version)
774772
try:
@@ -806,3 +804,43 @@ def test_00_place_on_lam_with_mold(self):
806804
finally:
807805
chipEdb.close_edb()
808806
laminateEdb.close_edb()
807+
808+
def test_82b_place_on_bottom_of_lam_with_mold(self):
809+
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
810+
chipEdb = Edb(os.path.join(local_path, "example_models", "chip_flipped_stackup.aedb"), edbversion=desktop_version)
811+
try:
812+
layout = laminateEdb.active_layout
813+
cellInstances = list(layout.CellInstances)
814+
assert len(cellInstances) == 0
815+
assert chipEdb.core_stackup.place_in_layout_3d_placement(
816+
laminateEdb,
817+
angle=0.0,
818+
offset_x=0.0,
819+
offset_y=0.0,
820+
flipped_stackup=False,
821+
place_on_top=False
822+
)
823+
merged_cell = chipEdb.edb.Cell.Cell.FindByName(chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, 'lam_with_mold')
824+
assert not merged_cell.IsNull()
825+
layout = merged_cell.GetLayout()
826+
cellInstances = list(layout.CellInstances)
827+
assert len(cellInstances) == 1
828+
cellInstance = cellInstances[0]
829+
assert cellInstance.Is3DPlacement()
830+
if is_ironpython:
831+
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
832+
else:
833+
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(None, None, None, None, None)
834+
assert res
835+
zeroValue = chipEdb.edb_value(0)
836+
oneValue = chipEdb.edb_value(1)
837+
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
838+
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
839+
assert localOrigin.IsEqual(originPoint)
840+
assert rotAxisFrom.IsEqual(xAxisPoint)
841+
assert rotAxisTo.IsEqual(xAxisPoint)
842+
assert angle.IsEqual(zeroValue)
843+
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(-90e-6)))
844+
finally:
845+
chipEdb.close_edb()
846+
laminateEdb.close_edb()

pyaedt/edb_core/stackup.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -535,18 +535,11 @@ def place_in_layout_3d_placement(
535535
res_s = stackup_source.GetTopBottomStackupLayers(stack_set)
536536
source_stack_top_elevation = res_s[2]
537537
source_stack_bot_elevation = res_s[4]
538-
res2 = stackup_source.GetTopBottomStackupLayers(sig_set)
539-
source_sig_top_elevation = res2[2]
540-
source_sig_bot_elevation = res2[4]
541538
else:
542539
target_top = None
543540
target_top_elevation = Double(0.0)
544541
target_bottom = None
545542
target_bottom_elevation = Double(0.0)
546-
source_sig_top = None
547-
source_sig_top_elevation = Double(0.0)
548-
source_sig_bot = None
549-
source_sig_bot_elevation = Double(0.0)
550543
source_stack_top = None
551544
source_stack_top_elevation = Double(0.0)
552545
source_stack_bot = None
@@ -558,31 +551,22 @@ def place_in_layout_3d_placement(
558551
res_s = stackup_source.GetTopBottomStackupLayers(
559552
stack_set, source_stack_top, source_stack_top_elevation, source_stack_bot, source_stack_bot_elevation
560553
)
561-
res2 = stackup_source.GetTopBottomStackupLayers(
562-
sig_set, source_sig_top, source_sig_top_elevation, source_sig_bot, source_sig_bot_elevation
563-
)
564554
target_top_elevation = res[2]
565555
target_bottom_elevation = res[4]
566556
source_stack_top_elevation = res_s[2]
567557
source_stack_bot_elevation = res_s[4]
568-
source_sig_top_elevation = res2[2]
569-
source_sig_bot_elevation = res2[4]
570558
if place_on_top and flipped_stackup:
571559
elevation = target_top_elevation + source_stack_top_elevation
572-
diel_elevation = source_stack_top_elevation - source_sig_top_elevation
573560
elif place_on_top:
574561
elevation = target_top_elevation + source_stack_bot_elevation
575-
diel_elevation = source_sig_bot_elevation - source_stack_bot_elevation
576562
elif flipped_stackup:
577563
elevation = target_bottom_elevation - source_stack_bot_elevation
578-
diel_elevation = source_stack_bot_elevation - source_sig_bot_elevation
579564
solder_height = -solder_height
580565
else:
581-
elevation = target_bottom_elevation - source_sig_top_elevation
582-
diel_elevation = target_bottom_elevation - source_stack_bot_elevation
566+
elevation = target_bottom_elevation - source_stack_top_elevation
583567
solder_height = -solder_height
584568

585-
h_stackup = self._edb_value(elevation + solder_height - diel_elevation)
569+
h_stackup = self._edb_value(elevation + solder_height)
586570

587571
zero_data = self._edb_value(0.0)
588572
one_data = self._edb_value(1.0)

0 commit comments

Comments
 (0)