Configuration#
- class pyedb.configuration.configuration.Configuration(pedb: pyedb.Edb)#
Enables export and import of a JSON configuration file that can be applied to a new or existing design.
Overview#
Create and return a |
|
Import configuration settings from a configure file. |
|
Apply configuration settings to the current design. |
|
Apply simulation setups (HFSS, SIwave AC/DC) to the current design. |
|
Populate |
|
Write HFSS open-region and airbox settings into the current design. |
|
Populate |
|
Create modeler primitives (traces, planes, padstacks, components) in the design. |
|
Set variables into database. |
|
Retrieve variables from database. |
|
Apply material settings to the current design |
|
Retrieve materials from the current design. |
|
Apply stackup layer definitions to the current design. |
|
Populate |
|
Populate |
|
Apply padstack definitions and instance overrides to the current design. |
|
Apply operations to the current design. |
|
Populate |
|
Create terminal excitations (padstack, pin-group, point, edge, bundle) in the design. |
|
Populate |
|
Get configuration data from layout. |
|
Export the configuration data from layout to a file. |
Import detail#
from pyedb.configuration.configuration import Configuration
Attribute detail#
- Configuration.data#
- Configuration.cfg_data#
Method detail#
- Configuration.create_config_builder() pyedb.configuration.cfg_data.CfgData#
Create and return a
CfgDatabound to this EDB session.Because the builder is initialised with a reference to the live EDB session, you can retrieve existing objects directly via
getmethods instead of registering them manually:cfg.components.get(refdes)— existing component (pre-loads all properties).cfg.stackup.get_layer(name)— existing layer (pre-loads properties).cfg.stackup.get_material(name)— existing material (pre-loads properties).cfg.nets.get(net_name)— net classification from EDB.cfg.padstacks.get_definition(name)— existing padstack definition.cfg.padstacks.get_instance(name)— existing padstack instance.cfg.pin_groups.get(name)— existing pin group (pre-loads pins).cfg.setups.get(name)— a previously registered setup by name.
- Returns:
CfgDataA new, session-aware configuration builder instance.
Examples
Retrieve an existing component and modify its solder-ball geometry:
>>> cfg = edb.configuration.create_config_builder() >>> u1 = cfg.components.get("U1") # looks up U1 from EDB >>> u1.set_solder_ball_properties("cylinder", "150um", "100um") >>> edb.configuration.run(cfg)
Traditional workflow (creating new component entries) still works:
>>> cfg = edb.configuration.create_config_builder() >>> cfg.general.anti_pads_always_on = False >>> cfg.nets.add_signal_nets(["SIG1", "CLK"]) >>> cfg.nets.add_power_ground_nets(["VDD", "GND"]) >>> edb.configuration.run(cfg)
- Configuration.load(config_file, append=True, apply_file=False, output_file=None, open_at_the_end=True)#
Import configuration settings from a configure file.
- Parameters:
- config_file
str,dict,orCfgData Full path to configure file in JSON or TOML format, a plain Python dictionary, or a
CfgDatainstance. When aCfgDatais supplied itsto_dict()method is called automatically so the builder can be passed without any extra serialization step.- appendbool,
optional Whether if the new file will append to existing properties or the properties will be cleared before import. Default is
Trueto keep stored properties- apply_filebool,
optional Whether to apply the file after the load or not. Default is
False.- output_file
str,optional Full path to the new aedb folder where the configured project will be saved.
- open_at_the_endbool,
optional Whether to keep the new generated file opened at the end. Default is
True.
- config_file
- Returns:
CfgDataPopulated configuration data object.
Examples
Pass a
CfgDatadirectly:>>> from pyedb.configuration.cfg_data import CfgData >>> cfg = CfgData() >>> cfg.general.anti_pads_always_on = False >>> edb.configuration.load(cfg, apply_file=True)
- Configuration.run(config=None, **kwargs)#
Apply configuration settings to the current design.
- Parameters:
Examples
Pass a builder directly — no
loadcall needed:>>> from pyedb.configuration.cfg_data import CfgData >>> cfg = CfgData() >>> cfg.general.anti_pads_always_on = False >>> cfg.nets.add_signal_nets(["SIG1", "CLK"]) >>> edb.configuration.run(cfg)
Use the existing workflow unchanged:
>>> edb.configuration.load("my_config.json") >>> edb.configuration.run()
- Configuration.apply_setups()#
Apply simulation setups (HFSS, SIwave AC/DC) to the current design.
Iterates over every setup defined in
cfg_data.setupsand creates the corresponding EDB setup object, including frequency sweeps and mesh operations.- Returns:
- Configuration.get_setups()#
Populate
cfg_data.setupsfrom the currently open EDB design.Reads every simulation setup in the database and converts it to the corresponding
CfgSetupmodel so it can later be serialized or re-applied to another design.- Returns:
- Configuration.apply_boundaries()#
Write HFSS open-region and airbox settings into the current design.
Reads the
boundariessection ofcfg_dataand pushes every non-Noneattribute topyedb.edb_core.hfss.HfssExtentInfo.- Returns:
- Configuration.get_boundaries()#
Populate
cfg_data.boundariesfrom the open EDB design.Reads the HFSS extent information (open-region type, PML settings, airbox padding, dielectric extents) from the database and stores the values in the active
CfgBoundariesmodel.- Returns:
- Configuration.apply_modeler()#
Create modeler primitives (traces, planes, padstacks, components) in the design.
Processes every item in
cfg_data.modelerand invokes the matchingpyedb.modelerorpyedb.componentsfactory method. After creation, primitives marked for deletion are removed from the layout.- Returns:
- Configuration.apply_variables()#
Set variables into database.
- Configuration.get_variables()#
Retrieve variables from database.
- Configuration.apply_materials()#
Apply material settings to the current design
- Configuration.get_materials()#
Retrieve materials from the current design.
- Configuration.apply_stackup()#
Apply stackup layer definitions to the current design.
If the database already has signal layers, the existing stackup is updated in-place; otherwise a new stackup is created from scratch. Materials referenced by layers that are not yet in the database are created automatically with default properties.
- Configuration.get_stackup()#
Populate
cfg_data.stackuplayers from the open EDB design.Clears the existing layer list and re-populates it by reading every layer in
pyedb.Edb.stackup.all_layers.- Returns:
- Configuration.get_padstacks()#
Populate
cfg_data.padstacksfrom the open EDB design.Reads every padstack definition and every padstack instance from the database and stores them in the active
CfgPadstacksmodel.- Returns:
- Configuration.apply_padstacks()#
Apply padstack definitions and instance overrides to the current design.
Iterates over
cfg_data.padstacksand updates the matching EDB padstack-definition and padstack-instance objects in the database.- Returns:
- Configuration.apply_operations()#
Apply operations to the current design.
- Configuration.get_operations()#
Populate
cfg_data.operationsfrom the open EDB design.Detects whether a
pyedb_cutoutlayer is present and, when found, reconstructs the cutout operation (signal nets + custom extent polygon) so it can be serialised or re-applied.- Returns:
- Configuration.apply_terminals()#
Create terminal excitations (padstack, pin-group, point, edge, bundle) in the design.
Iterates over every terminal in
cfg_data.terminals, creates the corresponding EDB excitation object, assigns impedance / boundary-type / source-amplitude settings, and resolves reference-terminal links.- Returns:
- Configuration.get_terminals()#
Populate
cfg_data.terminalsfrom the open EDB design.Reads every terminal excitation from the database and stores it as the appropriate
Cfg*Terminalmodel so it can later be serialised or re-applied.- Returns:
- Configuration.get_data_from_db(**kwargs)#
Get configuration data from layout.
- Parameters:
- stackupbool,
optional Whether to retrieve stackup data.
- package_definitionsbool,
optional Whether to retrieve package definitions.
- setupsbool,
optional Whether to retrieve setups.
- sourcesbool,
optional Whether to retrieve sources.
- portsbool,
optional Whether to retrieve ports.
- netsbool,
optional Whether to retrieve nets.
- pin_groupsbool,
optional Whether to retrieve pin groups.
- operationsbool,
optional Whether to retrieve operations.
- componentsbool,
optional Whether to retrieve components.
- boundariesbool,
optional Whether to retrieve boundaries.
- s_parametersbool,
optional Whether to retrieve s-parameters.
- padstacksbool,
optional Whether to retrieve padstacks.
- generalbool,
optional Whether to retrieve general information.
- variablesbool,
optional Whether to retrieve variables.
- terminalsbool,
optional Whether to retrieve terminals.
- stackupbool,
- Returns:
dictDictionary with requested configuration data.
- Configuration.export(file_path, stackup=True, package_definitions=False, setups=True, sources=True, ports=True, nets=True, pin_groups=True, operations=True, components=True, boundaries=True, s_parameters=True, padstacks=True, general=True, variables=True, terminals=False)#
Export the configuration data from layout to a file.
- Parameters:
- file_path
str,Path File path to export the configuration data.
- stackupbool
Whether to export stackup or not.
- package_definitionsbool
Whether to export package definitions or not.
- setupsbool
Whether to export setups or not.
- sourcesbool
Whether to export sources or not. Alternative to terminals.
- portsbool
Whether to export ports or not. Alternative to terminals.
- netsbool
Whether to export nets.
- pin_groupsbool
Whether to export pin groups.
- operationsbool
Whether to export operations.
- componentsbool
Whether to export component.
- boundariesbool
Whether to export boundaries.
- s_parametersbool
Whether to export s_parameters.
- padstacksbool
Whether to export padstacks.
- generalbool
Whether to export general information.
- variablesbool
Whether to export variable.
- terminalsbool
Whether to export terminals. Alternative to ports and sources.
- Returns
- ——-
- bool
- file_path