diff --git a/src/pyedb/configuration/cfg_components.py b/src/pyedb/configuration/cfg_components.py index f88fbb8458..46517a6a7d 100644 --- a/src/pyedb/configuration/cfg_components.py +++ b/src/pyedb/configuration/cfg_components.py @@ -98,14 +98,42 @@ def _set_model_properties_to_edb(self): m = self._pedb._edb.Cell.Hierarchy.PinPairModel() for i in self.pin_pair_model: p = self._pedb._edb.Utility.PinPair(str(i["first_pin"]), str(i["second_pin"])) + res = i.get("resistance") + if res is None: + # If resistance is not defined, set it to 0 and disable it + res = "0ohm" + en_res = False + else: + # If resistance is defined, use the provided value and enabled status + res = i["resistance"] + en_res = i.get("resistance_enabled", True) + ind = i.get("inductance") + if ind is None: + # If inductance is not defined, set it to 0 and disable it + ind = "0nH" + en_ind = False + else: + # If inductance is defined, use the provided value and enabled status + ind = i["inductance"] + en_ind = i.get("inductance_enabled", True) + cap = i.get("capacitance") + if cap is None: + # If capacitance is not defined, set it to 0 and disable it + cap = "0pF" + en_cap = False + else: + # If capacitance is defined, use the provided value and enabled status + cap = i["capacitance"] + en_cap = i.get("capacitance_enabled", True) + rlc = self._pedb._edb.Utility.Rlc( - self._pedb.edb_value(i["resistance"]), - i["resistance_enabled"], - self._pedb.edb_value(i["inductance"]), - i["inductance_enabled"], - self._pedb.edb_value(i["capacitance"]), - i["capacitance_enabled"], - i["is_parallel"], + self._pedb.edb_value(res), + en_res, + self._pedb.edb_value(ind), + en_ind, + self._pedb.edb_value(cap), + en_cap, + i.get("is_parallel", False), ) m.SetPinPairRlc(p, rlc) c_p.SetModel(m) diff --git a/src/pyedb/workflows/utilities/__init__.py b/src/pyedb/workflows/utilities/__init__.py index e69de29bb2..919240eaef 100644 --- a/src/pyedb/workflows/utilities/__init__.py +++ b/src/pyedb/workflows/utilities/__init__.py @@ -0,0 +1,21 @@ +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. +# SPDX-License-Identifier: MIT +# +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. diff --git a/src/pyedb/workflows/utilities/cutout.py b/src/pyedb/workflows/utilities/cutout.py index 8bc7d3b350..333b6dfc72 100644 --- a/src/pyedb/workflows/utilities/cutout.py +++ b/src/pyedb/workflows/utilities/cutout.py @@ -1,4 +1,4 @@ -# Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2023 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # #