HFSSAutoConfiguration#
- class pyedb.workflows.sipi.hfss_auto_configuration.HFSSAutoConfiguration(edb=None)#
Automatic HFSS simulation configuration from EDB designs.
This class automates the process of configuring HFSS simulations including net grouping, cutout creation, port generation, and simulation setup.
- Parameters:
- edb
EdborNone,optional Existing EDB object instance. If
None, a new instance will be created from the source path. The default isNone.
- edb
- Attributes:
- ansys_version
str ANSYS Electronics Desktop version to use. The default is
"2025.2".- grpcbool
Whether to use gRPC API mode. The default is
True.- source_edb_path
str Path to the source EDB file.
- target_edb_path
str Path where the configured EDB will be saved.
- batch_group_folder
str Folder path for storing batch group projects.
- signal_nets
list List of signal net names to include in the simulation.
- power_nets
list List of power net names.
- reference_net
str Name of the reference (ground) net.
- batch_size
int Maximum number of nets per batch group. The default is
100.- batch_groups
listofBatchGroup Configured batch groups for simulation.
- components
listofstr Component reference designators to include.
- solder_balls
listofSolderBallsInfo Solder ball configurations for components.
- simulation_setup
SimulationSetup Global simulation settings.
- extent_type
str Cutout extent algorithm:
"bounding_box","convex_hull", or"conformal". The default is"bounding_box".- cutout_expansion
strorfloat Cutout expansion margin. The default is
"2mm".- auto_mesh_seedingbool
Enable automatic mesh seeding. The default is
True.- port_type
str Port type to create:
"coaxial"or"circuit_port". The default is"coaxial".- create_pin_groupbool
Whether to create pin groups for circuit ports. The default is
False.
- ansys_version
Examples
Basic configuration:
>>> from pyedb import Edb >>> config = HFSSAutoConfiguration() >>> config.source_edb_path = "design.aedb" >>> config.target_edb_path = "design_hfss.aedb" >>> config.auto_populate_batch_groups() >>> config.create_projects()
Configure with existing EDB:
>>> edb = Edb("design.aedb") >>> config = HFSSAutoConfiguration(edb) >>> config.signal_nets = ["DDR4_DQ0", "DDR4_CLK"] >>> config.reference_net = "GND" >>> config.add_solder_ball("U1", diameter="0.3mm", height="0.2mm")
Overview#
Automatically create and populate batch groups from signal nets. |
|
Append a new BatchGroup to the configuration. |
|
Append a new solder ball definition to the configuration. |
|
Create a SimulationSetup instance and attach it to the configuration. |
|
Group signal nets into disjoint batches while preserving differential pairs. |
|
Generate HFSS projects from configured batch groups. |
Import detail#
from pyedb.workflows.sipi.hfss_auto_configuration import HFSSAutoConfiguration
Attribute detail#
- HFSSAutoConfiguration.batch_groups: list[BatchGroup] = []#
- HFSSAutoConfiguration.solder_balls: list[SolderBallsInfo] = []#
- HFSSAutoConfiguration.simulation_setup: SimulationSetup#
Method detail#
- HFSSAutoConfiguration.auto_populate_batch_groups(pattern: str | list[str] | None = None) None#
Automatically create and populate batch groups from signal nets.
This method discovers signal nets, identifies reference nets, and groups nets by prefix patterns. It is a convenience wrapper around
group_nets_by_prefix().- Parameters:
- pattern
strorlistofstrorNone,optional POSIX ERE prefix pattern(s) controlling which nets are grouped:
None(default) - Auto-discovery mode: nets are clustered heuristically and split into chunks of sizebatch_size.str - Single string prefix pattern (automatically anchored:
pattern + ".*").list of str - Each element becomes its own prefix pattern; one
BatchGroupcreated per list entry, regardless ofbatch_size.
- pattern
Notes
Clears and repopulates
batch_groupsin-placeAutomatically identifies reference nets (typically GND variants)
Opens and closes the EDB internally
Examples
Auto-discovery with automatic grouping:
>>> config = HFSSAutoConfiguration() >>> config.source_edb_path = "design.aedb" >>> config.auto_populate_batch_groups() >>> len(config.batch_groups) 5
Group by specific prefixes:
>>> config = HFSSAutoConfiguration() >>> config.source_edb_path = "design.aedb" >>> config.auto_populate_batch_groups(["DDR4", "PCIe", "USB"]) >>> [g.name for g in config.batch_groups] ['DDR4', 'PCIe', 'USB']
- HFSSAutoConfiguration.add_batch_group(name: str, nets: list[str] | None = None, *, simulation_setup: SimulationSetup | None = None) BatchGroup#
Append a new BatchGroup to the configuration.
- Parameters:
- name
str Descriptive name for the group. Will also become the regex pattern when the group is built automatically.
- nets
listofstrorNone,optional List of net names that belong to this batch. If
None, an empty list is assumed and can be filled later. The default isNone.- simulation_setup
SimulationSetuporNone,optional Per-batch simulation settings. When
None, the globalself.simulation_setupis used. The default isNone.
- name
- Returns:
BatchGroupThe freshly created instance (already appended to
batch_groups) for further manipulation if desired.
Examples
>>> config = HFSSAutoConfiguration() >>> group = config.add_batch_group("DDR4", nets=["DDR4_DQ0", "DDR4_CLK"]) >>> group.name 'DDR4' >>> len(group.nets) 2
Add group with custom setup:
>>> setup = SimulationSetup(stop_frequency="30GHz") >>> group = config.add_batch_group("PCIe", simulation_setup=setup) >>> group.simulation_setup.stop_frequency '30GHz'
- HFSSAutoConfiguration.add_solder_ball(ref_des: str, shape: str = 'cylinder', diameter: str | float | None = None, mid_diameter: str | float | None = None, height: str | float | None = None) SolderBallsInfo#
Append a new solder ball definition to the configuration.
- Parameters:
- ref_des
str Reference designator of the component to which the solder ball definition applies (e.g.,
"U1").- shape
str,optional Geometric model used for the solder ball. Supported values are
"cylinder","sphere","spheroid". The default is"cylinder".- diameter
strorfloatorNone,optional Nominal diameter. When
None, HFSS auto-evaluates the value from the footprint. The default isNone.- mid_diameter
strorfloatorNone,optional Middle diameter required only for spheroid shapes. Ignored for all other geometries. The default is
None.- height
strorfloatorNone,optional Ball height. When
None, HFSS computes an appropriate value automatically. The default isNone.
- ref_des
- Returns:
SolderBallsInfoThe newly created instance (already appended to
solder_balls). The object can be further edited in-place if desired.
Examples
Add cylinder solder balls:
>>> config = HFSSAutoConfiguration() >>> config.add_solder_ball("U1", diameter="0.3mm", height="0.2mm") >>> config.solder_balls[0].ref_des 'U1'
Add spheroid solder balls:
>>> config.add_solder_ball("U2", shape="spheroid", diameter="0.25mm", mid_diameter="0.35mm", height="0.18mm") >>> config.solder_balls[1].shape 'spheroid'
- HFSSAutoConfiguration.add_simulation_setup(meshing_frequency: str | float | None = '10GHz', maximum_pass_number: int = 15, start_frequency: str | float | None = 0, stop_frequency: str | float | None = '40GHz', frequency_step: str | float | None = '0.05GHz', replace: bool = True) SimulationSetup#
Create a SimulationSetup instance and attach it to the configuration.
- Parameters:
- meshing_frequency
strorfloatorNone,optional Driven frequency used during mesh generation. The default is
"10GHz".- maximum_pass_number
int,optional Maximum number of adaptive passes. The default is
15.- start_frequency
strorfloatorNone,optional Lower bound of the sweep window. The default is
0.- stop_frequency
strorfloatorNone,optional Upper bound of the sweep window. The default is
"40GHz".- frequency_step
strorfloatorNone,optional Linear step size for the frequency sweep. The default is
"0.05GHz".- replacebool,
optional Placement strategy for the new setup:
False- Append a per-batch setup by creating an auxiliaryBatchGroup(name="extra_setup") whosesimulation_setuppoints to the new object.True- Overwrite the globalsimulation_setupattribute of the current instance. The default isTrue.
- meshing_frequency
- Returns:
SimulationSetupThe newly created instance (already stored inside the configuration).
Examples
Create global setup:
>>> config = HFSSAutoConfiguration() >>> config.add_simulation_setup(stop_frequency="60GHz", replace=True) >>> config.simulation_setup.stop_frequency '60GHz'
Create per-batch setup:
>>> config.add_simulation_setup(frequency_step="0.1GHz", replace=False) >>> config.batch_groups[-1].name 'extra_setup'
- HFSSAutoConfiguration.group_nets_by_prefix(prefix_patterns: list[str] | None = None) dict[str, list[list[str]]]#
Group signal nets into disjoint batches while preserving differential pairs.
This method organizes signal nets into batches based on prefix patterns, ensuring differential pairs (e.g.,
_P/_N,_M/_L) stay together.- Parameters:
- Returns:
dict[str,list[list[str]]]Keys are the original or generated pattern strings. Values are lists of batches; each batch is an alphabetically sorted list of net names. When
prefix_patternswas supplied, the list contains exactly one element (the complete group); in auto-discovery mode, the list may contain multiple slices sized according tobatch_size.
Notes
Differential recognition strips the suffixes
_[PN],_[ML],_[+-](case-insensitive).The function updates the instance attribute
batch_groupsin place.Every net is assigned to exactly one batch.
No batch contains only a single net; orphans are merged into the largest compatible group.
Examples
Explicit grouping:
>>> config = HFSSAutoConfiguration() >>> config.signal_nets = ["PCIe_RX0_P", "PCIe_RX0_N", "USB3_DP", "DDR4_A0"] >>> config.group_nets_by_prefix(["PCIe", "USB"]) {'PCIe': [['PCIe_RX0_N', 'PCIe_RX0_P']], 'USB': [['USB3_DP']]}
Auto-discovery with batching:
>>> config.batch_size = 2 >>> config.group_nets_by_prefix() {'PCIe': [['PCIe_RX0_N', 'PCIe_RX0_P']], 'USB': [['USB3_DP']], 'DDR4': [['DDR4_A0']]}
- HFSSAutoConfiguration.create_projects()#
Generate HFSS projects from configured batch groups.
This method executes the complete workflow for each batch group including:
Copying source EDB to target location
Creating cutout with specified nets
Creating ports on components
Setting up simulation parameters
Saving configured project
When multiple batch groups exist, each group is processed into a separate project file stored in the
batch_group_folderdirectory.Notes
For multiple batch groups, projects are saved in
batch_group_folderEach batch can have custom simulation settings
Automatically handles EDB session management
Examples
Create single project:
>>> config = HFSSAutoConfiguration() >>> config.source_edb_path = "design.aedb" >>> config.target_edb_path = "design_hfss.aedb" >>> config.signal_nets = ["DDR4_DQ0", "DDR4_CLK"] >>> config.reference_net = "GND" >>> config.components = ["U1"] >>> config.create_projects()
Create multiple batch projects:
>>> config = HFSSAutoConfiguration() >>> config.source_edb_path = "design.aedb" >>> config.auto_populate_batch_groups(["DDR4", "PCIe"]) >>> config.create_projects() >>> # Creates projects in batch_groups/DDR4.aedb and batch_groups/PCIe.aedb