pyedb 0.42.0__py3-none-any.whl → 0.44.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 (58) hide show
  1. pyedb/__init__.py +1 -1
  2. pyedb/configuration/cfg_boundaries.py +155 -72
  3. pyedb/configuration/cfg_components.py +1 -1
  4. pyedb/configuration/cfg_general.py +34 -16
  5. pyedb/configuration/cfg_modeler.py +162 -67
  6. pyedb/configuration/cfg_nets.py +33 -17
  7. pyedb/configuration/cfg_operations.py +63 -31
  8. pyedb/configuration/cfg_package_definition.py +113 -52
  9. pyedb/configuration/cfg_padstacks.py +611 -256
  10. pyedb/configuration/cfg_pin_groups.py +75 -33
  11. pyedb/configuration/cfg_ports_sources.py +75 -15
  12. pyedb/configuration/cfg_s_parameter_models.py +125 -70
  13. pyedb/configuration/cfg_setup.py +301 -257
  14. pyedb/configuration/cfg_stackup.py +166 -90
  15. pyedb/configuration/configuration.py +342 -209
  16. pyedb/dotnet/database/edb_data/design_options.py +19 -1
  17. pyedb/dotnet/database/edb_data/padstacks_data.py +16 -6
  18. pyedb/dotnet/database/geometry/polygon_data.py +4 -2
  19. pyedb/dotnet/database/padstack.py +6 -2
  20. pyedb/dotnet/database/sim_setup_data/data/sweep_data.py +63 -10
  21. pyedb/dotnet/database/utilities/simulation_setup.py +14 -30
  22. pyedb/dotnet/database/utilities/siwave_simulation_setup.py +30 -0
  23. pyedb/dotnet/edb.py +75 -105
  24. pyedb/grpc/database/components.py +1 -1
  25. pyedb/grpc/database/definition/component_def.py +15 -0
  26. pyedb/grpc/database/definition/component_pin.py +1 -1
  27. pyedb/grpc/database/definition/materials.py +27 -0
  28. pyedb/grpc/database/definition/package_def.py +20 -2
  29. pyedb/grpc/database/definition/padstack_def.py +5 -2
  30. pyedb/grpc/database/hierarchy/component.py +4 -2
  31. pyedb/grpc/database/hierarchy/pingroup.py +12 -8
  32. pyedb/grpc/database/layers/layer.py +28 -0
  33. pyedb/grpc/database/layers/stackup_layer.py +281 -40
  34. pyedb/grpc/database/layout/layout.py +12 -6
  35. pyedb/grpc/database/modeler.py +8 -8
  36. pyedb/grpc/database/primitive/bondwire.py +3 -3
  37. pyedb/grpc/database/primitive/circle.py +1 -1
  38. pyedb/grpc/database/primitive/padstack_instance.py +13 -3
  39. pyedb/grpc/database/primitive/path.py +2 -2
  40. pyedb/grpc/database/primitive/polygon.py +3 -3
  41. pyedb/grpc/database/primitive/primitive.py +1 -1
  42. pyedb/grpc/database/primitive/rectangle.py +2 -2
  43. pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +73 -30
  44. pyedb/grpc/database/source_excitations.py +7 -7
  45. pyedb/grpc/database/stackup.py +14 -6
  46. pyedb/grpc/database/terminal/bundle_terminal.py +3 -3
  47. pyedb/grpc/database/terminal/edge_terminal.py +2 -2
  48. pyedb/grpc/database/terminal/padstack_instance_terminal.py +42 -2
  49. pyedb/grpc/database/terminal/pingroup_terminal.py +35 -2
  50. pyedb/grpc/database/terminal/point_terminal.py +10 -1
  51. pyedb/grpc/database/terminal/terminal.py +4 -4
  52. pyedb/grpc/database/utility/hfss_extent_info.py +14 -10
  53. pyedb/grpc/edb.py +8 -8
  54. pyedb/misc/misc.py +13 -0
  55. {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/METADATA +1 -1
  56. {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/RECORD +58 -58
  57. {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/LICENSE +0 -0
  58. {pyedb-0.42.0.dist-info → pyedb-0.44.0.dist-info}/WHEEL +0 -0
@@ -50,9 +50,170 @@ class CfgLayer(CfgBase):
50
50
 
51
51
 
52
52
  class CfgStackup:
53
+ class Grpc:
54
+ def __init__(self, parent):
55
+ self.parent = parent
56
+ self._pedb = parent._pedb
57
+
58
+ def apply(self):
59
+ """Apply configuration settings to the current design"""
60
+ if len(self.parent.materials):
61
+ self.__apply_materials()
62
+
63
+ input_signal_layers = [i for i in self.parent.layers if i.type.lower() == "signal"]
64
+
65
+ if len(self.parent.layers):
66
+ if len(self._pedb.stackup.signal_layers) == 0:
67
+ self.__create_stackup()
68
+ elif not len(input_signal_layers) == len(self._pedb.stackup.signal_layers):
69
+ raise Exception(f"Input signal layer count do not match.")
70
+ else:
71
+ self.__apply_layers()
72
+
73
+ def __create_stackup(self):
74
+ layers = list()
75
+ layers.extend(self.parent.layers)
76
+ for l_attrs in layers:
77
+ attrs = l_attrs.get_attributes()
78
+ self._pedb.stackup.add_layer_bottom(**attrs)
79
+
80
+ def __apply_layers(self):
81
+ """Apply layer settings to the current design"""
82
+ layers = list()
83
+ layers.extend(self.parent.layers)
84
+
85
+ removal_list = []
86
+ lc_signal_layers = []
87
+ for name, obj in self._pedb.stackup.all_layers.items():
88
+ if obj.type == "dielectric":
89
+ removal_list.append(name)
90
+ elif obj.type == "signal":
91
+ lc_signal_layers.append(obj.id)
92
+ for l in removal_list:
93
+ self._pedb.stackup.remove_layer(l)
94
+
95
+ # update all signal layers
96
+ id_name = {i[0]: i[1] for i in self._pedb.stackup.layers_by_id}
97
+ signal_idx = 0
98
+ for l in layers:
99
+ if l.type == "signal":
100
+ layer_id = lc_signal_layers[signal_idx]
101
+ layer_name = id_name[layer_id]
102
+ attrs = l.get_attributes()
103
+ self._pedb.stackup.layers[layer_name].update(**attrs)
104
+ signal_idx = signal_idx + 1
105
+
106
+ # add all dielectric layers. Dielectric layers must be added last. Otherwise,
107
+ # dielectric layer will occupy signal and document layer id.
108
+ prev_layer_clone = None
109
+ l = layers.pop(0)
110
+ if l.type == "signal":
111
+ prev_layer_clone = self._pedb.stackup.layers[l.name]
112
+ else:
113
+ attrs = l.get_attributes()
114
+ prev_layer_clone = self._pedb.stackup.add_layer_top(**attrs)
115
+ for idx, l in enumerate(layers):
116
+ if l.type == "dielectric":
117
+ attrs = l.get_attributes()
118
+ prev_layer_clone = self._pedb.stackup.add_layer_below(
119
+ base_layer_name=prev_layer_clone.name, **attrs
120
+ )
121
+ elif l.type == "signal":
122
+ prev_layer_clone = self._pedb.stackup.layers[l.name]
123
+
124
+ def __apply_materials(self):
125
+ """Apply material settings to the current design"""
126
+ materials_in_db = {i.lower(): i for i, _ in self._pedb.materials.materials.items()}
127
+ for mat_in_cfg in self.parent.materials:
128
+ if mat_in_cfg.name.lower() in materials_in_db:
129
+ self._pedb.materials.delete_material(materials_in_db[mat_in_cfg.name.lower()])
130
+
131
+ attrs = mat_in_cfg.get_attributes()
132
+ mat = self._pedb.materials.add_material(**attrs)
133
+
134
+ def get_materials_from_db(self):
135
+ materials = []
136
+ for name, p in self._pedb.materials.materials.items():
137
+ mat = {}
138
+ for p_name in CfgMaterial().__dict__:
139
+ mat[p_name] = getattr(p, p_name)
140
+ materials.append(mat)
141
+ return materials
142
+
143
+ def get_layers_from_db(self):
144
+ layers = []
145
+ for name, obj in self._pedb.stackup.all_layers.items():
146
+ layers.append(obj.properties)
147
+ return layers
148
+
149
+ def get_data_from_db(self):
150
+ """Get configuration data from layout.
151
+
152
+ Returns
153
+ -------
154
+ dict
155
+ """
156
+ stackup = {}
157
+ materials = self.get_materials_from_db()
158
+ stackup["materials"] = materials
159
+ layers = self.get_layers_from_db()
160
+ stackup["layers"] = layers
161
+ return stackup
162
+
163
+ class DotNet(Grpc):
164
+ def __init__(self, parent):
165
+ super().__init__(parent)
166
+
167
+ def __apply_layers(self):
168
+ """Apply layer settings to the current design"""
169
+ layers = list()
170
+ layers.extend(self.parent.layers)
171
+
172
+ removal_list = []
173
+ lc_signal_layers = []
174
+ for name, obj in self._pedb.stackup.all_layers.items():
175
+ if obj.type == "dielectric":
176
+ removal_list.append(name)
177
+ elif obj.type == "signal":
178
+ lc_signal_layers.append(obj.id)
179
+ for l in removal_list:
180
+ self._pedb.stackup.remove_layer(l)
181
+
182
+ # update all signal layers
183
+ id_name = {i[0]: i[1] for i in self._pedb.stackup.layers_by_id}
184
+ signal_idx = 0
185
+ for l in layers:
186
+ if l.type == "signal":
187
+ layer_id = lc_signal_layers[signal_idx]
188
+ layer_name = id_name[layer_id]
189
+ attrs = l.get_attributes()
190
+ self._pedb.stackup.layers[layer_name].update(**attrs)
191
+ signal_idx = signal_idx + 1
192
+
193
+ # add all dielectric layers. Dielectric layers must be added last. Otherwise,
194
+ # dielectric layer will occupy signal and document layer id.
195
+ prev_layer_clone = None
196
+ l = layers.pop(0)
197
+ if l.type == "signal":
198
+ prev_layer_clone = self._pedb.stackup.layers[l.name]
199
+ else:
200
+ attrs = l.get_attributes()
201
+ prev_layer_clone = self._pedb.stackup.add_layer_top(**attrs)
202
+ for idx, l in enumerate(layers):
203
+ if l.type == "dielectric":
204
+ attrs = l.get_attributes()
205
+ prev_layer_clone = self._pedb.stackup.add_layer_below(
206
+ base_layer_name=prev_layer_clone.name, **attrs
207
+ )
208
+ elif l.type == "signal":
209
+ prev_layer_clone = self._pedb.stackup.layers[l.name]
210
+
53
211
  def __init__(self, pedb: Edb, data):
54
212
  self._pedb = pedb
55
-
213
+ if self._pedb.grpc:
214
+ self.api = self.Grpc(self)
215
+ else:
216
+ self.api = self.DotNet(self)
56
217
  self.materials = [CfgMaterial(**mat) for mat in data.get("materials", [])]
57
218
  self.layers = [CfgLayer(**lay) for lay in data.get("layers", [])]
58
219
 
@@ -77,93 +238,13 @@ class CfgStackup:
77
238
  materials.append(i.material)
78
239
 
79
240
  def apply(self):
80
- """Apply configuration settings to the current design"""
81
- if len(self.materials):
82
- self.__apply_materials()
83
-
84
- input_signal_layers = [i for i in self.layers if i.type.lower() == "signal"]
85
-
86
- if len(self.layers):
87
- if len(self._pedb.stackup.signal_layers) == 0:
88
- self.__create_stackup()
89
- elif not len(input_signal_layers) == len(self._pedb.stackup.signal_layers):
90
- raise Exception(f"Input signal layer count do not match.")
91
- else:
92
- self.__apply_layers()
93
-
94
- def __create_stackup(self):
95
- layers = list()
96
- layers.extend(self.layers)
97
- for l_attrs in layers:
98
- attrs = l_attrs.get_attributes()
99
- self._pedb.stackup.add_layer_bottom(**attrs)
100
-
101
- def __apply_layers(self):
102
- """Apply layer settings to the current design"""
103
- layers = list()
104
- layers.extend(self.layers)
105
-
106
- removal_list = []
107
- lc_signal_layers = []
108
- for name, obj in self._pedb.stackup.all_layers.items():
109
- if obj.type == "dielectric":
110
- removal_list.append(name)
111
- elif obj.type == "signal":
112
- lc_signal_layers.append(obj.id)
113
- for l in removal_list:
114
- self._pedb.stackup.remove_layer(l)
115
-
116
- # update all signal layers
117
- id_name = {i[0]: i[1] for i in self._pedb.stackup.layers_by_id}
118
- signal_idx = 0
119
- for l in layers:
120
- if l.type == "signal":
121
- layer_id = lc_signal_layers[signal_idx]
122
- layer_name = id_name[layer_id]
123
- attrs = l.get_attributes()
124
- self._pedb.stackup.layers[layer_name].update(**attrs)
125
- signal_idx = signal_idx + 1
126
-
127
- # add all dielectric layers. Dielectric layers must be added last. Otherwise,
128
- # dielectric layer will occupy signal and document layer id.
129
- prev_layer_clone = None
130
- l = layers.pop(0)
131
- if l.type == "signal":
132
- prev_layer_clone = self._pedb.stackup.layers[l.name]
133
- else:
134
- attrs = l.get_attributes()
135
- prev_layer_clone = self._pedb.stackup.add_layer_top(**attrs)
136
- for idx, l in enumerate(layers):
137
- if l.type == "dielectric":
138
- attrs = l.get_attributes()
139
- prev_layer_clone = self._pedb.stackup.add_layer_below(base_layer_name=prev_layer_clone.name, **attrs)
140
- elif l.type == "signal":
141
- prev_layer_clone = self._pedb.stackup.layers[l.name]
142
-
143
- def __apply_materials(self):
144
- """Apply material settings to the current design"""
145
- materials_in_db = {i.lower(): i for i, _ in self._pedb.materials.materials.items()}
146
- for mat_in_cfg in self.materials:
147
- if mat_in_cfg.name.lower() in materials_in_db:
148
- self._pedb.materials.delete_material(materials_in_db[mat_in_cfg.name.lower()])
149
-
150
- attrs = mat_in_cfg.get_attributes()
151
- mat = self._pedb.materials.add_material(**attrs)
241
+ self.api.apply()
152
242
 
153
243
  def get_materials_from_db(self):
154
- materials = []
155
- for name, p in self._pedb.materials.materials.items():
156
- mat = {}
157
- for p_name in CfgMaterial().__dict__:
158
- mat[p_name] = getattr(p, p_name)
159
- materials.append(mat)
160
- return materials
244
+ return self.api.get_materials_from_db()
161
245
 
162
246
  def get_layers_from_db(self):
163
- layers = []
164
- for name, obj in self._pedb.stackup.all_layers.items():
165
- layers.append(obj.properties)
166
- return layers
247
+ return self.api.get_layers_from_db()
167
248
 
168
249
  def get_data_from_db(self):
169
250
  """Get configuration data from layout.
@@ -172,9 +253,4 @@ class CfgStackup:
172
253
  -------
173
254
  dict
174
255
  """
175
- stackup = {}
176
- materials = self.get_materials_from_db()
177
- stackup["materials"] = materials
178
- layers = self.get_layers_from_db()
179
- stackup["layers"] = layers
180
- return stackup
256
+ return self.api.get_data_from_db()