CfgStackup#
- class pyedb.configuration.cfg_stackup.CfgStackup(/, **data: Any)#
Bases:
pydantic.BaseModelCollect stackup materials and layers for serialization.
Overview#
Return the |
|
Return all stackup layers as |
|
Return only the signal (metal) stackup layers as |
|
Return the |
|
Add a material definition to the stackup. |
|
Append a layer definition. |
|
Append a layer to the bottom of the stackup. |
|
Add a signal layer with conductor defaults. |
|
Add a dielectric layer with common defaults. |
|
Normalise all layer thicknesses to a common unit in-place. |
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.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
CfgLayerfor name, loading it from EDB if needed.If the layer has already been registered (via
add_signal_layer(),add_dielectric_layer(), oradd_layer()) the cached entry is returned. Otherwise the layer is looked up in the live EDB session and a newCfgLayeris created from its current properties.- Parameters:
- name
str Layer name, e.g.
"top"or"diel1".
- name
- Returns:
CfgLayerLayer builder pre-populated with current properties.
- Raises:
KeyErrorIf 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
CfgLayerobjects.Each layer in the live EDB session is loaded (if not already cached) and returned as a list of
CfgLayerinstances.- Returns:
listofCfgLayerAll stackup layers in stack order.
- Raises:
KeyErrorIf 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
CfgLayerobjects.Queries the live EDB session for signal layers only, loads each into the cache via
get_layer(), and returns the filtered list.- Returns:
listofCfgLayerSignal layers in stack order.
- Raises:
KeyErrorIf 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
CfgMaterialfor 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 newCfgMaterialis created from its current properties.- Parameters:
- name
str Material name, e.g.
"copper"or"FR4_epoxy".
- name
- Returns:
CfgMaterialMaterial builder pre-populated with current properties.
- Raises:
KeyErrorIf 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:
- name
str Material name, e.g.
"copper"or"FR4_epoxy".- config
CfgMaterialordict,optional Pre-built
CfgMaterialinstance or a plain dictionary with material properties. Individual keyword arguments take precedence over values in config.- conductivity
strorfloat,optional Electrical conductivity in S/m.
- permittivity
strorfloat,optional Relative permittivity (dielectric constant).
- dielectric_loss_tangent
optional,str,floatorint Dielectric loss tangent.
- magnetic_loss_tangent
optional,str,floatorint Magnetic loss tangent.
- mass_density
optional,str,floatorint Mass density in kg/m³.
- permeability
optional,str,floatorint Relative permeability.
- poisson_ratio
optional,str,floatorint Poisson’s ratio.
- specific_heat
optional,str,floatorint Specific heat capacity in J/(kg·K).
- thermal_conductivity
optional,str,floatorint Thermal conductivity in W/(m·K).
- youngs_modulus
optional,str,floatorint Young’s modulus in Pa.
- thermal_expansion_coefficient
optional,str,floatorint Coefficient of thermal expansion in 1/K.
- dc_conductivity
optional,str,floatorint DC conductivity override.
- dc_permittivity
optional,str,floatorint DC permittivity override.
- dielectric_model_frequency
optional,str,floatorint Frequency for the dielectric model in Hz.
- loss_tangent_at_frequency
optional,str,floatorint Loss tangent at the model frequency.
- permittivity_at_frequency
optional,str,floatorint Permittivity at the model frequency.
- thermal_modifiers
list,optional List of thermal modifier definitions.
- name
- Returns:
CfgMaterialThe 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:
- Returns:
CfgLayerThe 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:
- name
str,optional Layer name. If provided, it overrides the name from
config.- config
CfgLayerordict,optional Pre-built
CfgLayerinstance or a plain dictionary with layer properties. Individual keyword arguments in**kwargsare merged on top of config and take precedence.- **kwargs
Optional layer properties forwarded to
CfgLayer(layer_typeortype,material,fill_material,thickness).
- name
- Returns:
CfgLayerThe 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 eachlayer.thicknessbecomes a uniform string like"3.5e-05m".- Parameters:
- unit
str,optional Target unit. Supported values:
"m"(default),"mm","cm","um","mil","in".
- unit
- Raises:
ValueErrorIf unit is not one of the supported unit strings.
Examples
>>> cfg.stackup.normalize_thickness("um")