HFSSAutoConfiguration#

class pyedb.workflows.sipi.hfss_auto_configuration.HFSSAutoConfiguration(edb=None)#

Overview#

auto_populate_batch_groups

Automatically create and populate batch_groups from the current

add_batch_group

Append a new BatchGroup to the configuration.

add_solder_ball

Append a new SolderBallsInfo entry to the configuration.

add_simulation_setup

Create a: class:.SimulationSetup instance and attach it to the configuration.

group_nets_by_prefix

Group signal nets into disjoint batches while preserving differential pairs.

create_projects

Import detail#

from pyedb.workflows.sipi.hfss_auto_configuration import HFSSAutoConfiguration

Attribute detail#

HFSSAutoConfiguration.ansys_version: str = '2025.2'#
HFSSAutoConfiguration.grpc: bool = True#
HFSSAutoConfiguration.source_edb_path: str = ''#
HFSSAutoConfiguration.target_edb_path: str = ''#
HFSSAutoConfiguration.batch_group_folder: str = ''#
HFSSAutoConfiguration.signal_nets: list = []#
HFSSAutoConfiguration.power_nets: list = []#
HFSSAutoConfiguration.reference_net: str = ''#
HFSSAutoConfiguration.batch_size: int = 100#
HFSSAutoConfiguration.batch_groups: list[BatchGroup] = []#
HFSSAutoConfiguration.components: list[str] = []#
HFSSAutoConfiguration.solder_balls: list[SolderBallsInfo] = []#
HFSSAutoConfiguration.simulation_setup: SimulationSetup#
HFSSAutoConfiguration.extent_type: str = 'bounding_box'#
HFSSAutoConfiguration.cutout_expansion: float | str = '2mm'#
HFSSAutoConfiguration.auto_mesh_seeding: bool = True#
HFSSAutoConfiguration.port_type: str = 'coaxial'#
HFSSAutoConfiguration.create_pin_group: bool = False#

Method detail#

HFSSAutoConfiguration.auto_populate_batch_groups(pattern: str | list[str] | None = None) None#

Automatically create and populate batch_groups from the current signal_nets.

This is a thin convenience wrapper around group_nets_by_prefix(). It only executes when both:

  • auto_evaluate_batch_groups is True, and

  • signal_nets is non-empty.

Parameters:
patternstr | list [str] | None, optional

POSIX ERE prefix pattern(s) that control which nets are grouped.

  • None (default) – activate auto-discovery mode: nets are clustered heuristically and then split into chunks of size batch_size.

  • str – treat the single string as a prefix pattern (automatically anchored: pattern + ".*").

  • list [str] – each list element becomes its own prefix pattern; one BatchGroup is created per list entry, regardless of batch_size.

HFSSAutoConfiguration.add_batch_group(name: str, nets: Sequence[str] | None = None, *, simulation_setup: SimulationSetup | None = None) BatchGroup#

Append a new BatchGroup to the configuration.

Parameters:
namestr

Descriptive name for the group (will also become the regex pattern when the group is built automatically).

netsSequence[str], optional

List of net names that belong to this batch. If omitted an empty list is assumed and you can fill it later.

simulation_setupSimulationSetup, optional

Per-batch simulation settings. When None the global self.simulation_setup is used.

Returns:
BatchGroup

The freshly created instance (already appended to self.batch_groups) so the caller can further manipulate it if desired.

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 SolderBallsInfo entry to the configuration.

Parameters:
ref_desstr

Reference designator of the component to which the solder-ball definition applies (e.g. "U1").

shapestr, default "cylinder"

Geometric model used for the solder ball. Supported values are "cylinder", "sphere", "spheroid", etc.

diameterstr | float | None, optional

Nominal diameter. When None HFSS auto-evaluates the value from the footprint.

mid_diameterstr | float | None, optional

Middle diameter required only for spheroid shapes. Ignored for all other geometries.

heightstr | float | None, optional

Ball height. When None HFSS computes an appropriate value automatically.

Returns:
SolderBallsInfo

The newly created instance (already appended to solder_balls). The object can be further edited in-place by the caller if desired.

Examples

>>> cfg = HfssAutoConfig()
>>> cfg.add_solder_ball("U1", diameter="0.3mm", height="0.2mm")
>>> cfg.add_solder_ball(
...     "U2",
...     shape="spheroid",
...     diameter="0.25mm",
...     mid_diameter="0.35mm",
...     height="0.18mm",
... )
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: class:.SimulationSetup instance and attach it to the configuration.

Parameters:
meshing_frequencyUnion[str,: class:float], default "10GHz"

Driven frequency used during mesh generation.

maximum_pass_numberclass:int, default 15

Maximum number of adaptive passes.

start_frequencyUnion[str,: class:float], default 0

Lower bound of the sweep window.

stop_frequencyUnion[str,: class:float], default "40GHz"

Upper bound of the sweep window.

frequency_stepUnion[str,: class:float], default "0.05GHz"

Linear step size for the frequency sweep.

mesh_operation_sizeUnion[str,: class:float, None], optional

Maximum element size for mesh operations. When None HFSS computes an appropriate value automatically.

replaceclass:bool, default False

Placement strategy for the new setup:

  • False – append a per-batch setup by creating an auxiliary BatchGroup (name="extra_setup") whose BatchGroup.simulation_setup points to the new object.

  • True – overwrite the global: attr:simulation_setup attribute of the current HfssAutoConfig instance.

Returns:
SimulationSetup

The newly created instance (already stored inside the configuration).

Examples

>>> cfg = HfssAutoConfig()
>>> # global setup
>>> cfg.add_simulation_setup(frequency_max="60GHz", replace=True)
>>> # per-batch setup
>>> cfg.add_simulation_setup(frequency_step="0.1GHz")
HFSSAutoConfiguration.group_nets_by_prefix(prefix_patterns: Sequence[str] | None = None) Dict[str, List[List[str]]]#

Group signal nets into disjoint batches while preserving differential pairs.

Parameters:
prefix_patternsSequence[str], optional

POSIX ERE patterns that define the prefixes to be grouped. Example: ["PCIe", "USB"] ➜ interpreted as ["PCIe.*", "USB.*"]. If None patterns are derived heuristically from the data set (see _infer_prefix_patterns()).

Returns:
Dict[str, List[List[str]]]

Keys are the original / generated pattern strings. Values are lists of batches; each batch is an alphabetically sorted list of net names. When prefix_patterns was supplied the list contains exactly one element (the complete group); in auto-discovery mode the list may contain multiple slices sized according to batch_size.

Notes

  • Differential recognition strips the suffixes _[PN], _[ML], _[+-] (case-insensitive).

  • The function updates the instance attribute batch_groups in place.

Examples

Explicit grouping (production intent):

>>> cfg.signal_nets = ["PCIe_RX0_P", "PCIe_RX0_N", "PCIe_TX0_P",
...                    "USB3_DP", "USB3_DN", "DDR4_A0", "DDR4_A1"]
>>> cfg.batch_size = 1_000          # ignored when patterns are supplied
>>> cfg.group_nets_by_prefix(["PCIe", "USB"])
{'PCIe.*': [['PCIe_RX0_N', 'PCIe_RX0_P', 'PCIe_TX0_P']],
 'USB.*':  [['USB3_DN', 'USB3_DP']]}

Auto-discovery with batching:

>>> cfg.group_nets_by_prefix()      # batch_size = 2
{'PCIe.*': [['PCIe_RX0_N', 'PCIe_RX0_P'], ['PCIe_TX0_P']],
 'USB.*':  [['USB3_DN', 'USB3_DP']],
 'DDR4.*': [['DDR4_A0', 'DDR4_A1']]}
HFSSAutoConfiguration.create_projects()#