Skip to content

Commit

Permalink
FIX: import thermal (#497)
Browse files Browse the repository at this point in the history
* FIX: import thermal

* FIX: import thermal

* FIX: import thermal

* FIX: import thermal

* FIX: import thermal

* FIX: import thermal

* FIX: dcir settings

* FIX:

* MISC: Auto fixes from pre-commit.com hooks

For more information, see https://pre-commit.ci

* FIX:

* MISC: Auto fixes from pre-commit.com hooks

For more information, see https://pre-commit.ci

---------

Co-authored-by: ring630 <@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: svandenb-dev <[email protected]>
  • Loading branch information
3 people authored May 22, 2024
1 parent 9300e13 commit e767081
Show file tree
Hide file tree
Showing 6 changed files with 268 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
convert_netdict_to_pydict,
convert_pydict_to_netdict,
)
from pyedb.dotnet.edb_core.sim_setup_data.data.siw_dc_ir_settings import (
SiwaveDCIRSettings,
)
from pyedb.dotnet.edb_core.utilities.simulation_setup import BaseSimulationSetup
from pyedb.dotnet.sim_setup_data.data.siw_dc_ir_settings import SiwaveDCIRSettings
from pyedb.generic.general_methods import is_linux, pyedb_function_handler


Expand Down Expand Up @@ -986,7 +988,7 @@ def get_sim_setup_info(self):
val = val.replace("SourceTermsToGround(", "").replace(")", "").split(",")
for v in val:
source = v.split("=")
sources[source[0]] = source[1]
sources[source[0]] = int(source[1].replace("'", ""))
edb_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(
sources
)
Expand Down
3 changes: 3 additions & 0 deletions src/pyedb/dotnet/edb_core/sim_setup_data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pathlib import Path

workdir = Path(__file__).parent
3 changes: 3 additions & 0 deletions src/pyedb/dotnet/edb_core/sim_setup_data/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from pathlib import Path

workdir = Path(__file__).parent
235 changes: 235 additions & 0 deletions src/pyedb/dotnet/edb_core/sim_setup_data/data/siw_dc_ir_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,235 @@
# Copyright (C) 2023 - 2024 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.

from pyedb.dotnet.edb_core.general import (
convert_netdict_to_pydict,
convert_pydict_to_netdict,
)


class SiwaveDCIRSettings:
"""Class for DC IR settings."""

def __init__(self, parent):
self._parent = parent

@property
def export_dc_thermal_data(self):
"""Export DC Thermal Data.
Returns
-------
bool
``True`` when activated, ``False`` deactivated.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.ExportDCThermalData

@export_dc_thermal_data.setter
def export_dc_thermal_data(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.ExportDCThermalData = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def import_thermal_data(self):
"""Import Thermal Data.
Returns
-------
bool
``True`` when activated, ``False`` deactivated.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.ImportThermalData

@import_thermal_data.setter
def import_thermal_data(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.ImportThermalData = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def dc_report_show_active_devices(self):
"""DC Report Show Active Devices.
Returns
-------
bool
``True`` when activated, ``False`` deactivated.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.DCReportShowActiveDevices

@dc_report_show_active_devices.setter
def dc_report_show_active_devices(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.DCReportShowActiveDevices = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def per_pin_use_pin_format(self):
"""Per Pin Use Pin Format.
Returns
-------
bool
``True`` when activated, ``False`` deactivated.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.PerPinUsePinFormat

@per_pin_use_pin_format.setter
def per_pin_use_pin_format(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.PerPinUsePinFormat = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def use_loop_res_for_per_pin(self):
"""Use loop Res Per Pin.
Returns
-------
bool
``True`` when activated, ``False`` deactivated.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.UseLoopResForPerPin

@use_loop_res_for_per_pin.setter
def use_loop_res_for_per_pin(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.UseLoopResForPerPin = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def dc_report_config_file(self):
"""DC Report Config File.
Returns
-------
str
path to the DC report configuration file.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.DCReportConfigFile

@dc_report_config_file.setter
def dc_report_config_file(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.DCReportConfigFile = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def full_dc_report_path(self):
"""Full DC Report Path.
Returns
-------
str
full path to the DC report file.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.FullDCReportPath

@full_dc_report_path.setter
def full_dc_report_path(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.FullDCReportPath = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def icepak_temp_file(self):
"""Icepack Temp File.
Returns
-------
str
path to the temp Icepak file.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.IcepakTempFile

@icepak_temp_file.setter
def icepak_temp_file(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.IcepakTempFile = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def per_pin_res_path(self):
"""Per Pin Res Path.
Returns
-------
str
path for per pin res.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.PerPinResPath

@per_pin_res_path.setter
def per_pin_res_path(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.PerPinResPath = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def via_report_path(self):
"""Via Report Path.
Returns
-------
str
path for the Via Report.
"""
return self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.ViaReportPath

@via_report_path.setter
def via_report_path(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.ViaReportPath = value
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()

@property
def source_terms_to_ground(self):
"""A dictionary of SourceName, NodeToGround pairs,
where NodeToGround is one of 0 (unspecified), 1 (negative), 2 (positive).
Returns
-------
dict <str, int>
str: source name,
int: node to ground pairs, 0 (unspecified), 1 (negative), 2 (positive) .
"""
temp = self._parent.get_sim_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround
return convert_netdict_to_pydict(temp)

@source_terms_to_ground.setter
def source_terms_to_ground(self, value):
edb_setup_info = self._parent.get_sim_setup_info
edb_setup_info.SimulationSettings.DCIRSettings.SourceTermsToGround = convert_pydict_to_netdict(value)
self._parent._edb_object = self._parent._set_edb_setup_info(edb_setup_info)
self._parent._update_setup()
46 changes: 0 additions & 46 deletions src/pyedb/dotnet/sim_setup_data/data/siw_dc_ir_settings.py

This file was deleted.

23 changes: 23 additions & 0 deletions tests/legacy/system/test_edb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1896,3 +1896,26 @@ def test_create_hfss_pi_setup(self):
assert setup.settings.snap_length_threshold == "5um"
setup.settings.surface_roughness_model = "Hammerstad"
assert setup.settings.surface_roughness_model == "Hammerstad"

def test_dcir_properties(self, edb_examples):
edbapp = edb_examples.get_si_verse()
setup = edbapp.create_siwave_dc_setup()
setup.dc_ir_settings.export_dc_thermal_data = True
assert setup.dc_ir_settings.export_dc_thermal_data == True
assert not setup.dc_ir_settings.import_thermal_data
setup.dc_ir_settings.dc_report_show_active_devices = True
assert setup.dc_ir_settings.dc_report_show_active_devices == True
assert not setup.dc_ir_settings.per_pin_use_pin_format
assert setup.dc_ir_settings.use_loop_res_for_per_pin
setup.dc_ir_settings.dc_report_config_file = edbapp.edbpath
assert setup.dc_ir_settings.dc_report_config_file
setup.dc_ir_settings.full_dc_report_path = edbapp.edbpath
assert setup.dc_ir_settings.full_dc_report_path
setup.dc_ir_settings.icepak_temp_file = edbapp.edbpath
assert setup.dc_ir_settings.icepak_temp_file
setup.dc_ir_settings.per_pin_res_path = edbapp.edbpath
assert setup.dc_ir_settings.per_pin_res_path
setup.dc_ir_settings.via_report_path = edbapp.edbpath
assert setup.dc_ir_settings.via_report_path
setup.dc_ir_settings.source_terms_to_ground = {"test": 1}
assert setup.dc_ir_settings.source_terms_to_ground

0 comments on commit e767081

Please sign in to comment.