CfgStackup#

class pyedb.configuration.cfg_stackup.CfgStackup(/, **data: Any)#

Bases: pydantic.BaseModel

Collect stackup materials and layers for serialization.

Overview#

get_layer

Return the CfgLayer for name, loading it from EDB if needed.

get_layers

Return all stackup layers as CfgLayer objects.

get_signal_layers

Return only the signal (metal) stackup layers as CfgLayer objects.

get_material

Return the CfgMaterial for name, loading it from EDB if needed.

add_material

Add a material definition to the stackup.

add_layer

Append a layer definition.

add_layer_at_bottom

Append a layer to the bottom of the stackup.

add_signal_layer

Add a signal layer with conductor defaults.

add_dielectric_layer

Add a dielectric layer with common defaults.

normalize_thickness

Normalise all layer thicknesses to a common unit in-place.

materials

layers

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Import detail#

from pyedb.configuration.cfg_stackup import CfgStackup

Attribute detail#

CfgStackup.materials: list[CfgMaterial] = None#
CfgStackup.layers: list[CfgLayer] = None#
CfgStackup.model_config#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Method detail#

CfgStackup.get_layer(name: str) CfgLayer#

Return the CfgLayer for name, loading it from EDB if needed.

If the layer has already been registered (via add_signal_layer(), add_dielectric_layer(), or add_layer()) the cached entry is returned. Otherwise the layer is looked up in the live EDB session and a new CfgLayer is created from its current properties.

Parameters:
namestr

Layer name, e.g. "top" or "diel1".

Returns:
CfgLayer

Layer builder pre-populated with current properties.

Raises:
KeyError

If the layer is not found in the builder registry or the EDB layout.

Examples

>>> cfg = edb.configuration.create_config_builder()
>>> top = cfg.stackup.get_layer("top")
>>> top.set_huray_roughness("0.1um", "2.9")
>>> edb.configuration.run(cfg)
CfgStackup.get_layers() list#

Return all stackup layers as CfgLayer objects.

Each layer in the live EDB session is loaded (if not already cached) and returned as a list of CfgLayer instances.

Returns:
list of CfgLayer

All stackup layers in stack order.

Raises:
KeyError

If no EDB session is attached.

Examples

>>> cfg = edb.configuration.create_config_builder()
>>> for layer in cfg.stackup.get_layers():
...     print(layer.name, layer.type)
CfgStackup.get_signal_layers() list#

Return only the signal (metal) stackup layers as CfgLayer objects.

Queries the live EDB session for signal layers only, loads each into the cache via get_layer(), and returns the filtered list.

Returns:
list of CfgLayer

Signal layers in stack order.

Raises:
KeyError

If no EDB session is attached.

Examples

>>> cfg = edb.configuration.create_config_builder()
>>> for layer in cfg.stackup.get_signal_layers():
...     print(layer.name, layer.thickness)
CfgStackup.get_material(name: str) CfgMaterial#

Return the CfgMaterial for name, loading it from EDB if needed.

If the material has already been registered via add_material() the cached entry is returned. Otherwise the material is looked up in the live EDB session and a new CfgMaterial is created from its current properties.

Parameters:
namestr

Material name, e.g. "copper" or "FR4_epoxy".

Returns:
CfgMaterial

Material builder pre-populated with current properties.

Raises:
KeyError

If the material is not found in the builder registry or the EDB database.

Examples

>>> cfg = edb.configuration.create_config_builder()
>>> cu = cfg.stackup.get_material("copper")
>>> cu.conductivity = 5.6e7
>>> edb.configuration.run(cfg)
CfgStackup.add_material(name: str | None = None, config: CfgMaterial | dict | None = None, conductivity: str | float | int | None = None, permittivity: str | float | int | None = None, dielectric_loss_tangent: str | float | int | None = None, magnetic_loss_tangent: str | float | int | None = None, mass_density: str | float | int | None = None, permeability: str | float | int | None = None, poisson_ratio: str | float | int | None = None, specific_heat: str | float | int | None = None, thermal_conductivity: str | float | int | None = None, youngs_modulus: str | float | int | None = None, thermal_expansion_coefficient: str | float | int | None = None, dc_conductivity: str | float | int | None = None, dc_permittivity: str | float | int | None = None, dielectric_model_frequency: str | float | int | None = None, loss_tangent_at_frequency: str | float | int | None = None, permittivity_at_frequency: str | float | int | None = None, thermal_modifiers=None) CfgMaterial#

Add a material definition to the stackup.

Parameters:
namestr

Material name, e.g. "copper" or "FR4_epoxy".

configCfgMaterial or dict, optional

Pre-built CfgMaterial instance or a plain dictionary with material properties. Individual keyword arguments take precedence over values in config.

conductivitystr or float, optional

Electrical conductivity in S/m.

permittivitystr or float, optional

Relative permittivity (dielectric constant).

dielectric_loss_tangentoptional, str, float or int

Dielectric loss tangent.

magnetic_loss_tangentoptional, str, float or int

Magnetic loss tangent.

mass_densityoptional, str, float or int

Mass density in kg/m³.

permeabilityoptional, str, float or int

Relative permeability.

poisson_ratiooptional, str, float or int

Poisson’s ratio.

specific_heatoptional, str, float or int

Specific heat capacity in J/(kg·K).

thermal_conductivityoptional, str, float or int

Thermal conductivity in W/(m·K).

youngs_modulusoptional, str, float or int

Young’s modulus in Pa.

thermal_expansion_coefficientoptional, str, float or int

Coefficient of thermal expansion in 1/K.

dc_conductivityoptional, str, float or int

DC conductivity override.

dc_permittivityoptional, str, float or int

DC permittivity override.

dielectric_model_frequencyoptional, str, float or int

Frequency for the dielectric model in Hz.

loss_tangent_at_frequencyoptional, str, float or int

Loss tangent at the model frequency.

permittivity_at_frequencyoptional, str, float or int

Permittivity at the model frequency.

thermal_modifierslist, optional

List of thermal modifier definitions.

Returns:
CfgMaterial

The newly created material object.

Examples

>>> cfg.stackup.add_material("copper", conductivity=5.8e7)
>>> cfg.stackup.add_material("fr4", permittivity=4.4, dielectric_loss_tangent=0.02)
CfgStackup.add_layer(name: str, layer_type: str | None = None, material: str | None = None, fill_material: str | None = None, thickness: str | float | int | None = None)#

Append a layer definition.

Parameters:
namestr

Layer name.

layer_typestr, optional

Layer type: "signal" or "dielectric". Also accepted as type= for backwards compatibility.

materialstr, optional

Layer material name.

fill_materialstr, optional

Fill material for signal layers.

thicknessstr or float, optional

Layer thickness, e.g. "35um".

Returns:
CfgLayer

The newly created layer object.

CfgStackup.add_layer_at_bottom(name=None, config: CfgLayer | dict[str, Any] | None = None, **kwargs)#

Append a layer to the bottom of the stackup.

Parameters:
namestr, optional

Layer name. If provided, it overrides the name from config.

configCfgLayer or dict, optional

Pre-built CfgLayer instance or a plain dictionary with layer properties. Individual keyword arguments in **kwargs are merged on top of config and take precedence.

**kwargs

Optional layer properties forwarded to CfgLayer (layer_type or type, material, fill_material, thickness).

Returns:
CfgLayer

The newly created layer object.

CfgStackup.add_signal_layer(name: str, material: str = 'copper', fill_material: str = 'FR4_epoxy', thickness: str | float | int = '35um')#

Add a signal layer with conductor defaults.

CfgStackup.add_dielectric_layer(name: str, material: str = 'FR4_epoxy', thickness: str | float | int = '100um')#

Add a dielectric layer with common defaults.

CfgStackup.normalize_thickness(unit='m')#

Normalise all layer thicknesses to a common unit in-place.

Converts any string thickness (e.g. "35um", "1.5mil") to a numeric value in unit, then re-appends the unit suffix so each layer.thickness becomes a uniform string like "3.5e-05m".

Parameters:
unitstr, optional

Target unit. Supported values: "m" (default), "mm", "cm", "um", "mil", "in".

Raises:
ValueError

If unit is not one of the supported unit strings.

Examples

>>> cfg.stackup.normalize_thickness("um")