Stackup#

class pyedb.dotnet.database.stackup.Stackup(pedb, edb_object=None)#

Bases: LayerCollection

Manages EDB methods for stackup accessible from Edb.stackup property.

Overview#

create_symmetric_stackup

Create a symmetric stackup.

add_outline_layer

Add an outline layer named "Outline" if it is not present.

add_layer

Insert a layer into stackup.

remove_layer

Remove a layer from stackup.

export

Export stackup definition to a CSV or JSON file.

export_stackup

Export stackup definition to a CSV or JSON file.

stackup_limits

Retrieve stackup limits.

limits

Retrieve stackup limits.

flip_design

Flip the current design of a layout.

get_layout_thickness

Return the layout thickness.

adjust_solder_dielectrics

Adjust the stack-up by adding or modifying dielectric layers that contains Solder Balls.

place_in_layout

Place current Cell into another cell using layer placement method.

place_in_layout_3d_placement

Place current Cell into another cell using 3d placement method.

place_instance

Place current Cell into another cell using 3d placement method.

place_a3dcomp_3d_placement

Place a 3D Component into current layout.

residual_copper_area_per_layer

Report residual copper area per layer in percentage.

load

Import stackup from a file. The file format can be XML, CSV, or JSON. Valid control file must

plot

Plot current stackup and, optionally, overlap padstack definitions.

load_from_xml

Load stackup from a XML file.

layer_types

Layer types.

thickness

Retrieve Stackup thickness.

num_layers

Retrieve the stackup layer number.

mode

Stackup mode.

stackup_mode

Stackup mode.

signal_layers

Retrieve the dictionary of signal layers.

dielectric_layers

Dielectric layers.

Import detail#

from pyedb.dotnet.database.stackup import Stackup

Property detail#

property Stackup.layer_types#

Layer types.

Returns:
type

Types of layers.

property Stackup.thickness#

Retrieve Stackup thickness.

Returns:
float

Layout stackup thickness.

property Stackup.num_layers#

Retrieve the stackup layer number.

Returns:
int

layer number.

property Stackup.mode#

Stackup mode.

Returns:
int, str

Type of the stackup mode, where:

  • 0 - Laminate

  • 1 - Overlapping

  • 2 - MultiZone

property Stackup.stackup_mode#

Stackup mode.

Deprecated since version 0.6.52: Use mode() method instead.

Returns:
int, str

Type of the stackup mode, where:

  • 0 - Laminate

  • 1 - Overlapping

  • 2 - MultiZone

property Stackup.signal_layers#

Retrieve the dictionary of signal layers.

Returns:
Dict[str, pyedb.dotnet.database.edb_data.layer_data.LayerEdbClass]
property Stackup.dielectric_layers#

Dielectric layers.

Returns:
dict[str, dotnet.database.edb_data.layer_data.EDBLayer]

Dictionary of dielectric layers.

Method detail#

Stackup.__getitem__(item)#
Stackup.create_symmetric_stackup(layer_count, inner_layer_thickness='17um', outer_layer_thickness='50um', dielectric_thickness='100um', dielectric_material='FR4_epoxy', soldermask=True, soldermask_thickness='20um')#

Create a symmetric stackup.

Parameters:
layer_countint

Number of layer count.

inner_layer_thicknessstr, float, optional

Thickness of inner conductor layer.

outer_layer_thicknessstr, float, optional

Thickness of outer conductor layer.

dielectric_thicknessstr, float, optional

Thickness of dielectric layer.

dielectric_materialstr, optional

Material of dielectric layer.

soldermaskbool, optional

Whether to create soldermask layers. The default is``True``.

soldermask_thicknessstr, optional

Thickness of soldermask layer.

Returns:
bool
Stackup.add_outline_layer(outline_name='Outline')#

Add an outline layer named "Outline" if it is not present.

Returns:
bool

“True” if successful, False if failed.

Stackup.add_layer(layer_name, base_layer=None, method='add_on_top', layer_type='signal', material='copper', fillMaterial='FR4_epoxy', thickness='35um', etch_factor=None, is_negative=False, enable_roughness=False, elevation=None)#

Insert a layer into stackup.

Parameters:
layer_namestr

Name of the layer.

base_layerstr, optional

Name of the base layer.

methodstr, optional

Where to insert the new layer. The default is "add_on_top". Options are "add_on_top", "add_on_bottom", "insert_above", "insert_below", "add_at_elevation",.

layer_typestr, optional
Type of layer. The default is "signal". Options are "signal", "dielectric", "conducting",

"air_lines", "error", "symbol", "measure", "assembly", "silkscreen", "solder_mask", "solder_paste", "glue", "wirebond", "hfss_region", "user".

materialstr, optional

Material of the layer.

fillMaterialstr, optional

Fill material of the layer.

thicknessstr, float, optional

Thickness of the layer.

etch_factorint, float, optional

Etch factor of the layer.

is_negativebool, optional

Whether the layer is negative.

enable_roughnessbool, optional

Whether roughness is enabled.

elevationfloat, optional

Elevation of new layer. Only valid for Overlapping Stackup.

Returns:
pyedb.dotnet.database.edb_data.layer_data.LayerEdbClass
Stackup.remove_layer(name)#

Remove a layer from stackup.

Parameters:
namestr

Name of the layer to remove.

Returns:
Stackup.export(fpath, file_format='xml', include_material_with_layer=False)#

Export stackup definition to a CSV or JSON file.

Parameters:
fpathstr

File path to csv or json file.

file_formatstr, optional

Format of the file to export. The default is "csv". Options are "csv", "xlsx", "json".

include_material_with_layerbool, optional.

Whether to include the material definition inside layer ones. This parameter is only used when a JSON file is exported. The default is False, which keeps the material definition section in the JSON file. If True, the material definition is included inside the layer ones.

Examples

>>> from pyedb import Edb
>>> edb = Edb()
>>> edb.stackup.export("stackup.xml")
Stackup.export_stackup(fpath, file_format='xml', include_material_with_layer=False)#

Export stackup definition to a CSV or JSON file.

Deprecated since version 0.6.61: Use export() instead.

Parameters:
fpathstr

File path to CSV or JSON file.

file_formatstr, optional

Format of the file to export. The default is "csv". Options are "csv", "xlsx" and "json".

include_material_with_layerbool, optional.

Whether to include the material definition inside layer objects. This parameter is only used when a JSON file is exported. The default is False, which keeps the material definition section in the JSON file. If True, the material definition is included inside the layer ones.

Examples

>>> from pyedb import Edb
>>> edb = Edb()
>>> edb.stackup.export_stackup("stackup.xml")
Stackup.stackup_limits(only_metals=False)#

Retrieve stackup limits.

Deprecated since version 0.6.62: Use Edb.stackup.limits() function instead.

Parameters:
only_metalsbool, optional

Whether to retrieve only metals. The default is False.

Returns:
bool

True when successful, False when failed.

Stackup.limits(only_metals=False)#

Retrieve stackup limits.

Parameters:
only_metalsbool, optional

Whether to retrieve only metals. The default is False.

Returns:
bool

True when successful, False when failed.

Stackup.flip_design()#

Flip the current design of a layout.

Returns:
bool

True when succeed False if not.

Examples

>>> edb = Edb(edbpath=targetfile, edbversion="2021.2")
>>> edb.stackup.flip_design()
>>> edb.save()
>>> edb.close_edb()
Stackup.get_layout_thickness()#

Return the layout thickness.

Returns:
float

The thickness value.

Stackup.adjust_solder_dielectrics()#

Adjust the stack-up by adding or modifying dielectric layers that contains Solder Balls. This method identifies the solder-ball height and adjust the dielectric thickness on top (or bottom) to fit the thickness in order to merge another layout.

Returns:
bool
Stackup.place_in_layout(edb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=True, place_on_top=True)#

Place current Cell into another cell using layer placement method. Flip the current layer stackup of a layout if requested. Transform parameters currently not supported.

Parameters:
edbEdb

Cell on which to place the current layout. If None the Cell will be applied on an empty new Cell.

angledouble, optional

The rotation angle applied on the design.

offset_xdouble, optional

The x offset value.

offset_ydouble, optional

The y offset value.

flipped_stackupbool, optional

Either if the current layout is inverted. If True and place_on_top is True the stackup will be flipped before the merge.

place_on_topbool, optional

Either if place the current layout on Top or Bottom of destination Layout.

Returns:
bool

True when succeed False if not.

Examples

>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
>>> vector, rotation, solder_ball_height = edb1.components.get_component_placement_vector(
...     mounted_component=mounted_cmp,
...     hosting_component=hosting_cmp,
...     mounted_component_pin1="A12",
...     mounted_component_pin2="A14",
...     hosting_component_pin1="A12",
...     hosting_component_pin2="A14",
... )
>>> edb2.stackup.place_in_layout(
...     edb1.active_cell,
...     angle=0.0,
...     offset_x=vector[0],
...     offset_y=vector[1],
...     flipped_stackup=False,
...     place_on_top=True,
... )
Stackup.place_in_layout_3d_placement(edb, angle=0.0, offset_x=0.0, offset_y=0.0, flipped_stackup=True, place_on_top=True, solder_height=0)#

Place current Cell into another cell using 3d placement method. Flip the current layer stackup of a layout if requested. Transform parameters currently not supported.

Parameters:
edbEdb

Cell on which to place the current layout. If None the Cell will be applied on an empty new Cell.

angledouble, optional

The rotation angle applied on the design.

offset_xdouble, optional

The x offset value.

offset_ydouble, optional

The y offset value.

flipped_stackupbool, optional

Either if the current layout is inverted. If True and place_on_top is True the stackup will be flipped before the merge.

place_on_topbool, optional

Either if place the current layout on Top or Bottom of destination Layout.

solder_heightfloat, optional

Solder Ball or Bumps eight. This value will be added to the elevation to align the two layouts.

Returns:
bool

True when succeed False if not.

Examples

>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
>>> edb2.stackup.place_in_layout(
...     edb1.active_cell,
...     angle=0.0,
...     offset_x="1mm",
...     offset_y="2mm",
...     flipped_stackup=False,
...     place_on_top=True,
... )
Stackup.place_instance(component_edb, angle=0.0, offset_x=0.0, offset_y=0.0, offset_z=0.0, flipped_stackup=True, place_on_top=True, solder_height=0)#

Place current Cell into another cell using 3d placement method. Flip the current layer stackup of a layout if requested. Transform parameters currently not supported.

Parameters:
component_edbEdb

Cell to place in the current layout.

angledouble, optional

The rotation angle applied on the design.

offset_xdouble, optional

The x offset value. The default value is 0.0.

offset_ydouble, optional

The y offset value. The default value is 0.0.

offset_zdouble, optional

The z offset value. (i.e. elevation offset for placement relative to the top layer conductor). The default value is 0.0, which places the cell layout on top of the top conductor layer of the target EDB.

flipped_stackupbool, optional

Either if the current layout is inverted. If True and place_on_top is True the stackup will be flipped before the merge.

place_on_topbool, optional

Either if place the component_edb layout on Top or Bottom of destination Layout.

solder_heightfloat, optional

Solder Ball or Bumps eight. This value will be added to the elevation to align the two layouts.

Returns:
bool

True when succeed False if not.

Examples

>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
>>> edb2 = Edb(edbpath=targetfile2, edbversion="2021.2")
>>> hosting_cmp = edb1.components.get_component_by_name("U100")
>>> mounted_cmp = edb2.components.get_component_by_name("BGA")
>>> edb1.stackup.place_instance(
...     edb2,
...     angle=0.0,
...     offset_x="1mm",
...     offset_y="2mm",
...     flipped_stackup=False,
...     place_on_top=True,
... )
Stackup.place_a3dcomp_3d_placement(a3dcomp_path, angle=0.0, offset_x=0.0, offset_y=0.0, offset_z=0.0, place_on_top=True)#
Place a 3D Component into current layout.

3D Component ports are not visible via EDB. They will be visible after the EDB has been opened in Ansys Electronics Desktop as a project.

Parameters:
a3dcomp_pathstr

Path to the 3D Component file (*.a3dcomp) to place.

angledouble, optional

Clockwise rotation angle applied to the a3dcomp.

offset_xdouble, optional

The x offset value. The default value is 0.0.

offset_ydouble, optional

The y offset value. The default value is 0.0.

offset_zdouble, optional

The z offset value. (i.e. elevation) The default value is 0.0.

place_on_topbool, optional

Whether to place the 3D Component on the top or the bottom of this layout. If False then the 3D Component will also be flipped over around its X axis.

Returns:
bool

True if successful and False if not.

Examples

>>> edb1 = Edb(edbpath=targetfile1, edbversion="2021.2")
>>> a3dcomp_path = "connector.a3dcomp"
>>> edb1.stackup.place_a3dcomp_3d_placement(
...     a3dcomp_path,
...     angle=0.0,
...     offset_x="1mm",
...     offset_y="2mm",
...     flipped_stackup=False,
...     place_on_top=True,
... )
Stackup.residual_copper_area_per_layer()#

Report residual copper area per layer in percentage.

Returns:
dict

Copper area per layer.

Examples

>>> edb = Edb(edbpath=targetfile1, edbversion="2021.2")
>>> edb.stackup.residual_copper_area_per_layer()
Stackup.load(file_path, rename=False)#

Import stackup from a file. The file format can be XML, CSV, or JSON. Valid control file must have the same number of signal layers. Signals layers can be renamed. Dielectric layers can be added and deleted.

Parameters:
file_pathstr, dict

Path to stackup file or dict with stackup details.

renamebool

If rename is False then layer in layout not found in the stackup file are deleted. Otherwise, if the number of layer in the stackup file equals the number of stackup layer in the layout, layers are renamed according the file. Note that layer order matters, and has to be writtent from top to bottom layer in the file.

Returns:
bool

True when successful, False when failed.

Examples

>>> from pyedb import Edb
>>> edb = Edb()
>>> edb.stackup.load("stackup.xml")
Stackup.plot(save_plot=None, size=(2000, 1500), plot_definitions=None, first_layer=None, last_layer=None, scale_elevation=True, show=True)#

Plot current stackup and, optionally, overlap padstack definitions. Plot supports only ‘Laminate’ and ‘Overlapping’ stackup types.

Parameters:
save_plotstr, optional

If a path is specified the plot will be saved in this location. If save_plot is provided, the show parameter is ignored.

sizetuple, optional

Image size in pixel (width, height). Default value is (2000, 1500)

plot_definitionsstr, list, optional

List of padstack definitions to plot on the stackup. It is supported only for Laminate mode.

first_layerstr or pyedb.dotnet.database.edb_data.layer_data.LayerEdbClass

First layer to plot from the bottom. Default is None to start plotting from bottom.

last_layerstr or pyedb.dotnet.database.edb_data.layer_data.LayerEdbClass

Last layer to plot from the bottom. Default is None to plot up to top layer.

scale_elevationbool, optional

The real layer thickness is scaled so that max_thickness = 3 * min_thickness. Default is True.

showbool, optional

Whether to show the plot or not. Default is True.

Returns:
matplotlib.plt
Stackup.load_from_xml(file_path)#

Load stackup from a XML file.

Parameters:
file_path: str

Path to external XML file.

Returns:
bool

True when successful, False when failed.