pyedb 0.16.0__py3-none-any.whl → 0.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pyedb might be problematic. Click here for more details.

Files changed (32) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_components.py +47 -1
  3. pyedb/configuration/configuration.py +2 -0
  4. pyedb/dotnet/edb.py +43 -37
  5. pyedb/dotnet/edb_core/cell/hierarchy/component.py +12 -17
  6. pyedb/dotnet/edb_core/cell/hierarchy/hierarchy_obj.py +50 -0
  7. pyedb/dotnet/edb_core/cell/layout.py +0 -6
  8. pyedb/dotnet/edb_core/cell/voltage_regulator.py +0 -5
  9. pyedb/dotnet/edb_core/components.py +2 -2
  10. pyedb/dotnet/edb_core/dotnet/primitive.py +129 -3
  11. pyedb/dotnet/edb_core/edb_data/hfss_pi_simulation_setup_data.py +0 -460
  12. pyedb/dotnet/edb_core/edb_data/primitives_data.py +38 -38
  13. pyedb/dotnet/edb_core/edb_data/raptor_x_simulation_setup_data.py +1 -1
  14. pyedb/dotnet/edb_core/layout.py +21 -0
  15. pyedb/dotnet/edb_core/layout_validation.py +26 -0
  16. pyedb/dotnet/edb_core/nets.py +1 -1
  17. pyedb/dotnet/edb_core/sim_setup_data/data/sim_setup_info.py +1 -1
  18. pyedb/dotnet/edb_core/sim_setup_data/data/simulation_settings.py +357 -0
  19. pyedb/dotnet/edb_core/siwave.py +14 -0
  20. pyedb/dotnet/edb_core/utilities/hfss_simulation_setup.py +83 -0
  21. pyedb/dotnet/edb_core/utilities/simulation_setup.py +7 -4
  22. pyedb/misc/siw_feature_config/xtalk_scan/fd_xtalk_scan_config.py +91 -0
  23. pyedb/misc/siw_feature_config/xtalk_scan/impedance_scan_config.py +70 -0
  24. pyedb/misc/siw_feature_config/xtalk_scan/net.py +69 -0
  25. pyedb/misc/siw_feature_config/xtalk_scan/pins.py +60 -0
  26. pyedb/misc/siw_feature_config/xtalk_scan/scan_config.py +88 -0
  27. pyedb/misc/siw_feature_config/xtalk_scan/td_xtalk_config.py +104 -0
  28. pyedb/workflow.py +32 -0
  29. {pyedb-0.16.0.dist-info → pyedb-0.17.0.dist-info}/METADATA +1 -1
  30. {pyedb-0.16.0.dist-info → pyedb-0.17.0.dist-info}/RECORD +32 -24
  31. {pyedb-0.16.0.dist-info → pyedb-0.17.0.dist-info}/LICENSE +0 -0
  32. {pyedb-0.16.0.dist-info → pyedb-0.17.0.dist-info}/WHEEL +0 -0
@@ -100,7 +100,11 @@ class SimulationSetup(object):
100
100
 
101
101
  @property
102
102
  def sim_setup_info(self):
103
- return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo())
103
+ if self._edb_object:
104
+ if self._edb_object.GetType().ToString() not in ["kHFSSPI", "kRaptorX"]:
105
+ return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_object.GetSimSetupInfo())
106
+ elif self._edb_setup_info:
107
+ return SimSetupInfo(self._pedb, sim_setup=self, edb_object=self._edb_setup_info)
104
108
 
105
109
  @sim_setup_info.setter
106
110
  def sim_setup_info(self, sim_setup_info):
@@ -145,15 +149,14 @@ class SimulationSetup(object):
145
149
  "kAnalysisOption": None,
146
150
  "kSIwaveDCIR": utility.SIWaveDCIRSimulationSetup,
147
151
  "kSIwaveEMI": None,
148
- "kHFSSPI": None,
149
152
  "kDDRwizard": None,
150
153
  "kQ3D": None,
151
154
  "kNumSetupTypes": None,
152
155
  }
153
156
 
154
- version = self._pedb.edbversion.split(".")
155
- if int(version[0]) == 2024 and int(version[1]) == 2 or int(version[0]) > 2024:
157
+ if float(self._pedb.edbversion) >= 2024.2:
156
158
  setup_type_mapping["kRaptorX"] = utility.RaptorXSimulationSetup
159
+ if float(self._pedb.edbversion) >= 2025.1:
157
160
  setup_type_mapping["kHFSSPI"] = utility.HFSSPISimulationSetup
158
161
  sim_setup_type = self.sim_setup_info.sim_setup_type
159
162
  setup_utility = setup_type_mapping[sim_setup_type.ToString()]
@@ -0,0 +1,91 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from pyedb.generic.general_methods import ET
24
+ from pyedb.misc.siw_feature_config.xtalk_scan.net import SingleEndedNet
25
+
26
+
27
+ class CrosstalkFrequency:
28
+ """Siwave frequency domain crosstalk configuration handler."""
29
+
30
+ def __init__(self, pedb):
31
+ self._pedb = pedb
32
+ self.min_transmission_line_segment_length = "0.25mm"
33
+ self.frequency = "2e9Hz"
34
+ self.nets = {}
35
+
36
+ def extend_xml(self, parent):
37
+ """Write class xml section.
38
+
39
+ Parameters
40
+ ----------
41
+ parent : :class xml.etree.cElementTree object
42
+ Parent object.
43
+
44
+ """
45
+ freq_scan = ET.SubElement(parent, "FdXtalkConfig")
46
+ freq_scan.set("MinTlineSegmentLength", self.min_transmission_line_segment_length)
47
+ freq_scan.set("XtalkFrequency", self.frequency)
48
+ nets = ET.SubElement(freq_scan, "SingleEndedNets")
49
+ for net in list(self.nets.values()):
50
+ net.extend_xml(nets)
51
+
52
+ def add_single_ended_net(
53
+ self,
54
+ name,
55
+ next_warning_threshold=5.0,
56
+ next_violation_threshold=10.0,
57
+ fext_warning_threshold_warning=5.0,
58
+ fext_violation_threshold=5.0,
59
+ ):
60
+ """Add single ended net.
61
+
62
+ Parameters
63
+ ----------
64
+ name : str
65
+ Net name.
66
+ next_warning_threshold : flot or str
67
+ Near end crosstalk warning threshold value. Default value is ``5.0``.
68
+ next_violation_threshold : float, str
69
+ Near end crosstalk violation threshold value. Default value is ``10.0
70
+
71
+ fext_violation_threshold : float, str
72
+ Far end crosstalk violation threshold value, Default value is ``5.0``
73
+ fext_warning_threshold_warning : float, str
74
+ Far end crosstalk warning threshold value, Default value is ``5.0``
75
+
76
+ Returns
77
+ -------
78
+ bool
79
+ """
80
+ if name and name not in self.nets:
81
+ net = SingleEndedNet()
82
+ net.name = name
83
+ net.next_warning_threshold = next_warning_threshold
84
+ net.next_violation_threshold = next_violation_threshold
85
+ net.fext_warning_threshold = fext_warning_threshold_warning
86
+ net.fext_violation_threshold = fext_violation_threshold
87
+ self.nets[name] = net
88
+ return True
89
+ else:
90
+ self._pedb.logger.error(f"Net {name} already assigned.")
91
+ return False
@@ -0,0 +1,70 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from pyedb.generic.general_methods import ET
24
+ from pyedb.misc.siw_feature_config.xtalk_scan.net import SingleEndedNet
25
+
26
+
27
+ class ImpedanceScan:
28
+ def __init__(self, pedb):
29
+ self._pedb = pedb
30
+ self.min_transmission_line_segment_length = "0.25mm"
31
+ self.frequency = "2e9Hz"
32
+ self.nets = {}
33
+
34
+ def extend_xml(self, parent):
35
+ """Write object wml section"""
36
+ z_scan = ET.SubElement(parent, "Z0ScanConfig")
37
+ z_scan.set("MinTlineSegmentLength", self.min_transmission_line_segment_length)
38
+ z_scan.set("Z0Frequency", self.frequency)
39
+ single_ended_nets = ET.SubElement(z_scan, "SingleEndedNets")
40
+ for net in list(self.nets.values()):
41
+ net.extend_xml(single_ended_nets)
42
+
43
+ def add_single_ended_net(self, name, nominal_impedance=50.0, warning_threshold=17.0, violation_threshold=32.0):
44
+ """Add single ended net.
45
+
46
+ Parameters
47
+ ----------
48
+ name : str
49
+ Net name.
50
+ nominal_impedance : flot or str
51
+ nominal impedance in ohm. Default value is ``50,0``..
52
+ warning_threshold : float, str
53
+ Warning threshold value. Default value is ``17.0
54
+ violation_threshold : float, str
55
+ Violation threshold value, Default value is ``5.0``
56
+
57
+ Returns
58
+ -------
59
+ bool
60
+ """
61
+ if name and name not in self.nets:
62
+ net = SingleEndedNet()
63
+ net.name = name
64
+ net.nominal_impedance = nominal_impedance
65
+ net.warning_threshold = warning_threshold
66
+ net.violation_threshold = violation_threshold
67
+ self.nets[name] = net
68
+ else:
69
+ self._pedb.logger.error(f"Net {name} already assigned")
70
+ return False
@@ -0,0 +1,69 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from pyedb.generic.general_methods import ET
24
+
25
+
26
+ class SingleEndedNet:
27
+ """Single ended net class handler."""
28
+
29
+ def __init__(self):
30
+ self.name = None
31
+ self.nominal_impedance = None
32
+ self.warning_threshold = None
33
+ self.violation_threshold = None
34
+ self.fext_warning_threshold = None
35
+ self.fext_violation_threshold = None
36
+ self.next_warning_threshold = None
37
+ self.next_violation_threshold = None
38
+ self.driver_rise_time = None
39
+ self.voltage = None
40
+ self.driver_impedance = None
41
+ self.termination_impedance = None
42
+
43
+ def extend_xml(self, parent):
44
+ """Write XMl object section."""
45
+ net = ET.SubElement(parent, "Net")
46
+ if self.name is not None:
47
+ net.set("Name", self.name)
48
+ if self.nominal_impedance is not None:
49
+ net.set("NominalZ0", str(self.nominal_impedance))
50
+ if self.warning_threshold is not None:
51
+ net.set("WarningThreshold", str(self.warning_threshold))
52
+ if self.violation_threshold is not None:
53
+ net.set("ViolationThreshold", str(self.violation_threshold))
54
+ if self.fext_warning_threshold is not None:
55
+ net.set("FEXTWarningThreshold", str(self.fext_warning_threshold))
56
+ if self.fext_violation_threshold is not None:
57
+ net.set("FEXTViolationThreshold", str(self.fext_violation_threshold))
58
+ if self.next_warning_threshold is not None:
59
+ net.set("NEXTWarningThreshold", str(self.next_warning_threshold))
60
+ if self.next_violation_threshold is not None:
61
+ net.set("NEXTViolationThreshold", str(self.next_violation_threshold))
62
+ if self.driver_rise_time is not None:
63
+ net.set("DriverRiseTime", str(self.driver_rise_time))
64
+ if self.voltage is not None:
65
+ net.set("Voltage", str(self.voltage))
66
+ if self.driver_impedance is not None:
67
+ net.set("DriverImpedance", str(self.driver_impedance))
68
+ if self.termination_impedance is not None:
69
+ net.set("TerminationImpedance", str(self.termination_impedance))
@@ -0,0 +1,60 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+
24
+ from pyedb.generic.general_methods import ET
25
+
26
+
27
+ class DriverPin:
28
+ """Driver pin class handler."""
29
+
30
+ def __init__(self):
31
+ self.name = None
32
+ self.ref_des = None
33
+ self.driver_rise_time = None
34
+ self.voltage = None
35
+ self.driver_impedance = None
36
+
37
+ def extend_xml(self, parent):
38
+ """Write object to xml section."""
39
+ pin = ET.SubElement(parent, "Pin")
40
+ pin.set("Name", self.name)
41
+ pin.set("RefDes", self.ref_des)
42
+ pin.set("DriverRiseTime", str(self.driver_rise_time))
43
+ pin.set("Voltage", str(self.voltage))
44
+ pin.set("DriverImpedance", str(self.driver_impedance))
45
+
46
+
47
+ class ReceiverPin:
48
+ """Receiver pin class handler."""
49
+
50
+ def __init__(self):
51
+ self.name = None
52
+ self.ref_des = None
53
+ self.receiver_impedance = None
54
+
55
+ def extend_xml(self, parent):
56
+ """Write object to xml section."""
57
+ pin = ET.SubElement(parent, "Pin")
58
+ pin.set("Name", self.name)
59
+ pin.set("Name", self.name)
60
+ pin.set("ReceiverImpedance", str(self.receiver_impedance))
@@ -0,0 +1,88 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from enum import Enum
24
+ import os
25
+ import xml.etree as ET
26
+
27
+ from pyedb.generic.general_methods import ET
28
+ from pyedb.misc.siw_feature_config.xtalk_scan.fd_xtalk_scan_config import (
29
+ CrosstalkFrequency,
30
+ )
31
+ from pyedb.misc.siw_feature_config.xtalk_scan.impedance_scan_config import ImpedanceScan
32
+ from pyedb.misc.siw_feature_config.xtalk_scan.td_xtalk_config import CrossTalkTime
33
+
34
+
35
+ class ScanType(Enum):
36
+ IMPEDANCE = 0
37
+ FREQ_XTALK = 1
38
+ TIME_XTALK = 2
39
+
40
+
41
+ class SiwaveScanConfig:
42
+ """XML control file handle for Siwave crosstalk scan."""
43
+
44
+ def __init__(self, pedb, scan_type="impedance"):
45
+ self._pedb = pedb
46
+ self.file_path = ""
47
+ if scan_type == "impedance":
48
+ self.scan_type = ScanType.IMPEDANCE
49
+ elif scan_type == "frequency_xtalk":
50
+ self.scan_type = ScanType.FREQ_XTALK
51
+ elif scan_type == "time_xtalk":
52
+ self.scan_type = ScanType.TIME_XTALK
53
+ else:
54
+ self._pedb.logger.error(f"No valid scan type argument : {scan_type}")
55
+ self._pedb.logger.error('Supported argument : "impedance", "frequency_xtalk", "time_xtalk"')
56
+
57
+ self.impedance_scan = ImpedanceScan(self._pedb)
58
+ self.frequency_xtalk_scan = CrosstalkFrequency(self._pedb)
59
+ self.time_xtalk_scan = CrossTalkTime(self._pedb)
60
+
61
+ def write_xml(self):
62
+ """Write XML control file
63
+
64
+ Returns
65
+ -------
66
+ bool
67
+ """
68
+ if not self.file_path:
69
+ self._pedb.logger.error("No xml file path provided, please provide absolute valid one.")
70
+ return False
71
+ self._pedb.logger.info(f"Parsing xml file")
72
+ scan_config = ET.Element("SiwaveScanConfig")
73
+ scan_config.set("xmlns", "http://webstds.ipc.org/2581")
74
+ scan_config.set("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance")
75
+ if self.scan_type == ScanType.IMPEDANCE:
76
+ self.impedance_scan.extend_xml(scan_config)
77
+ elif self.scan_type == ScanType.FREQ_XTALK:
78
+ self.frequency_xtalk_scan.extend_xml(scan_config)
79
+ elif self.scan_type == ScanType.TIME_XTALK:
80
+ self.time_xtalk_scan.extend_xml(scan_config)
81
+ try:
82
+ ET.indent(scan_config)
83
+ except AttributeError:
84
+ pass
85
+ tree = ET.ElementTree(scan_config)
86
+ self._pedb.logger.info(f"Writing xml file")
87
+ tree.write(self.file_path)
88
+ return True if os.path.exists(self.file_path) else False
@@ -0,0 +1,104 @@
1
+ # Copyright (C) 2023 - 2024 ANSYS, Inc. and/or its affiliates.
2
+ # SPDX-License-Identifier: MIT
3
+ #
4
+ #
5
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ # of this software and associated documentation files (the "Software"), to deal
7
+ # in the Software without restriction, including without limitation the rights
8
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ # copies of the Software, and to permit persons to whom the Software is
10
+ # furnished to do so, subject to the following conditions:
11
+ #
12
+ # The above copyright notice and this permission notice shall be included in all
13
+ # copies or substantial portions of the Software.
14
+ #
15
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ # SOFTWARE.
22
+
23
+ from pyedb.generic.general_methods import ET
24
+ from pyedb.misc.siw_feature_config.xtalk_scan.net import SingleEndedNet
25
+ from pyedb.misc.siw_feature_config.xtalk_scan.pins import DriverPin, ReceiverPin
26
+
27
+
28
+ class CrossTalkTime:
29
+ """Time domain crosstalk configuration class handler."""
30
+
31
+ def __init__(self, pedb):
32
+ self._pedb = pedb
33
+ self.nets = {}
34
+ self.driver_pins = []
35
+ self.receiver_pins = []
36
+
37
+ def add_single_ended_net(
38
+ self,
39
+ name,
40
+ driver_rise_time=5.0,
41
+ voltage=10,
42
+ driver_impedance=5.0,
43
+ termination_impedance=5.0,
44
+ ):
45
+ """Add single ended net.
46
+
47
+ Parameters
48
+ ----------
49
+ name : str
50
+ Net name.
51
+ driver_rise_time : flot or str
52
+ Near end crosstalk warning threshold value. Default value is ``5.0``.
53
+ voltage : float, str
54
+ Near end crosstalk violation threshold value. Default value is ``10.0
55
+
56
+ driver_impedance : float, str
57
+ Far end crosstalk violation threshold value, Default value is ``5.0``
58
+ termination_impedance : float, str
59
+ Far end crosstalk warning threshold value, Default value is ``5.0``
60
+
61
+ Returns
62
+ -------
63
+ bool
64
+ """
65
+ if name and name not in self.nets:
66
+ net = SingleEndedNet()
67
+ net.name = name
68
+ net.driver_rise_time = driver_rise_time
69
+ net.voltage = voltage
70
+ net.driver_impedance = driver_impedance
71
+ net.termination_impedance = termination_impedance
72
+ self.nets[name] = net
73
+ return True
74
+ else:
75
+ self._pedb.logger.error(f"Net {name} already assigned.")
76
+ return False
77
+
78
+ def add_driver_pins(self, name, ref_des, rise_time="100ps", voltage=1.0, impedance=50.0):
79
+ pin = DriverPin()
80
+ pin.name = name
81
+ pin.ref_des = ref_des
82
+ pin.driver_rise_time = rise_time
83
+ pin.voltage = voltage
84
+ pin.driver_impedance = impedance
85
+ self.driver_pins.append(pin)
86
+
87
+ def add_receiver_pin(self, name, ref_des, impedance):
88
+ pin = ReceiverPin()
89
+ pin.name = name
90
+ pin.ref_des = ref_des
91
+ pin.receiver_impedance = impedance
92
+ self.receiver_pins.append(pin)
93
+
94
+ def extend_xml(self, parent):
95
+ time_scan = ET.SubElement(parent, "TdXtalkConfig")
96
+ single_ended_nets = ET.SubElement(time_scan, "SingleEndedNets")
97
+ for net in list(self.nets.values()):
98
+ net.extend_xml(single_ended_nets)
99
+ driver_pins = ET.SubElement(time_scan, "DriverPins")
100
+ for pin in self.driver_pins:
101
+ pin.extend_xml(driver_pins)
102
+ receiver_pins = ET.SubElement(time_scan, "ReceiverPins")
103
+ for pin in self.receiver_pins:
104
+ pin.extend_xml(receiver_pins)
pyedb/workflow.py ADDED
@@ -0,0 +1,32 @@
1
+ from pathlib import Path
2
+ from typing import Union
3
+
4
+ import pandas as pd
5
+
6
+
7
+ class Workflow:
8
+ def __init__(self, pedb):
9
+ self._pedb = pedb
10
+
11
+ def export_bill_of_materials(self, file_path: Union[str, Path]):
12
+ """Export bill of materials to a csv file.
13
+
14
+ Parameters
15
+ ----------
16
+ file_path : Union[str, Path]
17
+ Path to the csv file.
18
+
19
+ Returns
20
+ -------
21
+
22
+ """
23
+ file_path = str(file_path)
24
+ data = self._pedb.configuration.get_data_from_db(components=True)
25
+ comps = data["components"]
26
+ temp = []
27
+ for comp in comps:
28
+ comp_attrs = {k: v for k, v in comp.items() if isinstance(v, Union[str, float, int])}
29
+ temp.append(comp_attrs)
30
+
31
+ df = pd.DataFrame(temp)
32
+ return df.to_csv(file_path)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyedb
3
- Version: 0.16.0
3
+ Version: 0.17.0
4
4
  Summary: Higher-Level Pythonic Ansys Electronics Data Base
5
5
  Author-email: "ANSYS, Inc." <pyansys.core@ansys.com>
6
6
  Maintainer-email: PyEDB developers <simon.vandenbrouck@ansys.com>