pyedb 0.38.0__py3-none-any.whl → 0.39.1__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 +1 -1
- pyedb/common/nets.py +53 -139
- pyedb/configuration/cfg_components.py +1 -1
- pyedb/configuration/cfg_general.py +4 -2
- pyedb/configuration/cfg_modeler.py +1 -1
- pyedb/configuration/cfg_package_definition.py +1 -1
- pyedb/configuration/cfg_padstacks.py +1 -1
- pyedb/configuration/cfg_ports_sources.py +56 -23
- pyedb/configuration/configuration.py +18 -1
- pyedb/dotnet/{application → database}/Variables.py +21 -21
- pyedb/dotnet/{edb_core → database}/cell/connectable.py +5 -5
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/component.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/hierarchy_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/layout.py +17 -17
- pyedb/dotnet/{edb_core → database}/cell/layout_obj.py +3 -3
- pyedb/dotnet/{edb_core → database}/cell/primitive/bondwire.py +1 -1
- pyedb/dotnet/{edb_core → database}/cell/primitive/path.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/primitive/primitive.py +14 -14
- pyedb/dotnet/{edb_core → database}/cell/terminal/bundle_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/edge_terminal.py +4 -4
- pyedb/dotnet/{edb_core → database}/cell/terminal/padstack_instance_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/pingroup_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/point_terminal.py +2 -2
- pyedb/dotnet/{edb_core → database}/cell/terminal/terminal.py +11 -11
- pyedb/dotnet/{edb_core → database}/cell/voltage_regulator.py +2 -2
- pyedb/dotnet/{edb_core → database}/components.py +101 -124
- pyedb/dotnet/{edb_core → database}/definition/component_def.py +5 -5
- pyedb/dotnet/{edb_core → database}/definition/component_model.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definition_obj.py +1 -1
- pyedb/dotnet/{edb_core → database}/definition/definitions.py +2 -2
- pyedb/dotnet/{edb_core → database}/definition/package_def.py +4 -4
- pyedb/dotnet/{edb_core → database}/dotnet/database.py +8 -8
- pyedb/dotnet/{edb_core → database}/dotnet/primitive.py +9 -9
- pyedb/dotnet/{edb_core → database}/edb_data/control_file.py +12 -12
- pyedb/dotnet/{edb_core → database}/edb_data/hfss_extent_info.py +7 -7
- pyedb/dotnet/{edb_core → database}/edb_data/nets_data.py +10 -13
- pyedb/dotnet/{edb_core → database}/edb_data/padstacks_data.py +16 -16
- pyedb/dotnet/{edb_core → database}/edb_data/ports.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/{edb_core → database}/edb_data/raptor_x_simulation_setup_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/simulation_configuration.py +10 -10
- pyedb/dotnet/{edb_core → database}/edb_data/sources.py +4 -4
- pyedb/dotnet/{edb_core → database}/edb_data/variables.py +1 -1
- pyedb/dotnet/{edb_core → database}/geometry/polygon_data.py +4 -4
- pyedb/dotnet/{edb_core → database}/hfss.py +8 -8
- pyedb/dotnet/{edb_core → database}/layout_obj_instance.py +1 -1
- pyedb/dotnet/{edb_core → database}/layout_validation.py +2 -2
- pyedb/dotnet/{edb_core → database}/materials.py +23 -8
- pyedb/dotnet/{edb_core → database}/modeler.py +27 -27
- pyedb/dotnet/{edb_core → database}/net_class.py +8 -8
- pyedb/dotnet/{edb_core → database}/nets.py +12 -12
- pyedb/dotnet/{edb_core → database}/padstack.py +15 -15
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/mesh_operation.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/settings.py +3 -3
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sim_setup_info.py +2 -2
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/simulation_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/siw_dc_ir_settings.py +1 -1
- pyedb/dotnet/{edb_core → database}/sim_setup_data/data/sweep_data.py +1 -1
- pyedb/dotnet/{edb_core → database}/siwave.py +10 -10
- pyedb/dotnet/{edb_core → database}/stackup.py +12 -12
- pyedb/dotnet/{edb_core → database}/utilities/hfss_simulation_setup.py +15 -15
- pyedb/dotnet/{edb_core → database}/utilities/obj_base.py +1 -1
- pyedb/dotnet/{edb_core → database}/utilities/simulation_setup.py +3 -3
- pyedb/dotnet/{edb_core → database}/utilities/siwave_simulation_setup.py +6 -6
- pyedb/dotnet/edb.py +117 -112
- pyedb/generic/design_types.py +26 -19
- pyedb/generic/general_methods.py +1 -1
- pyedb/generic/plot.py +0 -2
- pyedb/grpc/database/__init__.py +1 -0
- pyedb/grpc/database/components.py +2354 -0
- pyedb/grpc/database/control_file.py +1277 -0
- pyedb/grpc/database/definition/component_def.py +218 -0
- pyedb/grpc/database/definition/component_model.py +39 -0
- pyedb/grpc/database/definition/component_pin.py +32 -0
- pyedb/grpc/database/definition/materials.py +1207 -0
- pyedb/grpc/database/definition/n_port_component_model.py +34 -0
- pyedb/grpc/database/definition/package_def.py +227 -0
- pyedb/grpc/database/definition/padstack_def.py +842 -0
- pyedb/grpc/database/definitions.py +70 -0
- pyedb/grpc/database/general.py +43 -0
- pyedb/grpc/database/geometry/__init__.py +0 -0
- pyedb/grpc/database/geometry/arc_data.py +93 -0
- pyedb/grpc/database/geometry/point_3d_data.py +79 -0
- pyedb/grpc/database/geometry/point_data.py +30 -0
- pyedb/grpc/database/geometry/polygon_data.py +133 -0
- pyedb/grpc/database/hfss.py +1279 -0
- pyedb/grpc/database/hierarchy/__init__.py +0 -0
- pyedb/grpc/database/hierarchy/component.py +1301 -0
- pyedb/grpc/database/hierarchy/model.py +31 -0
- pyedb/grpc/database/hierarchy/netlist_model.py +30 -0
- pyedb/grpc/database/hierarchy/pin_pair_model.py +128 -0
- pyedb/grpc/database/hierarchy/pingroup.py +245 -0
- pyedb/grpc/database/hierarchy/s_parameter_model.py +33 -0
- pyedb/grpc/database/hierarchy/spice_model.py +48 -0
- pyedb/grpc/database/layers/__init__.py +0 -0
- pyedb/grpc/database/layers/layer.py +57 -0
- pyedb/grpc/database/layers/stackup_layer.py +410 -0
- pyedb/grpc/database/layout/__init__.py +0 -0
- pyedb/grpc/database/layout/cell.py +30 -0
- pyedb/grpc/database/layout/layout.py +196 -0
- pyedb/grpc/database/layout/voltage_regulator.py +149 -0
- pyedb/grpc/database/layout_validation.py +319 -0
- pyedb/grpc/database/modeler.py +1468 -0
- pyedb/grpc/database/net/__init__.py +0 -0
- pyedb/grpc/database/net/differential_pair.py +138 -0
- pyedb/grpc/database/net/extended_net.py +340 -0
- pyedb/grpc/database/net/net.py +198 -0
- pyedb/grpc/database/net/net_class.py +93 -0
- pyedb/grpc/database/nets.py +633 -0
- pyedb/grpc/database/padstacks.py +1500 -0
- pyedb/grpc/database/ports/__init__.py +0 -0
- pyedb/grpc/database/ports/ports.py +396 -0
- pyedb/grpc/database/primitive/__init__.py +3 -0
- pyedb/grpc/database/primitive/bondwire.py +181 -0
- pyedb/grpc/database/primitive/circle.py +75 -0
- pyedb/grpc/database/primitive/padstack_instance.py +1116 -0
- pyedb/grpc/database/primitive/path.py +346 -0
- pyedb/grpc/database/primitive/polygon.py +276 -0
- pyedb/grpc/database/primitive/primitive.py +739 -0
- pyedb/grpc/database/primitive/rectangle.py +146 -0
- pyedb/grpc/database/simulation_setup/__init__.py +0 -0
- pyedb/grpc/database/simulation_setup/adaptive_frequency.py +33 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_meshing_settings.py +32 -0
- pyedb/grpc/database/simulation_setup/hfss_advanced_settings.py +59 -0
- pyedb/grpc/database/simulation_setup/hfss_dcr_settings.py +35 -0
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +61 -0
- pyedb/grpc/database/simulation_setup/hfss_settings_options.py +78 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_settings.py +118 -0
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +355 -0
- pyedb/grpc/database/simulation_setup/hfss_solver_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/mesh_operation.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_advanced_settings.py +34 -0
- pyedb/grpc/database/simulation_setup/raptor_x_general_settings.py +33 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_settings.py +64 -0
- pyedb/grpc/database/simulation_setup/raptor_x_simulation_setup.py +125 -0
- pyedb/grpc/database/simulation_setup/siwave_dcir_simulation_setup.py +34 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +119 -0
- pyedb/grpc/database/simulation_setup/sweep_data.py +32 -0
- pyedb/grpc/database/siwave.py +1023 -0
- pyedb/grpc/database/source_excitations.py +2572 -0
- pyedb/grpc/database/stackup.py +2574 -0
- pyedb/grpc/database/terminal/__init__.py +0 -0
- pyedb/grpc/database/terminal/bundle_terminal.py +218 -0
- pyedb/grpc/database/terminal/edge_terminal.py +51 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +171 -0
- pyedb/grpc/database/terminal/pingroup_terminal.py +162 -0
- pyedb/grpc/database/terminal/point_terminal.py +99 -0
- pyedb/grpc/database/terminal/terminal.py +470 -0
- pyedb/grpc/database/utility/__init__.py +3 -0
- pyedb/grpc/database/utility/constants.py +25 -0
- pyedb/grpc/database/utility/heat_sink.py +124 -0
- pyedb/grpc/database/utility/hfss_extent_info.py +448 -0
- pyedb/grpc/database/utility/layout_statistics.py +277 -0
- pyedb/grpc/database/utility/rlc.py +80 -0
- pyedb/grpc/database/utility/simulation_configuration.py +3305 -0
- pyedb/grpc/database/utility/sources.py +388 -0
- pyedb/grpc/database/utility/sweep_data_distribution.py +83 -0
- pyedb/grpc/database/utility/xml_control_file.py +1277 -0
- pyedb/grpc/edb.py +4152 -0
- pyedb/grpc/edb_init.py +481 -0
- pyedb/grpc/rpc_session.py +177 -0
- pyedb/ipc2581/ecad/cad_data/assembly_drawing.py +3 -2
- pyedb/ipc2581/ecad/cad_data/feature.py +4 -3
- pyedb/ipc2581/ecad/cad_data/layer_feature.py +32 -20
- pyedb/ipc2581/ecad/cad_data/outline.py +3 -2
- pyedb/ipc2581/ecad/cad_data/package.py +4 -3
- pyedb/ipc2581/ecad/cad_data/path.py +82 -31
- pyedb/ipc2581/ecad/cad_data/polygon.py +122 -60
- pyedb/ipc2581/ecad/cad_data/profile.py +13 -12
- pyedb/ipc2581/ecad/cad_data/step.py +53 -21
- pyedb/ipc2581/ipc2581.py +47 -49
- pyedb/modeler/geometry_operators.py +1 -1
- {pyedb-0.38.0.dist-info → pyedb-0.39.1.dist-info}/METADATA +5 -2
- pyedb-0.39.1.dist-info/RECORD +288 -0
- pyedb-0.38.0.dist-info/RECORD +0 -195
- /pyedb/dotnet/{edb_core → database}/__init__.py +0 -0
- /pyedb/dotnet/{application → database/cell}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell → database/cell/hierarchy}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/netlist_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/pin_pair_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/s_parameter_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/hierarchy/spice_model.py +0 -0
- /pyedb/dotnet/{edb_core → database}/cell/primitive/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/hierarchy → database/cell/terminal}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/cell/terminal → database/definition}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/definition → database/dotnet}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core/dotnet → database/edb_data}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/design_options.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/edbvalue.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/layer_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/edb_data/utilities.py +0 -0
- /pyedb/dotnet/{edb_core → database}/general.py +0 -0
- /pyedb/dotnet/{edb_core/edb_data → database/geometry}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/geometry/point_data.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/data/adaptive_frequency_data.py +0 -0
- /pyedb/dotnet/{edb_core/geometry → database/sim_setup_data/io}/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/sim_setup_data/io/siwave.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/__init__.py +0 -0
- /pyedb/dotnet/{edb_core → database}/utilities/heatsink.py +0 -0
- /pyedb/{dotnet/edb_core/sim_setup_data/io → grpc/database/definition}/__init__.py +0 -0
- {pyedb-0.38.0.dist-info → pyedb-0.39.1.dist-info}/LICENSE +0 -0
- {pyedb-0.38.0.dist-info → pyedb-0.39.1.dist-info}/WHEEL +0 -0
pyedb/__init__.py
CHANGED
pyedb/common/nets.py
CHANGED
|
@@ -1,44 +1,9 @@
|
|
|
1
1
|
import math
|
|
2
|
-
import os
|
|
3
2
|
import time
|
|
4
3
|
|
|
5
4
|
from pyedb.generic.constants import CSS4_COLORS
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
def is_notebook():
|
|
9
|
-
"""Check if pyaedt is running in Jupyter or not.
|
|
10
|
-
|
|
11
|
-
Returns
|
|
12
|
-
-------
|
|
13
|
-
bool
|
|
14
|
-
"""
|
|
15
|
-
try:
|
|
16
|
-
shell = get_ipython().__class__.__name__
|
|
17
|
-
if shell in ["ZMQInteractiveShell"]: # pragma: no cover
|
|
18
|
-
return True # Jupyter notebook or qtconsole
|
|
19
|
-
else:
|
|
20
|
-
return False
|
|
21
|
-
except NameError:
|
|
22
|
-
return False # Probably standard Python interpreter
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def is_ipython():
|
|
26
|
-
"""Check if pyaedt is running in Jupyter or not.
|
|
27
|
-
|
|
28
|
-
Returns
|
|
29
|
-
-------
|
|
30
|
-
bool
|
|
31
|
-
"""
|
|
32
|
-
try:
|
|
33
|
-
shell = get_ipython().__class__.__name__
|
|
34
|
-
if shell in ["TerminalInteractiveShell", "SpyderShell"]:
|
|
35
|
-
return True # Jupyter notebook or qtconsole
|
|
36
|
-
else: # pragma: no cover
|
|
37
|
-
return False
|
|
38
|
-
except NameError:
|
|
39
|
-
return False # Probably standard Python interpreter
|
|
40
|
-
|
|
41
|
-
|
|
42
7
|
class CommonNets:
|
|
43
8
|
def __init__(self, _pedb):
|
|
44
9
|
self._pedb = _pedb
|
|
@@ -57,8 +22,6 @@ class CommonNets:
|
|
|
57
22
|
show=True,
|
|
58
23
|
annotate_component_names=True,
|
|
59
24
|
plot_vias=False,
|
|
60
|
-
include_outline=True,
|
|
61
|
-
plot_edges=True,
|
|
62
25
|
**kwargs,
|
|
63
26
|
):
|
|
64
27
|
"""Plot a Net to Matplotlib 2D Chart.
|
|
@@ -79,7 +42,7 @@ class CommonNets:
|
|
|
79
42
|
If a path is specified the plot will be saved in this location.
|
|
80
43
|
If ``save_plot`` is provided, the ``show`` parameter is ignored.
|
|
81
44
|
outline : list, optional
|
|
82
|
-
|
|
45
|
+
List of points of the outline to plot.
|
|
83
46
|
size : tuple, int, optional
|
|
84
47
|
Image size in pixel (width, height). Default value is ``(6000, 3000)``
|
|
85
48
|
top_view : bool, optional
|
|
@@ -96,17 +59,12 @@ class CommonNets:
|
|
|
96
59
|
Default is ``False``.
|
|
97
60
|
show : bool, optional
|
|
98
61
|
Whether to show the plot or not. Default is `True`.
|
|
99
|
-
include_outline : bool, optional
|
|
100
|
-
Whether to include the internal layout outline or not. Default is `True`.
|
|
101
|
-
plot_edges : bool, optional
|
|
102
|
-
Whether to plot polygon edges or not. Default is `True`.
|
|
103
62
|
|
|
104
63
|
Returns
|
|
105
64
|
-------
|
|
106
65
|
(ax, fig)
|
|
107
66
|
Matplotlib ax and figures.
|
|
108
67
|
"""
|
|
109
|
-
|
|
110
68
|
if "plot_components_on_top" in kwargs and top_view:
|
|
111
69
|
plot_components = kwargs["plot_components_on_top"]
|
|
112
70
|
if "plot_components_on_bottom" in kwargs and not top_view:
|
|
@@ -118,30 +76,22 @@ class CommonNets:
|
|
|
118
76
|
sign = -1
|
|
119
77
|
return [[sign * i[0], i[1]] for i in poly]
|
|
120
78
|
|
|
121
|
-
|
|
122
|
-
import matplotlib.pyplot as plt
|
|
123
|
-
except ImportError: # pragma: no cover
|
|
124
|
-
self._pedb.logger.error("Matplotlib is needed. Please, install it first.")
|
|
125
|
-
return False
|
|
79
|
+
import matplotlib.pyplot as plt
|
|
126
80
|
|
|
127
81
|
dpi = 100.0
|
|
128
82
|
figsize = (size[0] / dpi, size[1] / dpi)
|
|
129
83
|
|
|
130
84
|
fig = plt.figure(figsize=figsize)
|
|
131
85
|
ax = fig.add_subplot(1, 1, 1)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
from shapely.plotting import plot_line, plot_polygon
|
|
142
|
-
except ImportError: # pragma: no cover
|
|
143
|
-
self._pedb.logger.error("Shapely is needed. Please, install it first.")
|
|
144
|
-
return False
|
|
86
|
+
from shapely import affinity
|
|
87
|
+
from shapely.geometry import (
|
|
88
|
+
LinearRing,
|
|
89
|
+
MultiLineString,
|
|
90
|
+
MultiPolygon,
|
|
91
|
+
Point,
|
|
92
|
+
Polygon,
|
|
93
|
+
)
|
|
94
|
+
from shapely.plotting import plot_line, plot_polygon
|
|
145
95
|
|
|
146
96
|
start_time = time.time()
|
|
147
97
|
if not nets:
|
|
@@ -154,33 +104,19 @@ class CommonNets:
|
|
|
154
104
|
layers = [layers]
|
|
155
105
|
color_index = 0
|
|
156
106
|
label_colors = {}
|
|
157
|
-
edge_colors = {}
|
|
158
107
|
if outline:
|
|
159
108
|
poly = Polygon(outline)
|
|
160
109
|
plot_line(poly.boundary, add_points=False, color=(0.7, 0, 0), linewidth=4)
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
|
|
172
|
-
else:
|
|
173
|
-
bbox = self._pedb.hfss.get_layout_bounding_box()
|
|
174
|
-
if not bbox:
|
|
175
|
-
return False, False
|
|
176
|
-
x1 = bbox[0]
|
|
177
|
-
x2 = bbox[2]
|
|
178
|
-
y1 = bbox[1]
|
|
179
|
-
y2 = bbox[3]
|
|
180
|
-
p = [(x1, y1), (x1, y2), (x2, y2), (x2, y1), (x1, y1)]
|
|
181
|
-
p = mirror_poly(p)
|
|
182
|
-
poly = LinearRing(p)
|
|
183
|
-
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
|
|
110
|
+
else:
|
|
111
|
+
bbox = self._pedb.hfss.get_layout_bounding_box()
|
|
112
|
+
x1 = bbox[0]
|
|
113
|
+
x2 = bbox[2]
|
|
114
|
+
y1 = bbox[1]
|
|
115
|
+
y2 = bbox[3]
|
|
116
|
+
p = [(x1, y1), (x1, y2), (x2, y2), (x2, y1), (x1, y1)]
|
|
117
|
+
p = mirror_poly(p)
|
|
118
|
+
poly = LinearRing(p)
|
|
119
|
+
plot_line(poly, add_points=False, color=(0.7, 0, 0), linewidth=4)
|
|
184
120
|
layer_colors = {i: k.color for i, k in self._pedb.stackup.layers.items()}
|
|
185
121
|
top_layer = list(self._pedb.stackup.signal_layers.keys())[0]
|
|
186
122
|
bottom_layer = list(self._pedb.stackup.signal_layers.keys())[-1]
|
|
@@ -310,24 +246,14 @@ class CommonNets:
|
|
|
310
246
|
# poly = LineString(line).buffer(prim.width / 2)
|
|
311
247
|
# else:
|
|
312
248
|
xt, yt = prim.points()
|
|
313
|
-
if len(xt) < 3:
|
|
314
|
-
return
|
|
315
249
|
p1 = [(i, j) for i, j in zip(xt[::-1], yt[::-1])]
|
|
316
250
|
p1 = mirror_poly(p1)
|
|
317
251
|
|
|
318
252
|
holes = []
|
|
319
253
|
for void in prim.voids:
|
|
320
254
|
xvt, yvt = void.points(arc_segments=3)
|
|
321
|
-
if len(xvt) < 3:
|
|
322
|
-
continue
|
|
323
255
|
h1 = mirror_poly([(i, j) for i, j in zip(xvt, yvt)])
|
|
324
256
|
holes.append(h1)
|
|
325
|
-
if len(holes) > 1:
|
|
326
|
-
holes = union_all([Polygon(i) for i in holes])
|
|
327
|
-
if isinstance(holes, MultiPolygon):
|
|
328
|
-
holes = [i.boundary for i in list(holes.geoms)]
|
|
329
|
-
else:
|
|
330
|
-
holes = [holes.boundary]
|
|
331
257
|
poly = Polygon(p1, holes)
|
|
332
258
|
if layer_name == "Outline":
|
|
333
259
|
if label_colors[label] in lines:
|
|
@@ -338,36 +264,33 @@ class CommonNets:
|
|
|
338
264
|
|
|
339
265
|
if color_by_net:
|
|
340
266
|
for net in nets:
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
if lines:
|
|
369
|
-
ob = MultiLineString(p)
|
|
370
|
-
plot_line(ob, ax=ax, add_points=False, color=label_colors[label], linewidth=1, label=label)
|
|
267
|
+
if net in self._pedb.nets.nets:
|
|
268
|
+
prims = self._pedb.nets.nets[net].primitives
|
|
269
|
+
polys = []
|
|
270
|
+
lines = []
|
|
271
|
+
if net not in nets:
|
|
272
|
+
continue
|
|
273
|
+
label = "Net " + net
|
|
274
|
+
label_colors[label] = list(CSS4_COLORS.keys())[color_index]
|
|
275
|
+
color_index += 1
|
|
276
|
+
if color_index >= len(CSS4_COLORS):
|
|
277
|
+
color_index = 0
|
|
278
|
+
for prim in prims:
|
|
279
|
+
create_poly(prim, polys, lines)
|
|
280
|
+
if polys:
|
|
281
|
+
ob = MultiPolygon(polys)
|
|
282
|
+
plot_polygon(
|
|
283
|
+
ob,
|
|
284
|
+
ax=ax,
|
|
285
|
+
color=label_colors[label],
|
|
286
|
+
add_points=False,
|
|
287
|
+
alpha=0.7,
|
|
288
|
+
label=label,
|
|
289
|
+
edgecolor="none",
|
|
290
|
+
)
|
|
291
|
+
if lines:
|
|
292
|
+
ob = MultiLineString(p)
|
|
293
|
+
plot_line(ob, ax=ax, add_points=False, color=label_colors[label], linewidth=1, label=label)
|
|
371
294
|
else:
|
|
372
295
|
prims_by_layers_dict = {i: j for i, j in self._pedb.modeler.primitives_by_layer.items()}
|
|
373
296
|
if not top_view:
|
|
@@ -397,10 +320,6 @@ class CommonNets:
|
|
|
397
320
|
if color_index >= len(CSS4_COLORS):
|
|
398
321
|
color_index = 0
|
|
399
322
|
label_colors[label] = c
|
|
400
|
-
try:
|
|
401
|
-
edge_colors[label] = [i * 0.5 for i in c]
|
|
402
|
-
except TypeError:
|
|
403
|
-
edge_colors[label] = label_colors[label]
|
|
404
323
|
for prim in prims:
|
|
405
324
|
create_poly(prim, polys, lines)
|
|
406
325
|
if polys:
|
|
@@ -412,7 +331,7 @@ class CommonNets:
|
|
|
412
331
|
add_points=False,
|
|
413
332
|
alpha=alpha,
|
|
414
333
|
label=label,
|
|
415
|
-
edgecolor="none"
|
|
334
|
+
edgecolor="none",
|
|
416
335
|
)
|
|
417
336
|
if lines:
|
|
418
337
|
ob = MultiLineString(p)
|
|
@@ -480,15 +399,10 @@ class CommonNets:
|
|
|
480
399
|
plt.title(message, size=20)
|
|
481
400
|
if show_legend:
|
|
482
401
|
plt.legend(loc="upper left", fontsize="x-large")
|
|
483
|
-
end_time = time.time() - start_time
|
|
484
|
-
self._logger.info(f"Plot Generation time {round(end_time, 3)}")
|
|
485
402
|
if save_plot:
|
|
486
403
|
plt.savefig(save_plot)
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
fig.show()
|
|
492
|
-
else:
|
|
493
|
-
plt.show()
|
|
404
|
+
elif show:
|
|
405
|
+
plt.show()
|
|
406
|
+
end_time = time.time() - start_time
|
|
407
|
+
self._logger.info(f"Plot Generation time {round(end_time, 3)}")
|
|
494
408
|
return fig, ax
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
import os
|
|
23
23
|
|
|
24
24
|
from pyedb.configuration.cfg_common import CfgBase
|
|
25
|
-
from pyedb.dotnet.
|
|
25
|
+
from pyedb.dotnet.database.general import pascal_to_snake, snake_to_pascal
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class CfgComponent(CfgBase):
|
|
@@ -32,8 +32,10 @@ class CfgGeneral:
|
|
|
32
32
|
self.suppress_pads = data.get("suppress_pads", True)
|
|
33
33
|
|
|
34
34
|
def apply(self):
|
|
35
|
-
|
|
36
|
-
self._pedb.design_options.
|
|
35
|
+
# TODO check if design_options features exists in grpc
|
|
36
|
+
# self._pedb.design_options.antipads_always_on = self.anti_pads_always_on
|
|
37
|
+
# self._pedb.design_options.suppress_pads = self.suppress_pads
|
|
38
|
+
pass
|
|
37
39
|
|
|
38
40
|
def get_data_from_db(self):
|
|
39
41
|
self.anti_pads_always_on = self._pedb.design_options.antipads_always_on
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
from pyedb.configuration.cfg_components import CfgComponent
|
|
24
24
|
from pyedb.configuration.cfg_padstacks import CfgPadstackDefinition, CfgPadstackInstance
|
|
25
|
-
from pyedb.dotnet.
|
|
25
|
+
from pyedb.dotnet.database.edb_data.padstacks_data import EDBPadstack
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class CfgTrace:
|
|
@@ -24,9 +24,9 @@ import os
|
|
|
24
24
|
import numpy as np
|
|
25
25
|
|
|
26
26
|
from pyedb.configuration.cfg_common import CfgBase
|
|
27
|
-
from pyedb.dotnet.
|
|
28
|
-
from pyedb.dotnet.
|
|
29
|
-
from pyedb.dotnet.
|
|
27
|
+
from pyedb.dotnet.database.edb_data.ports import WavePort
|
|
28
|
+
from pyedb.dotnet.database.general import convert_py_list_to_net_list
|
|
29
|
+
from pyedb.dotnet.database.geometry.point_data import PointData
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
class CfgTerminalInfo(CfgBase):
|
|
@@ -34,10 +34,24 @@ class CfgTerminalInfo(CfgBase):
|
|
|
34
34
|
|
|
35
35
|
def __init__(self, pedb, **kwargs):
|
|
36
36
|
self._pedb = pedb
|
|
37
|
-
|
|
37
|
+
if "pin" in kwargs:
|
|
38
|
+
self.type = "pin"
|
|
39
|
+
elif "net" in kwargs:
|
|
40
|
+
self.type = "net"
|
|
41
|
+
elif "pin_group" in kwargs:
|
|
42
|
+
self.type = "pin_group"
|
|
43
|
+
elif "nearest_pin" in kwargs:
|
|
44
|
+
self.type = "nearest_pin"
|
|
45
|
+
elif "coordinates" in kwargs:
|
|
46
|
+
self.type = "coordinates"
|
|
47
|
+
else: # pragma no cover
|
|
48
|
+
raise RuntimeError
|
|
38
49
|
self.value = kwargs[self.type]
|
|
50
|
+
self.reference_designator = kwargs.get("reference_designator")
|
|
51
|
+
|
|
39
52
|
self.contact_type = kwargs.get("contact_type", "default") # options are full, center, quad, inline
|
|
40
|
-
|
|
53
|
+
contact_radius = "0.1mm" if kwargs.get("contact_radius") is None else kwargs.get("contact_radius")
|
|
54
|
+
self.contact_radius = self._pedb.edb_value(contact_radius).ToDouble()
|
|
41
55
|
self.num_of_contact = kwargs.get("num_of_contact", 4)
|
|
42
56
|
|
|
43
57
|
def export_properties(self):
|
|
@@ -235,6 +249,8 @@ class CfgCircuitElement(CfgBase):
|
|
|
235
249
|
self.positive_terminal_info = CfgCoordianteTerminalInfo(self._pedb, **pos)
|
|
236
250
|
else:
|
|
237
251
|
self.positive_terminal_info = CfgTerminalInfo(self._pedb, **pos)
|
|
252
|
+
if not self.positive_terminal_info.reference_designator:
|
|
253
|
+
self.positive_terminal_info.reference_designator = self.reference_designator
|
|
238
254
|
|
|
239
255
|
neg = kwargs.get("negative_terminal", {})
|
|
240
256
|
if len(neg) == 0:
|
|
@@ -245,6 +261,8 @@ class CfgCircuitElement(CfgBase):
|
|
|
245
261
|
self.negative_terminal_info = CfgNearestPinTerminalInfo(self._pedb, **neg)
|
|
246
262
|
else:
|
|
247
263
|
self.negative_terminal_info = CfgTerminalInfo(self._pedb, **neg)
|
|
264
|
+
if not self.negative_terminal_info.reference_designator:
|
|
265
|
+
self.negative_terminal_info.reference_designator = self.positive_terminal_info.reference_designator
|
|
248
266
|
|
|
249
267
|
def create_terminals(self):
|
|
250
268
|
"""Create step 1. Collect positive and negative terminals."""
|
|
@@ -254,17 +272,23 @@ class CfgCircuitElement(CfgBase):
|
|
|
254
272
|
pos_objs = dict()
|
|
255
273
|
pos_coor_terminal = dict()
|
|
256
274
|
if self.type == "coax":
|
|
257
|
-
pins = self._get_pins(pos_type, pos_value)
|
|
258
|
-
pins = {f"{self.name}_{self.reference_designator}": i for _, i in pins.items()}
|
|
275
|
+
pins = self._get_pins(pos_type, pos_value, self.positive_terminal_info.reference_designator)
|
|
276
|
+
pins = {f"{self.name}_{self.positive_terminal_info.reference_designator}": i for _, i in pins.items()}
|
|
259
277
|
pos_objs.update(pins)
|
|
260
278
|
elif pos_type == "coordinates":
|
|
261
279
|
layer = self.positive_terminal_info.layer
|
|
262
280
|
point = [self.positive_terminal_info.point_x, self.positive_terminal_info.point_y]
|
|
263
281
|
net_name = self.positive_terminal_info.net
|
|
282
|
+
if net_name not in self._pedb.nets:
|
|
283
|
+
self._pedb.nets.find_or_create_net(net_name)
|
|
264
284
|
pos_coor_terminal[self.name] = self._pedb.get_point_terminal(self.name, net_name, point, layer)
|
|
265
285
|
|
|
266
286
|
elif pos_type == "pin":
|
|
267
|
-
pins = {
|
|
287
|
+
pins = {
|
|
288
|
+
pos_value: self._pedb.components.instances[self.positive_terminal_info.reference_designator].pins[
|
|
289
|
+
pos_value
|
|
290
|
+
]
|
|
291
|
+
}
|
|
268
292
|
if self.positive_terminal_info.contact_type in ["quad", "inline"]:
|
|
269
293
|
for _, pin in pins.items():
|
|
270
294
|
contact_type = self.positive_terminal_info.contact_type
|
|
@@ -276,7 +300,7 @@ class CfgCircuitElement(CfgBase):
|
|
|
276
300
|
else:
|
|
277
301
|
pos_objs.update(pins)
|
|
278
302
|
elif pos_type == "pin_group":
|
|
279
|
-
pins = self._get_pins(pos_type, pos_value)
|
|
303
|
+
pins = self._get_pins(pos_type, pos_value, self.positive_terminal_info.reference_designator)
|
|
280
304
|
if self.distributed:
|
|
281
305
|
pos_objs.update(pins)
|
|
282
306
|
self._elem_num = len(pos_objs)
|
|
@@ -291,7 +315,7 @@ class CfgCircuitElement(CfgBase):
|
|
|
291
315
|
else:
|
|
292
316
|
pos_objs[pos_value] = self._pedb.siwave.pin_groups[pos_value]
|
|
293
317
|
elif pos_type == "net":
|
|
294
|
-
pins = self._get_pins(pos_type, pos_value)
|
|
318
|
+
pins = self._get_pins(pos_type, pos_value, self.positive_terminal_info.reference_designator)
|
|
295
319
|
if self.distributed:
|
|
296
320
|
pos_objs.update(pins)
|
|
297
321
|
self._elem_num = len(pos_objs)
|
|
@@ -305,7 +329,7 @@ class CfgCircuitElement(CfgBase):
|
|
|
305
329
|
self._elem_num = len(pos_objs)
|
|
306
330
|
else:
|
|
307
331
|
# create pin group
|
|
308
|
-
neg_obj = self._create_pin_group(pins)
|
|
332
|
+
neg_obj = self._create_pin_group(pins, self.positive_terminal_info.reference_designator)
|
|
309
333
|
pos_objs.update(neg_obj)
|
|
310
334
|
else:
|
|
311
335
|
raise Exception(f"Wrong positive terminal type {pos_type}.")
|
|
@@ -322,6 +346,8 @@ class CfgCircuitElement(CfgBase):
|
|
|
322
346
|
layer = self.negative_terminal_info.layer
|
|
323
347
|
point = [self.negative_terminal_info.point_x, self.negative_terminal_info.point_y]
|
|
324
348
|
net_name = self.negative_terminal_info.net
|
|
349
|
+
if net_name not in self._pedb.nets:
|
|
350
|
+
self._pedb.nets.find_or_create_net(net_name)
|
|
325
351
|
self.neg_terminal = self._pedb.get_point_terminal(self.name + "_ref", net_name, point, layer)
|
|
326
352
|
elif neg_type == "nearest_pin":
|
|
327
353
|
ref_net = neg_value.get("reference_net", "GND")
|
|
@@ -337,13 +363,17 @@ class CfgCircuitElement(CfgBase):
|
|
|
337
363
|
neg_obj = {neg_value: self._pedb.siwave.pin_groups[neg_value]}
|
|
338
364
|
elif neg_type == "net":
|
|
339
365
|
# Get pins
|
|
340
|
-
pins = self._get_pins(
|
|
366
|
+
pins = self._get_pins(
|
|
367
|
+
neg_type, neg_value, self.negative_terminal_info.reference_designator
|
|
368
|
+
) # terminal type pin or net
|
|
341
369
|
# create pin group
|
|
342
|
-
neg_obj = self._create_pin_group(pins, True)
|
|
370
|
+
neg_obj = self._create_pin_group(pins, self.negative_terminal_info.reference_designator, True)
|
|
343
371
|
elif neg_type == "pin":
|
|
344
|
-
terminal_name = f"{self.reference_designator}_{neg_value}"
|
|
372
|
+
terminal_name = f"{self.negative_terminal_info.reference_designator}_{neg_value}"
|
|
345
373
|
neg_obj = {
|
|
346
|
-
terminal_name: self._pedb.components.instances[
|
|
374
|
+
terminal_name: self._pedb.components.instances[
|
|
375
|
+
self.negative_terminal_info.reference_designator
|
|
376
|
+
].pins[neg_value]
|
|
347
377
|
}
|
|
348
378
|
else:
|
|
349
379
|
raise Exception(f"Wrong negative terminal type {neg_type}.")
|
|
@@ -351,11 +381,11 @@ class CfgCircuitElement(CfgBase):
|
|
|
351
381
|
j.create_terminal(i) if not j.terminal else j.terminal for i, j in neg_obj.items()
|
|
352
382
|
][0]
|
|
353
383
|
|
|
354
|
-
def _get_pins(self, terminal_type, terminal_value):
|
|
384
|
+
def _get_pins(self, terminal_type, terminal_value, reference_designator):
|
|
355
385
|
terminal_value = terminal_value if isinstance(terminal_value, list) else [terminal_value]
|
|
356
386
|
|
|
357
387
|
def get_pin_obj(pin_name):
|
|
358
|
-
return {pin_name: self._pedb.components.instances[
|
|
388
|
+
return {pin_name: self._pedb.components.instances[reference_designator].pins[pin_name]}
|
|
359
389
|
|
|
360
390
|
pins = dict()
|
|
361
391
|
if terminal_type == "pin":
|
|
@@ -363,11 +393,11 @@ class CfgCircuitElement(CfgBase):
|
|
|
363
393
|
pins.update(get_pin_obj(i))
|
|
364
394
|
else:
|
|
365
395
|
if terminal_type == "net":
|
|
366
|
-
temp = self._pedb.components.get_pins(
|
|
396
|
+
temp = self._pedb.components.get_pins(reference_designator, terminal_value[0])
|
|
367
397
|
elif terminal_type == "pin_group":
|
|
368
398
|
pin_group = self._pedb.siwave.pin_groups[terminal_value[0]]
|
|
369
399
|
temp = pin_group.pins
|
|
370
|
-
pins.update({f"{
|
|
400
|
+
pins.update({f"{reference_designator}_{terminal_value[0]}_{i}": j for i, j in temp.items()})
|
|
371
401
|
return pins
|
|
372
402
|
|
|
373
403
|
def _create_virtual_pins_on_pin(self, pin, contact_type, radius, num_of_contact=4):
|
|
@@ -428,15 +458,18 @@ class CfgCircuitElement(CfgBase):
|
|
|
428
458
|
is_pin=True,
|
|
429
459
|
)
|
|
430
460
|
instances[pin_name] = p_inst
|
|
461
|
+
self._pedb.components.create(
|
|
462
|
+
pins=list(instances.values()),
|
|
463
|
+
)
|
|
431
464
|
return instances
|
|
432
465
|
|
|
433
|
-
def _create_pin_group(self, pins, is_ref=False):
|
|
466
|
+
def _create_pin_group(self, pins, reference_designator, is_ref=False):
|
|
434
467
|
if is_ref:
|
|
435
|
-
pg_name = f"pg_{self.name}_{
|
|
468
|
+
pg_name = f"pg_{self.name}_{reference_designator}_ref"
|
|
436
469
|
else:
|
|
437
|
-
pg_name = f"pg_{self.name}_{
|
|
470
|
+
pg_name = f"pg_{self.name}_{reference_designator}"
|
|
438
471
|
pin_names = [i.component_pin for i in pins.values()]
|
|
439
|
-
name, temp = self._pedb.siwave.create_pin_group(
|
|
472
|
+
name, temp = self._pedb.siwave.create_pin_group(reference_designator, pin_names, pg_name)
|
|
440
473
|
return {name: temp}
|
|
441
474
|
|
|
442
475
|
|
|
@@ -27,7 +27,7 @@ from pathlib import Path
|
|
|
27
27
|
import toml
|
|
28
28
|
|
|
29
29
|
from pyedb.configuration.cfg_data import CfgData
|
|
30
|
-
from pyedb.dotnet.
|
|
30
|
+
from pyedb.dotnet.database.definition.package_def import PackageDef
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
class Configuration:
|
|
@@ -146,7 +146,24 @@ class Configuration:
|
|
|
146
146
|
for cfg_pdef in temp:
|
|
147
147
|
cfg_pdef.api.set_parameters_to_edb()
|
|
148
148
|
else:
|
|
149
|
+
temp_pdef_data = {}
|
|
150
|
+
for pdef_name, pdef in self._pedb.padstacks.definitions.items():
|
|
151
|
+
pdef_data = pdef._padstack_def_data
|
|
152
|
+
for lyr_name in list(pdef_data.GetLayerNames()):
|
|
153
|
+
result = pdef_data.GetPadParametersValue(lyr_name, self._pedb._edb.Definition.PadType.RegularPad)
|
|
154
|
+
flag, pad_shape, params, offset_x, offset_y, rotation = result
|
|
155
|
+
if flag is False:
|
|
156
|
+
result = pdef_data.GetPolygonalPadParameters(
|
|
157
|
+
lyr_name, self._pedb._edb.Definition.PadType.RegularPad
|
|
158
|
+
)
|
|
159
|
+
flag, polygon_data, offset_x, offset_y, rotation = result
|
|
160
|
+
if flag:
|
|
161
|
+
temp_pdef_data[pdef_name] = pdef_data
|
|
162
|
+
break
|
|
149
163
|
self.cfg_data.stackup.apply()
|
|
164
|
+
for pdef_name, pdef_data in temp_pdef_data.items():
|
|
165
|
+
pdef = self._pedb.padstacks.definitions[pdef_name]
|
|
166
|
+
pdef._padstack_def_data = pdef_data
|
|
150
167
|
|
|
151
168
|
# Configure padstacks
|
|
152
169
|
if self.cfg_data.padstacks:
|