pyedb 0.2.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.
- pyedb/__init__.py +17 -0
- pyedb/dotnet/__init__.py +0 -0
- pyedb/dotnet/application/Variables.py +2261 -0
- pyedb/dotnet/application/__init__.py +0 -0
- pyedb/dotnet/clr_module.py +103 -0
- pyedb/dotnet/edb.py +4237 -0
- pyedb/dotnet/edb_core/__init__.py +1 -0
- pyedb/dotnet/edb_core/cell/__init__.py +0 -0
- pyedb/dotnet/edb_core/cell/hierarchy/__init__.py +0 -0
- pyedb/dotnet/edb_core/cell/hierarchy/model.py +66 -0
- pyedb/dotnet/edb_core/components.py +2669 -0
- pyedb/dotnet/edb_core/configuration.py +423 -0
- pyedb/dotnet/edb_core/definition/__init__.py +0 -0
- pyedb/dotnet/edb_core/definition/component_def.py +166 -0
- pyedb/dotnet/edb_core/definition/component_model.py +30 -0
- pyedb/dotnet/edb_core/definition/definition_obj.py +18 -0
- pyedb/dotnet/edb_core/definition/definitions.py +12 -0
- pyedb/dotnet/edb_core/dotnet/__init__.py +0 -0
- pyedb/dotnet/edb_core/dotnet/database.py +1218 -0
- pyedb/dotnet/edb_core/dotnet/layout.py +238 -0
- pyedb/dotnet/edb_core/dotnet/primitive.py +1517 -0
- pyedb/dotnet/edb_core/edb_data/__init__.py +0 -0
- pyedb/dotnet/edb_core/edb_data/components_data.py +938 -0
- pyedb/dotnet/edb_core/edb_data/connectable.py +113 -0
- pyedb/dotnet/edb_core/edb_data/control_file.py +1268 -0
- pyedb/dotnet/edb_core/edb_data/design_options.py +35 -0
- pyedb/dotnet/edb_core/edb_data/edbvalue.py +45 -0
- pyedb/dotnet/edb_core/edb_data/hfss_extent_info.py +330 -0
- pyedb/dotnet/edb_core/edb_data/hfss_simulation_setup_data.py +1607 -0
- pyedb/dotnet/edb_core/edb_data/layer_data.py +576 -0
- pyedb/dotnet/edb_core/edb_data/nets_data.py +281 -0
- pyedb/dotnet/edb_core/edb_data/obj_base.py +19 -0
- pyedb/dotnet/edb_core/edb_data/padstacks_data.py +2080 -0
- pyedb/dotnet/edb_core/edb_data/ports.py +287 -0
- pyedb/dotnet/edb_core/edb_data/primitives_data.py +1397 -0
- pyedb/dotnet/edb_core/edb_data/simulation_configuration.py +2914 -0
- pyedb/dotnet/edb_core/edb_data/simulation_setup.py +716 -0
- pyedb/dotnet/edb_core/edb_data/siwave_simulation_setup_data.py +1205 -0
- pyedb/dotnet/edb_core/edb_data/sources.py +514 -0
- pyedb/dotnet/edb_core/edb_data/terminals.py +632 -0
- pyedb/dotnet/edb_core/edb_data/utilities.py +148 -0
- pyedb/dotnet/edb_core/edb_data/variables.py +91 -0
- pyedb/dotnet/edb_core/general.py +181 -0
- pyedb/dotnet/edb_core/hfss.py +1646 -0
- pyedb/dotnet/edb_core/layout.py +1244 -0
- pyedb/dotnet/edb_core/layout_validation.py +272 -0
- pyedb/dotnet/edb_core/materials.py +939 -0
- pyedb/dotnet/edb_core/net_class.py +335 -0
- pyedb/dotnet/edb_core/nets.py +1215 -0
- pyedb/dotnet/edb_core/padstack.py +1389 -0
- pyedb/dotnet/edb_core/siwave.py +1427 -0
- pyedb/dotnet/edb_core/stackup.py +2703 -0
- pyedb/edb_logger.py +396 -0
- pyedb/generic/__init__.py +0 -0
- pyedb/generic/constants.py +1063 -0
- pyedb/generic/data_handlers.py +320 -0
- pyedb/generic/design_types.py +104 -0
- pyedb/generic/filesystem.py +150 -0
- pyedb/generic/general_methods.py +1535 -0
- pyedb/generic/plot.py +1840 -0
- pyedb/generic/process.py +285 -0
- pyedb/generic/settings.py +224 -0
- pyedb/ipc2581/__init__.py +0 -0
- pyedb/ipc2581/bom/__init__.py +0 -0
- pyedb/ipc2581/bom/bom.py +21 -0
- pyedb/ipc2581/bom/bom_item.py +32 -0
- pyedb/ipc2581/bom/characteristics.py +37 -0
- pyedb/ipc2581/bom/refdes.py +16 -0
- pyedb/ipc2581/content/__init__.py +0 -0
- pyedb/ipc2581/content/color.py +38 -0
- pyedb/ipc2581/content/content.py +55 -0
- pyedb/ipc2581/content/dictionary_color.py +29 -0
- pyedb/ipc2581/content/dictionary_fill.py +28 -0
- pyedb/ipc2581/content/dictionary_line.py +30 -0
- pyedb/ipc2581/content/entry_color.py +13 -0
- pyedb/ipc2581/content/entry_line.py +14 -0
- pyedb/ipc2581/content/fill.py +15 -0
- pyedb/ipc2581/content/layer_ref.py +10 -0
- pyedb/ipc2581/content/standard_geometries_dictionary.py +72 -0
- pyedb/ipc2581/ecad/__init__.py +0 -0
- pyedb/ipc2581/ecad/cad_data/__init__.py +0 -0
- pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +26 -0
- pyedb/ipc2581/ecad/cad_data/cad_data.py +37 -0
- pyedb/ipc2581/ecad/cad_data/component.py +41 -0
- pyedb/ipc2581/ecad/cad_data/drill.py +30 -0
- pyedb/ipc2581/ecad/cad_data/feature.py +54 -0
- pyedb/ipc2581/ecad/cad_data/layer.py +41 -0
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +151 -0
- pyedb/ipc2581/ecad/cad_data/logical_net.py +32 -0
- pyedb/ipc2581/ecad/cad_data/outline.py +25 -0
- pyedb/ipc2581/ecad/cad_data/package.py +104 -0
- pyedb/ipc2581/ecad/cad_data/padstack_def.py +38 -0
- pyedb/ipc2581/ecad/cad_data/padstack_hole_def.py +24 -0
- pyedb/ipc2581/ecad/cad_data/padstack_instance.py +62 -0
- pyedb/ipc2581/ecad/cad_data/padstack_pad_def.py +26 -0
- pyedb/ipc2581/ecad/cad_data/path.py +89 -0
- pyedb/ipc2581/ecad/cad_data/phy_net.py +80 -0
- pyedb/ipc2581/ecad/cad_data/pin.py +31 -0
- pyedb/ipc2581/ecad/cad_data/polygon.py +169 -0
- pyedb/ipc2581/ecad/cad_data/profile.py +40 -0
- pyedb/ipc2581/ecad/cad_data/stackup.py +31 -0
- pyedb/ipc2581/ecad/cad_data/stackup_group.py +42 -0
- pyedb/ipc2581/ecad/cad_data/stackup_layer.py +21 -0
- pyedb/ipc2581/ecad/cad_data/step.py +275 -0
- pyedb/ipc2581/ecad/cad_header.py +33 -0
- pyedb/ipc2581/ecad/ecad.py +19 -0
- pyedb/ipc2581/ecad/spec.py +46 -0
- pyedb/ipc2581/history_record.py +37 -0
- pyedb/ipc2581/ipc2581.py +387 -0
- pyedb/ipc2581/logistic_header.py +25 -0
- pyedb/misc/__init__.py +0 -0
- pyedb/misc/aedtlib_personalib_install.py +14 -0
- pyedb/misc/downloads.py +322 -0
- pyedb/misc/misc.py +67 -0
- pyedb/misc/pyedb.runtimeconfig.json +13 -0
- pyedb/misc/siw_feature_config/__init__.py +0 -0
- pyedb/misc/siw_feature_config/emc/__init__.py +0 -0
- pyedb/misc/siw_feature_config/emc/component_tags.py +46 -0
- pyedb/misc/siw_feature_config/emc/net_tags.py +37 -0
- pyedb/misc/siw_feature_config/emc/tag_library.py +62 -0
- pyedb/misc/siw_feature_config/emc/xml_generic.py +78 -0
- pyedb/misc/siw_feature_config/emc_rule_checker_settings.py +179 -0
- pyedb/misc/utilities.py +27 -0
- pyedb/modeler/geometry_operators.py +2082 -0
- pyedb-0.2.0.dist-info/LICENSE +21 -0
- pyedb-0.2.0.dist-info/METADATA +208 -0
- pyedb-0.2.0.dist-info/RECORD +128 -0
- pyedb-0.2.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import re
|
|
2
|
+
|
|
3
|
+
from pyedb.dotnet.edb_core.edb_data.padstacks_data import EDBPadstackInstance
|
|
4
|
+
from pyedb.dotnet.edb_core.edb_data.primitives_data import EDBPrimitives
|
|
5
|
+
from pyedb.generic.general_methods import generate_unique_name, pyedb_function_handler
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class LayoutValidation:
|
|
9
|
+
"""Manages all layout validation capabilities"""
|
|
10
|
+
|
|
11
|
+
def __init__(self, pedb):
|
|
12
|
+
self._pedb = pedb
|
|
13
|
+
|
|
14
|
+
@pyedb_function_handler()
|
|
15
|
+
def dc_shorts(self, net_list=None, fix=False):
|
|
16
|
+
"""Find DC shorts on layout.
|
|
17
|
+
|
|
18
|
+
Parameters
|
|
19
|
+
----------
|
|
20
|
+
net_list : str or list[str], optional
|
|
21
|
+
List of nets.
|
|
22
|
+
fix : bool, optional
|
|
23
|
+
If `True`, rename all the nets. (default)
|
|
24
|
+
If `False`, only report dc shorts.
|
|
25
|
+
|
|
26
|
+
Returns
|
|
27
|
+
-------
|
|
28
|
+
List[List[str, str]]
|
|
29
|
+
[[net name, net name]].
|
|
30
|
+
|
|
31
|
+
Examples
|
|
32
|
+
--------
|
|
33
|
+
|
|
34
|
+
>>> edb = Edb("edb_file")
|
|
35
|
+
>>> dc_shorts = edb.layout_validation.dc_shorts()
|
|
36
|
+
|
|
37
|
+
"""
|
|
38
|
+
if not net_list:
|
|
39
|
+
net_list = list(self._pedb.nets.nets.keys())
|
|
40
|
+
elif isinstance(net_list, str):
|
|
41
|
+
net_list = [net_list]
|
|
42
|
+
_objects_list = {}
|
|
43
|
+
_padstacks_list = {}
|
|
44
|
+
for prim in self._pedb.modeler.primitives:
|
|
45
|
+
n_name = prim.net_name
|
|
46
|
+
if n_name in _objects_list:
|
|
47
|
+
_objects_list[n_name].append(prim)
|
|
48
|
+
else:
|
|
49
|
+
_objects_list[n_name] = [prim]
|
|
50
|
+
for pad in list(self._pedb.padstacks.instances.values()):
|
|
51
|
+
n_name = pad.net_name
|
|
52
|
+
if n_name in _padstacks_list:
|
|
53
|
+
_padstacks_list[n_name].append(pad)
|
|
54
|
+
else:
|
|
55
|
+
_padstacks_list[n_name] = [pad]
|
|
56
|
+
dc_shorts = []
|
|
57
|
+
all_shorted_nets = []
|
|
58
|
+
for net in net_list:
|
|
59
|
+
if net in all_shorted_nets:
|
|
60
|
+
continue
|
|
61
|
+
objs = []
|
|
62
|
+
for i in _objects_list.get(net, []):
|
|
63
|
+
objs.append(i)
|
|
64
|
+
for i in _padstacks_list.get(net, []):
|
|
65
|
+
objs.append(i)
|
|
66
|
+
if not len(objs):
|
|
67
|
+
self._pedb.nets[net].delete()
|
|
68
|
+
continue
|
|
69
|
+
|
|
70
|
+
connected_objs = objs[0].get_connected_objects()
|
|
71
|
+
connected_objs.append(objs[0])
|
|
72
|
+
net_dc_shorts = [obj for obj in connected_objs]
|
|
73
|
+
all_shorted_nets.append(net)
|
|
74
|
+
if net_dc_shorts:
|
|
75
|
+
dc_nets = list(set([obj.net.name for obj in net_dc_shorts if not obj.net.name == net]))
|
|
76
|
+
for dc in dc_nets:
|
|
77
|
+
if dc:
|
|
78
|
+
dc_shorts.append([net, dc])
|
|
79
|
+
all_shorted_nets.append(dc)
|
|
80
|
+
if fix:
|
|
81
|
+
temp = []
|
|
82
|
+
for i in net_dc_shorts:
|
|
83
|
+
temp.append(i.net.name)
|
|
84
|
+
temp_key = set(temp)
|
|
85
|
+
temp_count = {temp.count(i): i for i in temp_key}
|
|
86
|
+
temp_count = dict(sorted(temp_count.items()))
|
|
87
|
+
while True:
|
|
88
|
+
temp_name = list(temp_count.values()).pop()
|
|
89
|
+
if not temp_name.lower().startswith("unnamed"):
|
|
90
|
+
break
|
|
91
|
+
elif temp_name.lower():
|
|
92
|
+
break
|
|
93
|
+
elif len(temp) == 0:
|
|
94
|
+
break
|
|
95
|
+
for i in net_dc_shorts:
|
|
96
|
+
if not i.net.name == temp_name:
|
|
97
|
+
i.net = temp_name
|
|
98
|
+
return dc_shorts
|
|
99
|
+
|
|
100
|
+
@pyedb_function_handler()
|
|
101
|
+
def disjoint_nets(
|
|
102
|
+
self,
|
|
103
|
+
net_list=None,
|
|
104
|
+
keep_only_main_net=False,
|
|
105
|
+
clean_disjoints_less_than=0.0,
|
|
106
|
+
order_by_area=False,
|
|
107
|
+
keep_disjoint_pins=False,
|
|
108
|
+
):
|
|
109
|
+
"""Find and fix disjoint nets from a given netlist.
|
|
110
|
+
|
|
111
|
+
Parameters
|
|
112
|
+
----------
|
|
113
|
+
net_list : str, list, optional
|
|
114
|
+
List of nets on which check disjoints. If `None` is provided then the algorithm will loop on all nets.
|
|
115
|
+
keep_only_main_net : bool, optional
|
|
116
|
+
Remove all secondary nets other than principal one (the one with more objects in it). Default is `False`.
|
|
117
|
+
clean_disjoints_less_than : bool, optional
|
|
118
|
+
Clean all disjoint nets with area less than specified area in square meters. Default is `0.0` to disable it.
|
|
119
|
+
order_by_area : bool, optional
|
|
120
|
+
Whether if the naming order has to be by number of objects (fastest) or area (slowest but more accurate).
|
|
121
|
+
Default is ``False``.
|
|
122
|
+
keep_disjoint_pins : bool, optional
|
|
123
|
+
Whether if delete disjoints pins not connected to any other primitive or not. Default is ``False``.
|
|
124
|
+
|
|
125
|
+
Returns
|
|
126
|
+
-------
|
|
127
|
+
List
|
|
128
|
+
New nets created.
|
|
129
|
+
|
|
130
|
+
Examples
|
|
131
|
+
--------
|
|
132
|
+
|
|
133
|
+
>>> renamed_nets = edb.layout_validation.disjoint_nets(["GND","Net2"])
|
|
134
|
+
"""
|
|
135
|
+
timer_start = self._pedb._logger.reset_timer()
|
|
136
|
+
|
|
137
|
+
if not net_list:
|
|
138
|
+
net_list = list(self._pedb.nets.keys())
|
|
139
|
+
elif isinstance(net_list, str):
|
|
140
|
+
net_list = [net_list]
|
|
141
|
+
_objects_list = {}
|
|
142
|
+
_padstacks_list = {}
|
|
143
|
+
for prim in self._pedb.modeler.primitives:
|
|
144
|
+
n_name = prim.net_name
|
|
145
|
+
if n_name in _objects_list:
|
|
146
|
+
_objects_list[n_name].append(prim)
|
|
147
|
+
else:
|
|
148
|
+
_objects_list[n_name] = [prim]
|
|
149
|
+
for pad in list(self._pedb.padstacks.instances.values()):
|
|
150
|
+
n_name = pad.net_name
|
|
151
|
+
if n_name in _padstacks_list:
|
|
152
|
+
_padstacks_list[n_name].append(pad)
|
|
153
|
+
else:
|
|
154
|
+
_padstacks_list[n_name] = [pad]
|
|
155
|
+
new_nets = []
|
|
156
|
+
disjoints_objects = []
|
|
157
|
+
self._pedb._logger.reset_timer()
|
|
158
|
+
for net in net_list:
|
|
159
|
+
net_groups = []
|
|
160
|
+
obj_dict = {}
|
|
161
|
+
for i in _objects_list.get(net, []):
|
|
162
|
+
obj_dict[i.id] = i
|
|
163
|
+
for i in _padstacks_list.get(net, []):
|
|
164
|
+
obj_dict[i.id] = i
|
|
165
|
+
objs = list(obj_dict.values())
|
|
166
|
+
l = len(objs)
|
|
167
|
+
while l > 0:
|
|
168
|
+
l1 = objs[0].get_connected_object_id_set()
|
|
169
|
+
l1.append(objs[0].id)
|
|
170
|
+
repetition = False
|
|
171
|
+
for net_list in net_groups:
|
|
172
|
+
if set(l1).intersection(net_list):
|
|
173
|
+
net_groups.append([i for i in l1 if i not in net_list])
|
|
174
|
+
repetition = True
|
|
175
|
+
if not repetition:
|
|
176
|
+
net_groups.append(l1)
|
|
177
|
+
objs = [i for i in objs if i.id not in l1]
|
|
178
|
+
l = len(objs)
|
|
179
|
+
if len(net_groups) > 1:
|
|
180
|
+
|
|
181
|
+
def area_calc(elem):
|
|
182
|
+
sum = 0
|
|
183
|
+
for el in elem:
|
|
184
|
+
try:
|
|
185
|
+
if isinstance(obj_dict[el], EDBPrimitives):
|
|
186
|
+
if not obj_dict[el].is_void:
|
|
187
|
+
sum += obj_dict[el].area()
|
|
188
|
+
except:
|
|
189
|
+
pass
|
|
190
|
+
return sum
|
|
191
|
+
|
|
192
|
+
if order_by_area:
|
|
193
|
+
areas = [area_calc(i) for i in net_groups]
|
|
194
|
+
sorted_list = [x for _, x in sorted(zip(areas, net_groups), reverse=True)]
|
|
195
|
+
else:
|
|
196
|
+
sorted_list = sorted(net_groups, key=len, reverse=True)
|
|
197
|
+
for disjoints in sorted_list[1:]:
|
|
198
|
+
if keep_only_main_net:
|
|
199
|
+
for geo in disjoints:
|
|
200
|
+
try:
|
|
201
|
+
obj_dict[geo].delete()
|
|
202
|
+
except KeyError:
|
|
203
|
+
pass
|
|
204
|
+
elif len(disjoints) == 1 and (
|
|
205
|
+
clean_disjoints_less_than
|
|
206
|
+
and "area" in dir(obj_dict[disjoints[0]])
|
|
207
|
+
and obj_dict[disjoints[0]].area() < clean_disjoints_less_than
|
|
208
|
+
):
|
|
209
|
+
try:
|
|
210
|
+
obj_dict[disjoints[0]].delete()
|
|
211
|
+
except KeyError:
|
|
212
|
+
pass
|
|
213
|
+
elif (
|
|
214
|
+
len(disjoints) == 1
|
|
215
|
+
and not keep_disjoint_pins
|
|
216
|
+
and isinstance(obj_dict[disjoints[0]], EDBPadstackInstance)
|
|
217
|
+
):
|
|
218
|
+
try:
|
|
219
|
+
obj_dict[disjoints[0]].delete()
|
|
220
|
+
except KeyError:
|
|
221
|
+
pass
|
|
222
|
+
|
|
223
|
+
else:
|
|
224
|
+
new_net_name = generate_unique_name(net, n=6)
|
|
225
|
+
net_obj = self._pedb.nets.find_or_create_net(new_net_name)
|
|
226
|
+
if net_obj:
|
|
227
|
+
new_nets.append(net_obj.GetName())
|
|
228
|
+
for geo in disjoints:
|
|
229
|
+
try:
|
|
230
|
+
obj_dict[geo].net_name = net_obj
|
|
231
|
+
except KeyError:
|
|
232
|
+
pass
|
|
233
|
+
disjoints_objects.extend(disjoints)
|
|
234
|
+
self._pedb._logger.info("Found {} objects in {} new nets.".format(len(disjoints_objects), len(new_nets)))
|
|
235
|
+
self._pedb._logger.info_timer("Disjoint Cleanup Completed.", timer_start)
|
|
236
|
+
|
|
237
|
+
return new_nets
|
|
238
|
+
|
|
239
|
+
def illegal_net_names(self, fix=False):
|
|
240
|
+
"""Find and fix illegal net names."""
|
|
241
|
+
pattern = r"[\(\)\\\/:;*?<>\'\"|`~$]"
|
|
242
|
+
|
|
243
|
+
nets = self._pedb.nets.nets
|
|
244
|
+
|
|
245
|
+
renamed_nets = []
|
|
246
|
+
for net, val in nets.items():
|
|
247
|
+
if re.findall(pattern, net):
|
|
248
|
+
renamed_nets.append(net)
|
|
249
|
+
if fix:
|
|
250
|
+
new_name = re.sub(pattern, "_", net)
|
|
251
|
+
val.name = new_name
|
|
252
|
+
|
|
253
|
+
self._pedb._logger.info("Found {} illegal net names.".format(len(renamed_nets)))
|
|
254
|
+
return
|
|
255
|
+
|
|
256
|
+
def illegal_rlc_values(self, fix=False):
|
|
257
|
+
"""Find and fix RLC illegal values."""
|
|
258
|
+
inductors = self._pedb.components.inductors
|
|
259
|
+
|
|
260
|
+
temp = []
|
|
261
|
+
for k, v in inductors.items():
|
|
262
|
+
componentProperty = v.edbcomponent.GetComponentProperty()
|
|
263
|
+
model = componentProperty.GetModel().Clone()
|
|
264
|
+
pinpairs = model.PinPairs
|
|
265
|
+
|
|
266
|
+
if not len(list(pinpairs)): # pragma: no cover
|
|
267
|
+
temp.append(k)
|
|
268
|
+
if fix:
|
|
269
|
+
v.rlc_values = [0, 1, 0]
|
|
270
|
+
|
|
271
|
+
self._pedb._logger.info("Found {} inductors have no value.".format(len(temp)))
|
|
272
|
+
return
|