Skip to content

Place on target's outermost signal layer #936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,12 @@ scratch_notebooks/

# Visual studio code local settings
.vscode/

# EDB temp and backup files
*.aedb.bak/
edb.def.bak
edb.def.tmp
edb.def\+
model.index.bak
model.index.tmp
model.index\+
Binary file added _unittest/example_models/chip.aedb/edb.def
Binary file not shown.
Binary file not shown.
Binary file not shown.
80 changes: 80 additions & 0 deletions _unittest/test_00_EDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,3 +765,83 @@ def test_81_edb_with_dxf(self):
edb3 = Edb(dxf_path, edbversion=desktop_version)
edb3.close_edb()
del edb3

def test_82_place_on_lam_with_mold(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(os.path.join(local_path, "example_models", "chip.aedb"), edbversion=desktop_version)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=False, place_on_top=True
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(zeroValue)
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(170e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()

def test_82b_place_on_bottom_of_lam_with_mold(self):
laminateEdb = Edb(os.path.join(local_path, "example_models", "lam_with_mold.aedb"), edbversion=desktop_version)
chipEdb = Edb(
os.path.join(local_path, "example_models", "chip_flipped_stackup.aedb"), edbversion=desktop_version
)
try:
layout = laminateEdb.active_layout
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 0
assert chipEdb.core_stackup.place_in_layout_3d_placement(
laminateEdb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=False, place_on_top=False
)
merged_cell = chipEdb.edb.Cell.Cell.FindByName(
chipEdb.db, chipEdb.edb.Cell.CellType.CircuitCell, "lam_with_mold"
)
assert not merged_cell.IsNull()
layout = merged_cell.GetLayout()
cellInstances = list(layout.CellInstances)
assert len(cellInstances) == 1
cellInstance = cellInstances[0]
assert cellInstance.Is3DPlacement()
if is_ironpython:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation()
else:
res, localOrigin, rotAxisFrom, rotAxisTo, angle, loc = cellInstance.Get3DTransformation(
None, None, None, None, None
)
assert res
zeroValue = chipEdb.edb_value(0)
oneValue = chipEdb.edb_value(1)
originPoint = chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, zeroValue)
xAxisPoint = chipEdb.edb.Geometry.Point3DData(oneValue, zeroValue, zeroValue)
assert localOrigin.IsEqual(originPoint)
assert rotAxisFrom.IsEqual(xAxisPoint)
assert rotAxisTo.IsEqual(xAxisPoint)
assert angle.IsEqual(zeroValue)
assert loc.IsEqual(chipEdb.edb.Geometry.Point3DData(zeroValue, zeroValue, chipEdb.edb_value(-90e-6)))
finally:
chipEdb.close_edb()
laminateEdb.close_edb()
56 changes: 20 additions & 36 deletions pyaedt/edb_core/stackup.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,60 +529,44 @@ def place_in_layout_3d_placement(
sig_set = self._edb.Cell.LayerTypeSet.SignalLayerSet

if is_ironpython: # pragma: no cover
res = stackup_target.GetTopBottomStackupLayers(stack_set)
target_top_thick = res[2]
target_bottom_thick = res[4]
res = stackup_target.GetTopBottomStackupLayers(sig_set)
target_top_elevation = res[2]
target_bottom_elevation = res[4]
res_s = stackup_source.GetTopBottomStackupLayers(stack_set)
source_stack_top_thick = res_s[2]
source_stack_bot_thick = res_s[4]
res2 = stackup_source.GetTopBottomStackupLayers(sig_set)
source_sig_top_thick = res2[2]
source_sig_bot_thick = res2[4]
source_stack_top_elevation = res_s[2]
source_stack_bot_elevation = res_s[4]
else:
target_top = None
target_top_thick = Double(0.0)
target_top_elevation = Double(0.0)
target_bottom = None
target_bottom_thick = Double(0.0)
source_sig_top = None
source_sig_top_thick = Double(0.0)
source_sig_bot = None
source_sig_bot_thick = Double(0.0)
target_bottom_elevation = Double(0.0)
source_stack_top = None
source_stack_top_thick = Double(0.0)
source_stack_top_elevation = Double(0.0)
source_stack_bot = None
source_stack_bot_thick = Double(0.0)
source_stack_bot_elevation = Double(0.0)
res = stackup_target.GetTopBottomStackupLayers(
stack_set, target_top, target_top_thick, target_bottom, target_bottom_thick
sig_set, target_top, target_top_elevation, target_bottom, target_bottom_elevation
)

res_s = stackup_source.GetTopBottomStackupLayers(
stack_set, source_stack_top, source_stack_top_thick, source_stack_bot, source_stack_bot_thick
stack_set, source_stack_top, source_stack_top_elevation, source_stack_bot, source_stack_bot_elevation
)
res2 = stackup_source.GetTopBottomStackupLayers(
sig_set, source_sig_top, source_sig_top_thick, source_sig_bot, source_sig_bot_thick
)
target_top_thick = res[2]
target_bottom_thick = res[4]
source_stack_top_thick = res_s[2]
source_stack_bot_thick = res_s[4]
source_sig_top_thick = res2[2]
source_sig_bot_thick = res2[4]
target_top_elevation = res[2]
target_bottom_elevation = res[4]
source_stack_top_elevation = res_s[2]
source_stack_bot_elevation = res_s[4]
if place_on_top and flipped_stackup:
elevation = target_top_thick + source_stack_top_thick
diel_elevation = source_stack_top_thick - source_sig_top_thick
elevation = target_top_elevation + source_stack_top_elevation
elif place_on_top:
elevation = target_top_thick + source_stack_bot_thick
diel_elevation = source_sig_bot_thick - source_stack_bot_thick
elevation = target_top_elevation + source_stack_bot_elevation
elif flipped_stackup:
elevation = target_bottom_thick - source_stack_bot_thick
diel_elevation = source_stack_bot_thick - source_sig_bot_thick
elevation = target_bottom_elevation - source_stack_bot_elevation
solder_height = -solder_height
else:
elevation = target_bottom_thick - source_sig_top_thick
diel_elevation = target_bottom_thick - source_stack_bot_thick
elevation = target_bottom_elevation - source_stack_top_elevation
solder_height = -solder_height

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

zero_data = self._edb_value(0.0)
one_data = self._edb_value(1.0)
Expand Down