Nets#

class pyedb.grpc.database.nets.Nets(p_edb: Any)#

Bases: pyedb.common.nets.CommonNets

Manages EDB methods for nets management accessible from Edb.nets property.

Examples

>>> from pyedb import Edb
>>> # Initialize EDB session
>>> edbapp = Edb(edbversion="2025.2")
>>> # Access Nets class
>>> nets = edbapp.nets
>>> # =================
>>> # Property examples
>>> # =================
>>> # Get all nets dictionary
>>> all_nets = nets.nets
>>> print("All nets:", list(all_nets.keys()))
>>> # Get net names list
>>> net_names = nets.netlist
>>> print("Net names:", net_names)
>>> # Get signal nets
>>> signal_nets = nets.signal
>>> print("Signal nets:", list(signal_nets.keys()))
>>> # Get power/ground nets
>>> power_nets = nets.power
>>> print("Power nets:", list(power_nets.keys()))
>>> # Get nets by components
>>> nets_by_comps = nets.nets_by_components
>>> print("Nets by components:", nets_by_comps)
>>> # Get components by nets
>>> comps_by_nets = nets.components_by_nets
>>> print("Components by nets:", comps_by_nets)
>>> # ===============
>>> # Method examples
>>> # ===============
>>> # Get net by name
>>> net_obj = nets["GND"]
>>> print(f"Net object: {net_obj.name}")
>>> # Check net existence
>>> if "PCIe_RX" in nets:
>>>    print("PCIe_RX exists")
>>> # Identify eligible power nets
>>> eligible_pwr = nets.eligible_power_nets(threshold=0.25)
>>> print("Eligible power nets:", [net.name for net in eligible_pwr])
>>> # Generate extended nets (deprecated)
>>> nets.generate_extended_nets(resistor_below=5, inductor_below=0.5, capacitor_above=0.1)
>>> # Classify nets
>>> nets.classify_nets(power_nets=["VDD_CPU", "VDD_MEM"], signal_nets=["PCIe_TX", "ETH_RX"])
>>> # Check power/ground status
>>> is_power = nets.is_power_gound_net(["VDD_CPU", "PCIe_TX"])
>>> print("Is power net:", is_power)
>>> # Get DC-connected nets
>>> dc_connected = nets.get_dcconnected_net_list(ground_nets=["GND"], res_value=0.002)
    print("DC-connected nets:", dc_connected)
>>> # Get power tree
>>> comp_list, columns, net_group = nets.get_powertree(power_net_name="VDD_CPU", ground_nets=["GND"])
>>> print("Power tree components:", comp_list)
>>> # Find net by name
>>> found_net = nets.get_net_by_name("PCIe_TX")
>>> print(f"Found net: {found_net.name}")
>>> # Delete nets
>>> deleted = nets.delete(["Unused_Net", "Test_Net"])
>>> print("Deleted nets:", deleted)
>>> # Find or create net
>>> new_net = nets.find_or_create_net(net_name="New_Net")
>>> print(f"Created net: {new_net.name}")
>>> # Check net-component association
>>> in_component = nets.is_net_in_component("U1", "VDD_CPU")
>>> print("Net in component:", in_component)
>>> # Find and fix disjoint nets (deprecated)
>>> fixed_nets = nets.find_and_fix_disjoint_nets(net_list=["PCIe_TX"], clean_disjoints_less_than=1e-6)
>>> print("Fixed nets:", fixed_nets)
>>> # Merge net polygons
>>> merged = nets.merge_nets_polygons(["VDD_CPU", "VDD_MEM"])
>>> print("Polygons merged:", merged)

# Close EDB session

>>> edbapp.close()

Overview#

eligible_power_nets

Identify nets eligible for power/ground classification based on area ratio.

generate_extended_nets

Generate extended nets based on component thresholds.

classify_nets

Reassign net classifications as power/ground or signal.

is_power_gound_net

Check if any net in a list is a power/ground net.

get_dcconnected_net_list

Get nets connected to DC through inductors and low-value resistors.

get_powertree

Retrieve power tree for a given power net.

get_net_by_name

Find a net by name.

delete

Delete one or more nets from the layout.

find_or_create_net

Find or create a net based on given criteria.

is_net_in_component

Check if a net belongs to a component.

find_and_fix_disjoint_nets

Find and fix disjoint nets.

merge_nets_polygons

Merge polygons for specified nets on each layer.

db

Database object.

nets

All nets in the layout.

netlist

List of all net names.

signal

Signal nets in the layout.

power

Power and ground nets in the layout.

nets_by_components

Mapping of components to their associated nets.

components_by_nets

Mapping of nets to their associated components.

__getitem__

Get a net by name.

__contains__

Check if a net exists in the layout.

Import detail#

from pyedb.grpc.database.nets import Nets

Property detail#

property Nets.db#

Database object.

property Nets.nets: Dict[str, pyedb.grpc.database.net.net.Net]#

All nets in the layout.

Returns:
dict[str, pyedb.grpc.database.net.net.Net]

Dictionary of net names to Net objects.

Examples

>>> all_nets = edb_nets.nets
>>> for net_name, net_obj in all_nets.items():
...     print(net_name, net_obj.is_power_ground)
property Nets.netlist: List[str]#

List of all net names.

Returns:
list[str]

Names of all nets in the layout.

Examples

>>> net_names = edb_nets.netlist
>>> print("Total nets:", len(net_names))
property Nets.signal: Dict[str, pyedb.grpc.database.net.net.Net]#

Signal nets in the layout.

Returns:
dict[str, pyedb.grpc.database.net.net.Net]

Dictionary of signal net names to Net objects.

Examples

>>> signal_nets = edb_nets.signal
>>> print("Signal nets:", list(signal_nets.keys()))
property Nets.power: Dict[str, pyedb.grpc.database.net.net.Net]#

Power and ground nets in the layout.

Returns:
dict[str, pyedb.grpc.database.net.net.Net]

Dictionary of power/ground net names to Net objects.

Examples

>>> power_nets = edb_nets.power
>>> print("Power nets:", list(power_nets.keys()))
property Nets.nets_by_components: Dict[str, List[str]]#

Mapping of components to their associated nets.

Returns:
dict[str, list[str]]

Dictionary mapping component names to list of net names.

Examples

>>> nets_by_comps = edb_nets.nets_by_components
>>> print("U1 nets:", nets_by_comps.get("U1", []))
property Nets.components_by_nets: Dict[str, List[str]]#

Mapping of nets to their associated components.

Returns:
dict[str, list[str]]

Dictionary mapping net names to list of component names.

Examples

>>> comps_by_nets = edb_nets.components_by_nets
>>> print("Components on GND:", comps_by_nets.get("GND", []))

Method detail#

Nets.__getitem__(name: str) pyedb.grpc.database.net.net.Net#

Get a net by name.

Parameters:
namestr

Name of the net to retrieve.

Returns:
pyedb.grpc.database.net.net.Net

Net object if found, otherwise None.

Examples

>>> gnd_net = edb_nets["GND"]
>>> print(gnd_net.name)
Nets.__contains__(name: str) bool#

Check if a net exists in the layout.

Parameters:
namestr

Name of the net to check.

Returns:
bool

True if the net exists, False otherwise.

Examples

>>> if "PCIe_RX" in edb_nets:
>>>     print("Net exists")
Nets.eligible_power_nets(threshold: float = 0.3) List[pyedb.grpc.database.net.net.Net]#

Identify nets eligible for power/ground classification based on area ratio.

Uses the same algorithm implemented in SIwave.

Parameters:
thresholdfloat, optional

Area ratio threshold. Nets with plane area ratio above this value are considered power/ground nets.

Returns:
list[pyedb.grpc.database.net.net.Net]

List of nets eligible as power/ground nets.

Examples

>>> eligible_pwr = edb_nets.eligible_power_nets(threshold=0.25)
>>> print([net.name for net in eligible_pwr])
Nets.generate_extended_nets(resistor_below: int | float = 10, inductor_below: int | float = 1, capacitor_above: int | float = 1, exception_list: List[str] | None = None, include_signal: bool = True, include_power: bool = True) List[Any]#

Generate extended nets based on component thresholds.

Deprecated since version pyedb: 0.30.0 Use pyedb.grpc.extended_nets.generate_extended_nets() instead.

Parameters:
resistor_belowint | float, optional

Resistor threshold value. Components below this value are considered.

inductor_belowint | float, optional

Inductor threshold value. Components below this value are considered.

capacitor_aboveint | float, optional

Capacitor threshold value. Components above this value are considered.

exception_listlist, optional

List of components to bypass during threshold checks.

include_signalbool, optional

Whether to include signal nets in extended net generation.

include_powerbool, optional

Whether to include power nets in extended net generation.

Returns:
list

List of generated extended nets.

Examples

>>> edb_nets.generate_extended_nets(resistor_below=5, inductor_below=0.5, capacitor_above=0.1)
Nets.classify_nets(power_nets: str | List[str] | None = None, signal_nets: str | List[str] | None = None) bool#

Reassign net classifications as power/ground or signal.

Parameters:
power_netsstr | list[str], optional

Nets to classify as power/ground.

signal_netsstr | list[str], optional

Nets to classify as signal.

Returns:
bool

True if successful, False otherwise.

Examples

>>> edb_nets.classify_nets(power_nets=["VDD_CPU", "VDD_MEM"], signal_nets=["PCIe_TX", "ETH_RX"])
Nets.is_power_gound_net(netname_list: str | List[str]) bool#

Check if any net in a list is a power/ground net.

Parameters:
netname_liststr | list[str]

Net name or list of net names to check.

Returns:
bool

True if any net is power/ground, False otherwise.

Examples

>>> is_power = edb_nets.is_power_gound_net(["VDD_CPU", "PCIe_TX"])
>>> print("Contains power net:", is_power)
Nets.get_dcconnected_net_list(ground_nets: List[str] = ['GND'], res_value: float = 0.001) List[Set[str]]#

Get nets connected to DC through inductors and low-value resistors.

Parameters:
ground_netstuple, optional

Ground net names. Default is (“GND”,).

res_valuefloat, optional

Resistance threshold value. Default is 0.001 ohms.

Returns:
list[set]

List of sets of connected nets.

Examples

>>> dc_connected = edb_nets.get_dcconnected_net_list(ground_nets=["GND"], res_value=0.002)
>>> for net_group in dc_connected:
...     print("Connected nets:", net_group)
Nets.get_powertree(power_net_name: str, ground_nets: List[str]) Tuple[List[List[str]], List[str], List[str]]#

Retrieve power tree for a given power net.

Parameters:
power_net_namestr

Name of the power net.

ground_netslist

List of ground net names.

Returns:
tuple

(component_list, component_list_columns, net_group)

Examples

>>> comp_list, columns, net_group = edb_nets.get_powertree(power_net_name="VDD_CPU", ground_nets=["GND"])
>>> print("Power tree components:", comp_list)
Nets.get_net_by_name(net_name: str) pyedb.grpc.database.net.net.Net | None#

Find a net by name.

Parameters:
net_namestr

Name of the net to find.

Returns:
pyedb.grpc.database.net.net.Net

Net object if found, otherwise None.

Examples

>>> found_net = edb_nets.get_net_by_name("PCIe_TX")
>>> if found_net:
...     print("Net found:", found_net.name)
Nets.delete(netlist: str | List[str]) List[str]#

Delete one or more nets from the layout.

Parameters:
netliststr | list[str]

Net name or list of net names to delete.

Returns:
list[str]

Names of nets that were deleted.

Examples

>>> deleted_nets = database.nets.delete(["Net1", "Net2"])
Nets.find_or_create_net(net_name: str = '', start_with: str = '', contain: str = '', end_with: str = '') pyedb.grpc.database.net.net.Net | List[pyedb.grpc.database.net.net.Net]#

Find or create a net based on given criteria.

Parameters:
net_namestr, optional

Exact name of the net to find or create.

start_withstr, optional

Find nets starting with this string.

containstr, optional

Find nets containing this string.

end_withstr, optional

Find nets ending with this string.

Returns:
pyedb.grpc.database.net.net.Net | list[pyedb.grpc.database.net.net.Net]

Net object or list of matching net objects.

Examples

>>> # Create new net
>>> new_net = edb_nets.find_or_create_net(net_name="New_Net")
>>>
>>> # Find existing net
>>> existing_net = edb_nets.find_or_create_net(net_name="GND")
>>>
>>> # Find nets starting with "VDD"
>>> vdd_nets = edb_nets.find_or_create_net(start_with="VDD")
>>>
>>> # Find nets ending with "_P"
>>> pos_nets = edb_nets.find_or_create_net(end_with="_P")
Nets.is_net_in_component(component_name: str, net_name: str) bool#

Check if a net belongs to a component.

Parameters:
component_namestr

Name of the component.

net_namestr

Name of the net.

Returns:
bool

True if the net is found in the component, False otherwise.

Examples

>>> in_component = edb_nets.is_net_in_component("U1", "VDD_CPU")
>>> print("Net in component:", in_component)
Nets.find_and_fix_disjoint_nets(net_list: List[str] | None = None, keep_only_main_net: bool = False, clean_disjoints_less_than: float = 0.0, order_by_area: bool = False) List[str]#

Find and fix disjoint nets.

Deprecated since version pyedb: 0.30.0 Use edb.layout_validation.disjoint_nets() instead.

Parameters:
net_listlist[str], optional

List of nets to check. Checks all nets if None.

keep_only_main_netbool, optional

Keep only the main net segment if True.

clean_disjoints_less_thanfloat, optional

Clean disjoint nets smaller than this area (in m²).

order_by_areabool, optional

Order naming by area instead of object count.

Returns:
list

New ne

New nets created.

Examples

>>> fixed_nets = edb_nets.find_and_fix_disjoint_nets(net_list=["PCIe_TX"], clean_disjoints_less_than=1e-6)
>>> print("Fixed nets:", fixed_nets)
Nets.merge_nets_polygons(net_names_list: str | List[str]) bool#

Merge polygons for specified nets on each layer.

Parameters:
net_names_liststr | list[str]

Net name or list of net names.

Returns:
bool

True if successful, False otherwise.

Examples

>>> merged = edb_nets.merge_nets_polygons(["VDD_CPU", "VDD_MEM"])
>>> print("Merge successful:", merged)