Nets#
- class pyedb.grpc.database.nets.Nets(p_edb: Any)#
Bases:
pyedb.common.nets.CommonNetsManages 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#
Identify nets eligible for power/ground classification based on area ratio. |
|
Generate extended nets based on component thresholds. |
|
Reassign net classifications as power/ground or signal. |
|
Check if any net in a list is a power/ground net. |
|
Get nets connected to DC through inductors and low-value resistors. |
|
Retrieve power tree for a given power net. |
|
Find a net by name. |
|
Delete one or more nets from the layout. |
|
Find or create a net based on given criteria. |
|
Check if a net belongs to a component. |
|
Find and fix disjoint nets. |
|
Merge polygons for specified nets on each layer. |
Database object. |
|
All nets in the layout. |
|
List of all net names. |
|
Signal nets in the layout. |
|
Power and ground nets in the layout. |
|
Mapping of components to their associated nets. |
|
Mapping of nets to their associated components. |
Get a net by name. |
|
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.
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.
Examples
>>> nets_by_comps = edb_nets.nets_by_components >>> print("U1 nets:", nets_by_comps.get("U1", []))
Method detail#
- Nets.__getitem__(name: str) pyedb.grpc.database.net.net.Net#
Get a net by name.
- Parameters:
- name
str Name of the net to retrieve.
- name
- Returns:
pyedb.grpc.database.net.net.NetNet 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.
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:
- threshold
float,optional Area ratio threshold. Nets with plane area ratio above this value are considered power/ground nets.
- threshold
- 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_below
int|float,optional Resistor threshold value. Components below this value are considered.
- inductor_below
int|float,optional Inductor threshold value. Components below this value are considered.
- capacitor_above
int|float,optional Capacitor threshold value. Components above this value are considered.
- exception_list
list,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.
- resistor_below
- Returns:
listList 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:
- 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:
- 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:
- Returns:
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:
- 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_name
str Name of the net to find.
- net_name
- Returns:
pyedb.grpc.database.net.net.NetNet 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:
- Returns:
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:
- 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:
- 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_list
list[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_than
float,optional Clean disjoint nets smaller than this area (in m²).
- order_by_areabool,
optional Order naming by area instead of object count.
- net_list
- Returns:
listNew 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)