Stackup#
- class pyedb.grpc.database.stackup.Stackup(pedb, edb_object=None)#
Bases:
LayerCollectionManages EDB methods for stackup operations.
- Parameters:
- pedb
pyedb.Edb EDB object.
- edb_object
ansys.edb.core.layer.LayerCollection,optional EDB layer collection object. The default is
None.
- pedb
Overview#
Create a symmetric stackup. |
|
Add an outline layer named “Outline” if it is not present. |
|
Insert a layer into stackup. |
|
Remove a layer from stackup. |
|
Export stackup definition to a file. |
|
Export stackup definition to a file. |
|
Retrieve stackup limits. |
|
Flip the current design of a layout. |
|
Return the layout thickness. |
|
Adjust the stack-up by adding or modifying dielectric layers that contain solder balls. |
|
Place current cell into another cell using layer placement method. |
|
Place current cell into another cell using 3D placement method. |
|
Place a component instance in the layout using 3D placement. |
|
Place a 3D component into the current layout. |
|
Report residual copper area per layer in percentage. |
|
Import stackup from a file. |
|
Plot the current stackup and optionally overlap padstack definitions. |
Retrieve the stackup thickness. |
|
Retrieve the number of layers in the stackup. |
|
Stackup mode. |
Import detail#
from pyedb.grpc.database.stackup import Stackup
Property detail#
- property Stackup.thickness: float#
Retrieve the stackup thickness.
- Returns:
floatStackup thickness.
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> thickness = edb.stackup.thickness
Method detail#
- Stackup.__getitem__(item)#
- Stackup.create_symmetric_stackup(layer_count: int, inner_layer_thickness: str = '17um', outer_layer_thickness: str = '50um', dielectric_thickness: str = '100um', dielectric_material: str = 'FR4_epoxy', soldermask: bool = True, soldermask_thickness: str = '20um') bool#
Create a symmetric stackup.
- Parameters:
- layer_count
int Number of layers. Must be even.
- inner_layer_thickness
str,float,optional Thickness of inner conductor layer.
- outer_layer_thickness
str,float,optional Thickness of outer conductor layer.
- dielectric_thickness
str,float,optional Thickness of dielectric layer.
- dielectric_material
str,optional Material of dielectric layer.
- soldermaskbool,
optional Whether to create soldermask layers. The default is
True.- soldermask_thickness
str,optional Thickness of soldermask layer.
- layer_count
- Returns:
- bool
Truewhen successful,Falsewhen failed.
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.create_symmetric_stackup(layer_count=4)
- Stackup.add_outline_layer(name: str = 'Outline') bool#
Add an outline layer named “Outline” if it is not present.
- Returns:
- bool
Truewhen successful.
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.add_outline_layer()
- Stackup.add_layer(layer_name: str, base_layer: str | None = None, method: str = 'add_on_top', layer_type: str = 'signal', material: str = 'copper', fillMaterial: str = 'FR4_epoxy', thickness: str | float = '35um', etch_factor: float | None = None, is_negative: bool = False, enable_roughness: bool = False, elevation: float | None = None) bool#
Insert a layer into stackup.
- Parameters:
- layer_name
str Name of the layer.
- base_layer
str,optional Name of the base layer.
- method
str,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_type
str,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"- material
str,optional Material of the layer.
- fillMaterial
str,optional Fill material of the layer.
- thickness
str,float,optional Thickness of the layer.
- etch_factor
int,float,optional Etch factor of the layer.
- is_negativebool,
optional Whether the layer is negative.
- enable_roughnessbool,
optional Whether roughness is enabled.
- elevation
float,optional Elevation of new layer. Only valid for Overlapping Stackup.
- layer_name
- Returns:
pyedb.grpc.database.layers.stackup_layer.StackupLayerLayer object created.
- Stackup.export(fpath: str, file_format: str = 'xml', include_material_with_layer: bool = False) bool#
Export stackup definition to a file.
- Parameters:
- fpath
str File path to export to.
- file_format
str,optional Format of the file to export. The default is
"xml". Options are: -"csv"-"xlsx"-"json"-"xml"- 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.
- fpath
- Returns:
- bool
Truewhen successful.
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 file.
Deprecated since version 0.6.61: Use
export()instead.- Parameters:
- fpath
str File path to export to.
- file_format
str,optional Format of the file to export. The default is
"xml". Options are: -"csv"-"xlsx"-"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.
- fpath
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.export_stackup("stackup.xml")
- Stackup.flip_design() bool#
Flip the current design of a layout.
- Returns:
- bool
Truewhen successful.
Examples
>>> edb = Edb(edbpath=targetfile, edbversion="2021.2") >>> edb.stackup.flip_design() >>> edb.save() >>> edb.close_edb()
- Stackup.adjust_solder_dielectrics() bool#
Adjust the stack-up by adding or modifying dielectric layers that contain solder balls.
This method identifies the solder-ball height and adjusts the dielectric thickness on top (or bottom) to fit the thickness in order to merge another layout.
- Returns:
- bool
Truewhen successful.
- Stackup.place_in_layout(edb: Edb, angle: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, flipped_stackup: bool = True, place_on_top: bool = True) bool#
Place current cell into another cell using layer placement method.
Flip the current layer stackup of a layout if requested.
- Parameters:
- edb
pyedb.Edb Target Edb object.
- angle
float,optional Rotation angle in degrees. The default is
0.0.- offset_x
float,optional X offset value. The default is
0.0.- offset_y
float,optional Y offset value. The default is
0.0.- flipped_stackupbool,
optional Whether to flip the current layout. The default is
True.- place_on_topbool,
optional Whether to place the current layout on top of the destination layout. The default is
True.
- edb
- Returns:
- bool
Truewhen successful.
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: Edb, angle: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, flipped_stackup: bool = True, place_on_top: bool = True, solder_height: float = 0) bool#
Place current cell into another cell using 3D placement method.
Flip the current layer stackup of a layout if requested.
- Parameters:
- edb
pyedb.Edb Target Edb object.
- angle
float,optional Rotation angle in degrees. The default is
0.0.- offset_x
float,optional X offset value. The default is
0.0.- offset_y
float,optional Y offset value. The default is
0.0.- flipped_stackupbool,
optional Whether to flip the current layout. The default is
True.- place_on_topbool,
optional Whether to place the current layout on top of the destination layout. The default is
True.- solder_height
float,optional Solder ball or bumps height. This value will be added to the elevation to align the two layouts.
- edb
- Returns:
- bool
Truewhen successful.
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: Edb, angle: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0, flipped_stackup: bool = True, place_on_top: bool = True, solder_height: float = 0) ansys.edb.core.hierarchy.cell_instance.CellInstance#
Place a component instance in the layout using 3D placement.
- Parameters:
- component_edb
pyedb.Edb Component Edb object to place.
- angle
float,optional Rotation angle in degrees. The default is
0.0.- offset_x
float,optional X offset value. The default is
0.0.- offset_y
float,optional Y offset value. The default is
0.0.- offset_z
float,optional Z offset value (elevation offset). The default is
0.0.- flipped_stackupbool,
optional Whether to flip the component stackup. The default is
True.- place_on_topbool,
optional Whether to place the component on top of the target layout. The default is
True.- solder_height
float,optional Solder ball or bumps height. The default is
0.
- component_edb
- Returns:
ansys.edb.core.hierarchy.CellInstanceCell instance created.
- Stackup.place_a3dcomp_3d_placement(a3dcomp_path: str, angle: float = 0.0, offset_x: float = 0.0, offset_y: float = 0.0, offset_z: float = 0.0, place_on_top: bool = True) bool#
Place a 3D component into the 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_path
str Path to the 3D Component file (
*.a3dcomp) to place.- angle
float,optional Clockwise rotation angle applied to the a3dcomp.
- offset_x
float,optional X offset value. The default is
0.0.- offset_y
float,optional Y offset value. The default is
0.0.- offset_z
float,optional Z offset value (elevation). The default is
0.0.- place_on_topbool,
optional Whether to place the 3D component on the top or the bottom of this layout. If
False, the 3D component will be flipped over around its X axis.
- a3dcomp_path
- Returns:
- bool
Trueif successful,Falseif 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() Dict[str, float]#
Report residual copper area per layer in percentage.
- Returns:
dictDictionary of copper area per layer.
Examples
>>> edb = Edb(edbpath=targetfile1, edbversion="2021.2") >>> edb.stackup.residual_copper_area_per_layer()
- Stackup.load(file_path: str | Dict, rename: bool = False) bool#
Import stackup from a file.
Supported formats: XML, CSV, JSON.
- Parameters:
- file_path
strordict Path to stackup file or dictionary with stackup details.
- renamebool,
optional If
False, layers in layout not found in the stackup file are deleted. IfTrueand the number of layers in the stackup file equals the number of stackup layers in the layout, layers are renamed according to the file.
- file_path
- Returns:
- bool
Truewhen successful.
Examples
>>> from pyedb import Edb >>> edb = Edb() >>> edb.stackup.load("stackup.xml")
- Stackup.plot(save_plot: str | None = None, size: Tuple[int, int] = (2000, 1500), plot_definitions: str | List[str] | None = None, first_layer: str | pyedb.grpc.database.layers.layer.Layer | None = None, last_layer: str | pyedb.grpc.database.layers.layer.Layer | None = None, scale_elevation: bool = True, show: bool = True) Any#
Plot the current stackup and optionally overlap padstack definitions.
Only supports ‘Laminate’ and ‘Overlapping’ stackup types.
- Parameters:
- save_plot
str,optional Path to save the plot image. If provided,
showis ignored.- size
tuple,optional Image size in pixels (width, height). Default is
(2000, 1500).- plot_definitions
strorlist,optional List of padstack definitions to plot on the stackup. Only supported for Laminate mode.
- first_layer
strorpyedb.grpc.database.layers.layer.Layer,optional First layer to plot from the bottom. Default is
None(start from bottom).- last_layer
strorpyedb.grpc.database.layers.layer.Layer,optional Last layer to plot from the bottom. Default is
None(plot up to top layer).- scale_elevationbool,
optional Scale real layer thickness so that max_thickness = 3 * min_thickness. Default is
True.- showbool,
optional Whether to show the plot. Default is
True.
- save_plot
- Returns:
matplotlib.pyplotMatplotlib plot object.