Replies: 3 comments
-
Hello @Farat1999, Can you check your odb++ file is correctly loaded ? |
Beta Was this translation helpful? Give feedback.
-
Hi @svandenb-dev, I load the ODB++ file using this script: import os
from pyedb import Edb
from config import WORKING_DIR
def import_odb_to_edb(odb_path, aedt_version, workdir=WORKING_DIR):
"""
Import an ODB++ archive (.tgz) and create an EDB.
Return:
aedb_path (str): Path to the created .aedb folder.
edb_app (Edb): An instance of the Edb class.
"""
if not os.path.exists(workdir):
os.makedirs(workdir)
# Import ODB++ design.
edb_app = Edb(edbpath=odb_path, edbversion=aedt_version)
edb_app.import_layout_pcb(odb_path, workdir)
aedb_name = os.path.splitext(os.path.basename(odb_path))[0] + ".aedb"
aedb_path = os.path.join(workdir, aedb_name)
return edb_app, aedb_path and I input the EDB object to another function from main: def auto_indentify_extd_nets(edb_app):
# ------The nets that are extended-----------------
suffixes = ("_C", "_AC", "_T", "_F")
all_nets = edb_app.nets.netlist
target_names = [name for name in all_nets if name.endswith(suffixes)]
print(f"Target nets: {target_names}")
# -------------------------------------------------
# -------Identify signal and PWR/GND nets----------
power_gnd_nets = edb_app.nets.power.keys()
signal_nets = edb_app.nets.signal.keys()
print(f"All power/gnd nets = {power_gnd_nets}\n")
print(f"All signal nets = {signal_nets}")
# -------------------------------------------------
# -------Get extended nets--------------- <------------ Generates the same error
extended_nets = edb_app.nets.generate_extended_nets(
resistor_below=10,
inductor_below=1,
capacitor_above=1e-9,
exception_list=[],
include_signal=True,
include_power=True,
)
for net_group in extended_nets:
print("Extended Net Group:", net_group)
# ------------------------------------------------- where the signal and pwr/gnd nets get listed as expected, but the error still occurs at the Error log
Here is the list of packages and their versions I have in my environment: Package list (pip list)
|
Beta Was this translation helpful? Give feedback.
-
I’ve just made an observation regarding the RLC values in the ODB++ file, some of them are listed as 'None'. for refdes, comp in edb_app.components.instances.items():
if comp.type in {"Resistor", "Inductor", "Capacitor"}:
r, l, c = comp.rlc_values
if any(val is None for val in (r,l,c)):
print(f"{refdes} ({comp.type}) has missing RLC values: R={r}, L={l}, C={c}")
else:
print(f"{refdes} ({comp.type}) has RLC values: R={r}, L={l}, C={c}") Here is a small batch of the print outputs: Output
Can this be the cause of the null-reference error? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have problems calling
generate_extended_nets
– I always hit a null-reference error.Error log
Exception has occurred: System.NullReferenceException Object reference not set to an instance of an object. at Ansys.Ansoft.Edb.Utility.Value..ctor(Tuple`2 complexNumber) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeConstructorWithoutAlloc(…)The code that I ran:
I am using pyedb version '0.49. 0'. Any idea what triggers the NullReferenceException?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions