Skip to content
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

Get component solder ball #611

Merged
merged 7 commits into from
Nov 30, 2021
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
3 changes: 3 additions & 0 deletions _unittest/test_00_EDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,6 @@ def test_67_add_void(self):

def test_68_flip_layer_stackup(self):
assert self.edbapp.core_stackup.flip_stackup_and_apply_transform()

def test_69_create_solder_balls_on_component(self):
assert self.edbapp.core_components.set_solder_ball("U2A5")
84 changes: 83 additions & 1 deletion pyaedt/edb_core/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pyaedt import generate_unique_name, _retry_ntimes
from pyaedt.edb_core.general import convert_py_list_to_net_list
from pyaedt.generic.general_methods import aedt_exception_handler, get_filename_without_extension, is_ironpython

from pyaedt.generic.constants import FlipChipOrientation
from pyaedt.edb_core.EDB_Data import EDBComponent

try:
Expand Down Expand Up @@ -378,6 +378,88 @@ def get_components_from_nets(self, netlist=None):
cmp_list.append(refdes)
return cmp_list

@aedt_exception_handler
def get_solder_ball_height(self, cmp):
"""Get component solder ball height.

Parameters
----------
cmp : str or self._edb.Cell.Hierarchy.Component
EDB component or str component name.

Returns
-------
double, bool
Salder ball height vale, ``False`` when failed.

"""
if cmp is not None:
if not(isinstance(cmp, self._edb.Cell.Hierarchy.Component)):
cmp = self.get_component_by_name(cmp)
cmp_prop = cmp.GetComponentProperty().Clone()
return cmp_prop.GetSolderBallProperty().GetHeight()
return False

@aedt_exception_handler
def set_solder_ball(self, cmp, sball_height=100e-6, sball_diam=150e-6, orientation=FlipChipOrientation.Up):
"""Define component solder ball ready for port assignment.

Parameters
----------
cmp : str or self._edb.Cell.Hierarchy.Component
Edb component or str component name..
sball_height : str or double
Solder balls height value.
sball_diam : str or double
Solder balls diameter value.
orientation : FlipChipOrientation
Gives the orientation for flip chip (only applied on IC component).
Returns
-------
bool
``True`` when successful, ``False`` when failed.

Examples
--------

>>> from pyaedt import Edb
>>> edbapp = Edb("myaedbfolder")
>>> set_solder_ball = edbapp.core_components.set_solder_ball("A1")

"""
if cmp is not None:
if not(isinstance(cmp, self._edb.Cell.Hierarchy.Component)):
cmp = self.get_component_by_name(cmp)
cmp_prop = cmp.GetComponentProperty().Clone()
cmp_type = cmp.GetComponentType()
if cmp_type == self._edb.Definition.ComponentType.IC:
die_prop = cmp_prop.GetDieProperty().Clone()
if orientation == FlipChipOrientation.Up:
if not die_prop.SetOrientation(self._edb.Definition.DieOrientation.ChipUp):
return False
else:
die_prop.SetOrientation(self._edb.Definition.DieOrientation.ChipDown)
if not cmp_prop.SetDieProperty(die_prop):
return False

solder_prop = cmp_prop.GetSolderBallProperty().Clone()
if not solder_prop.SetDiameter(self._edb_value(sball_diam), self._edb_value(sball_diam)):
return False
if not solder_prop.SetHeight(self._edb_value(sball_height)):
return False
if not cmp_prop.SetSolderBallProperty(solder_prop):
return False

port_prop = cmp_prop.GetPortProperty().Clone()
port_prop.SetReferenceSizeAuto(True)
cmp_prop.SetPortProperty(port_prop)
if not cmp.SetComponentProperty(cmp_prop):
return False

return True
else:
return False

@aedt_exception_handler
def create_component_from_pins(self, pins, component_name, placement_layer=None):
"""Create a component from pins.
Expand Down
8 changes: 7 additions & 1 deletion pyaedt/generic/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ class SWEEPDRAFT(object):
(Extended, Round, Natural, Mixed) = range(0, 4)


class FlipChipOrientation(object):
"""Chip orientation enumerator class."""

(Up, Down) = range(0, 2)


class SOLUTIONS(object):
"""Provides the names of default solution types."""

Expand Down Expand Up @@ -584,4 +590,4 @@ class GravityDirection(object):
.. deprecated:: 0.4.8
Use :func:`GRAVITY` instead."""

(XNeg, YNeg, ZNeg, XPos, YPos, ZPos) = range(0, 6)
(XNeg, YNeg, ZNeg, XPos, YPos, ZPos) = range(0, 6)