pyedb 0.53.0__py3-none-any.whl → 0.55.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 +1 -8
- pyedb/configuration/cfg_boundaries.py +69 -151
- pyedb/configuration/cfg_components.py +201 -460
- pyedb/configuration/cfg_data.py +4 -2
- pyedb/configuration/cfg_general.py +13 -36
- pyedb/configuration/cfg_modeler.py +2 -1
- pyedb/configuration/cfg_nets.py +21 -35
- pyedb/configuration/cfg_operations.py +22 -151
- pyedb/configuration/cfg_package_definition.py +56 -112
- pyedb/configuration/cfg_padstacks.py +292 -688
- pyedb/configuration/cfg_pin_groups.py +32 -79
- pyedb/configuration/cfg_ports_sources.py +20 -9
- pyedb/configuration/cfg_s_parameter_models.py +67 -172
- pyedb/configuration/cfg_setup.py +102 -295
- pyedb/configuration/configuration.py +66 -6
- pyedb/dotnet/database/cell/connectable.py +38 -9
- pyedb/dotnet/database/cell/hierarchy/component.py +28 -28
- pyedb/dotnet/database/cell/hierarchy/model.py +1 -1
- pyedb/dotnet/database/cell/layout.py +64 -3
- pyedb/dotnet/database/cell/layout_obj.py +3 -3
- pyedb/dotnet/database/cell/primitive/path.py +6 -8
- pyedb/dotnet/database/cell/primitive/primitive.py +10 -31
- pyedb/dotnet/database/cell/terminal/edge_terminal.py +2 -2
- pyedb/dotnet/database/cell/terminal/padstack_instance_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/pingroup_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/point_terminal.py +1 -1
- pyedb/dotnet/database/cell/terminal/terminal.py +26 -28
- pyedb/dotnet/database/cell/voltage_regulator.py +0 -21
- pyedb/dotnet/database/components.py +99 -91
- pyedb/dotnet/database/definition/component_def.py +4 -4
- pyedb/dotnet/database/definition/component_model.py +1 -1
- pyedb/dotnet/database/definition/package_def.py +2 -3
- pyedb/dotnet/database/dotnet/database.py +27 -218
- pyedb/dotnet/database/dotnet/primitive.py +16 -16
- pyedb/dotnet/database/edb_data/control_file.py +5 -5
- pyedb/dotnet/database/edb_data/hfss_extent_info.py +6 -6
- pyedb/dotnet/database/edb_data/layer_data.py +35 -35
- pyedb/dotnet/database/edb_data/padstacks_data.py +65 -90
- pyedb/dotnet/database/edb_data/primitives_data.py +5 -5
- pyedb/dotnet/database/edb_data/sources.py +6 -6
- pyedb/dotnet/database/edb_data/variables.py +8 -4
- pyedb/dotnet/database/geometry/point_data.py +14 -10
- pyedb/dotnet/database/geometry/polygon_data.py +3 -5
- pyedb/dotnet/database/hfss.py +50 -52
- pyedb/dotnet/database/layout_validation.py +14 -11
- pyedb/dotnet/database/materials.py +10 -11
- pyedb/dotnet/database/modeler.py +104 -101
- pyedb/dotnet/database/nets.py +20 -23
- pyedb/dotnet/database/padstack.py +156 -84
- pyedb/dotnet/database/sim_setup_data/data/settings.py +24 -0
- pyedb/dotnet/database/sim_setup_data/io/siwave.py +26 -1
- pyedb/dotnet/database/siwave.py +47 -47
- pyedb/dotnet/database/stackup.py +152 -87
- pyedb/dotnet/database/utilities/heatsink.py +4 -4
- pyedb/dotnet/database/utilities/obj_base.py +3 -3
- pyedb/dotnet/database/utilities/simulation_setup.py +2 -2
- pyedb/dotnet/database/utilities/value.py +116 -0
- pyedb/dotnet/edb.py +248 -170
- pyedb/edb_logger.py +12 -27
- pyedb/extensions/via_design_backend.py +6 -3
- pyedb/generic/design_types.py +68 -21
- pyedb/generic/general_methods.py +0 -120
- pyedb/generic/process.py +44 -108
- pyedb/generic/settings.py +75 -19
- pyedb/grpc/__init__.py +0 -0
- pyedb/grpc/database/components.py +55 -17
- pyedb/grpc/database/control_file.py +5 -5
- pyedb/grpc/database/definition/materials.py +24 -31
- pyedb/grpc/database/definition/package_def.py +18 -18
- pyedb/grpc/database/definition/padstack_def.py +104 -51
- pyedb/grpc/database/geometry/arc_data.py +7 -5
- pyedb/grpc/database/geometry/point_3d_data.py +8 -7
- pyedb/grpc/database/geometry/polygon_data.py +4 -3
- pyedb/grpc/database/hierarchy/component.py +43 -38
- pyedb/grpc/database/hierarchy/pin_pair_model.py +15 -14
- pyedb/grpc/database/hierarchy/pingroup.py +9 -9
- pyedb/grpc/database/layers/stackup_layer.py +45 -44
- pyedb/grpc/database/layout/layout.py +17 -13
- pyedb/grpc/database/layout/voltage_regulator.py +7 -7
- pyedb/grpc/database/layout_validation.py +16 -15
- pyedb/grpc/database/modeler.py +60 -58
- pyedb/grpc/database/net/net.py +15 -14
- pyedb/grpc/database/nets.py +112 -31
- pyedb/grpc/database/padstacks.py +303 -190
- pyedb/grpc/database/ports/ports.py +5 -6
- pyedb/grpc/database/primitive/bondwire.py +8 -7
- pyedb/grpc/database/primitive/circle.py +4 -4
- pyedb/grpc/database/primitive/padstack_instance.py +191 -23
- pyedb/grpc/database/primitive/path.py +7 -7
- pyedb/grpc/database/primitive/polygon.py +3 -3
- pyedb/grpc/database/primitive/primitive.py +13 -17
- pyedb/grpc/database/primitive/rectangle.py +13 -13
- pyedb/grpc/database/simulation_setup/hfss_general_settings.py +1 -1
- pyedb/grpc/database/simulation_setup/hfss_simulation_setup.py +10 -0
- pyedb/grpc/database/simulation_setup/siwave_simulation_setup.py +17 -1
- pyedb/grpc/database/siwave.py +31 -25
- pyedb/grpc/database/source_excitations.py +335 -233
- pyedb/grpc/database/stackup.py +165 -148
- pyedb/grpc/database/terminal/bundle_terminal.py +18 -8
- pyedb/grpc/database/terminal/edge_terminal.py +10 -0
- pyedb/grpc/database/terminal/padstack_instance_terminal.py +16 -5
- pyedb/grpc/database/terminal/pingroup_terminal.py +12 -11
- pyedb/grpc/database/terminal/point_terminal.py +4 -3
- pyedb/grpc/database/terminal/terminal.py +9 -9
- pyedb/grpc/database/utility/value.py +109 -0
- pyedb/grpc/database/utility/xml_control_file.py +5 -5
- pyedb/grpc/edb.py +130 -63
- pyedb/grpc/edb_init.py +3 -10
- pyedb/grpc/rpc_session.py +10 -10
- pyedb/libraries/common.py +366 -0
- pyedb/libraries/rf_libraries/base_functions.py +1358 -0
- pyedb/libraries/rf_libraries/planar_antennas.py +628 -0
- pyedb/misc/decorators.py +61 -0
- pyedb/misc/misc.py +0 -13
- pyedb/siwave.py +2 -2
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/METADATA +2 -3
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/RECORD +119 -112
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/WHEEL +0 -0
- {pyedb-0.53.0.dist-info → pyedb-0.55.0.dist-info}/licenses/LICENSE +0 -0
pyedb/grpc/edb.py
CHANGED
|
@@ -65,7 +65,7 @@ import sys
|
|
|
65
65
|
import tempfile
|
|
66
66
|
import time
|
|
67
67
|
import traceback
|
|
68
|
-
from typing import Union
|
|
68
|
+
from typing import Dict, List, Union
|
|
69
69
|
import warnings
|
|
70
70
|
from zipfile import ZipFile as zpf
|
|
71
71
|
|
|
@@ -99,8 +99,7 @@ from pyedb.grpc.database.layout_validation import LayoutValidation
|
|
|
99
99
|
from pyedb.grpc.database.modeler import Modeler
|
|
100
100
|
from pyedb.grpc.database.net.differential_pair import DifferentialPairs
|
|
101
101
|
from pyedb.grpc.database.net.extended_net import ExtendedNets
|
|
102
|
-
from pyedb.grpc.database.
|
|
103
|
-
from pyedb.grpc.database.nets import Nets
|
|
102
|
+
from pyedb.grpc.database.nets import NetClasses, Nets
|
|
104
103
|
from pyedb.grpc.database.padstacks import Padstacks
|
|
105
104
|
from pyedb.grpc.database.ports.ports import BundleWavePort, CoaxPort, GapPort, WavePort
|
|
106
105
|
from pyedb.grpc.database.primitive.circle import Circle
|
|
@@ -131,11 +130,14 @@ from pyedb.grpc.database.terminal.padstack_instance_terminal import (
|
|
|
131
130
|
)
|
|
132
131
|
from pyedb.grpc.database.terminal.terminal import Terminal
|
|
133
132
|
from pyedb.grpc.database.utility.constants import get_terminal_supported_boundary_types
|
|
133
|
+
from pyedb.grpc.database.utility.value import Value
|
|
134
134
|
from pyedb.grpc.edb_init import EdbInit
|
|
135
135
|
from pyedb.ipc2581.ipc2581 import Ipc2581
|
|
136
136
|
from pyedb.modeler.geometry_operators import GeometryOperators
|
|
137
137
|
from pyedb.workflow import Workflow
|
|
138
138
|
|
|
139
|
+
os.environ["no_proxy"] = "localhost,127.0.0.1"
|
|
140
|
+
|
|
139
141
|
|
|
140
142
|
class Edb(EdbInit):
|
|
141
143
|
"""Main class for interacting with Ansys Electronics Desktop Database (EDB).
|
|
@@ -202,13 +204,11 @@ class Edb(EdbInit):
|
|
|
202
204
|
edbversion: str = None,
|
|
203
205
|
isaedtowned: bool = False,
|
|
204
206
|
oproject=None,
|
|
205
|
-
student_version: bool = False,
|
|
206
207
|
use_ppe: bool = False,
|
|
207
208
|
control_file: str = None,
|
|
208
209
|
map_file: str = None,
|
|
209
210
|
technology_file: str = None,
|
|
210
211
|
layer_filter: str = None,
|
|
211
|
-
remove_existing_aedt: bool = False,
|
|
212
212
|
restart_rpc_server=False,
|
|
213
213
|
):
|
|
214
214
|
edbversion = get_string_version(edbversion)
|
|
@@ -291,13 +291,13 @@ class Edb(EdbInit):
|
|
|
291
291
|
return False
|
|
292
292
|
elif edbpath.endswith("edb.def"):
|
|
293
293
|
self.edbpath = os.path.dirname(edbpath)
|
|
294
|
-
self.
|
|
294
|
+
self.open(restart_rpc_server=restart_rpc_server)
|
|
295
295
|
elif not os.path.exists(os.path.join(self.edbpath, "edb.def")):
|
|
296
|
-
self.
|
|
296
|
+
self.create(restart_rpc_server=restart_rpc_server)
|
|
297
297
|
self.logger.info("EDB %s created correctly.", self.edbpath)
|
|
298
298
|
elif ".aedb" in edbpath:
|
|
299
299
|
self.edbpath = edbpath
|
|
300
|
-
self.
|
|
300
|
+
self.open(restart_rpc_server=restart_rpc_server)
|
|
301
301
|
if self.active_cell:
|
|
302
302
|
self.logger.info("EDB initialized.")
|
|
303
303
|
else:
|
|
@@ -366,6 +366,11 @@ class Edb(EdbInit):
|
|
|
366
366
|
if description: # Add the variable description if a two-item list is passed for variable_value.
|
|
367
367
|
self.__getitem__(variable_name).description = description
|
|
368
368
|
|
|
369
|
+
@property
|
|
370
|
+
def core(self) -> ansys.edb.core:
|
|
371
|
+
"""Ansys Edb Core module."""
|
|
372
|
+
return ansys.edb.core
|
|
373
|
+
|
|
369
374
|
def _check_remove_project_files(self, edbpath: str, remove_existing_aedt: bool) -> None:
|
|
370
375
|
aedt_file = os.path.splitext(edbpath)[0] + ".aedt"
|
|
371
376
|
files = [aedt_file, aedt_file + ".lock"]
|
|
@@ -397,8 +402,16 @@ class Edb(EdbInit):
|
|
|
397
402
|
self._differential_pairs = DifferentialPairs(self)
|
|
398
403
|
self._extended_nets = ExtendedNets(self)
|
|
399
404
|
|
|
405
|
+
def value(self, val) -> float:
|
|
406
|
+
"""Convert a value into a pyedb value."""
|
|
407
|
+
if isinstance(val, GrpcValue):
|
|
408
|
+
return Value(val)
|
|
409
|
+
else:
|
|
410
|
+
context = self.active_cell if not str(val).startswith("$") else self.active_db
|
|
411
|
+
return Value(GrpcValue(val, context), context)
|
|
412
|
+
|
|
400
413
|
@property
|
|
401
|
-
def cell_names(self) -> [str]:
|
|
414
|
+
def cell_names(self) -> List[str]:
|
|
402
415
|
"""List of all cell names in the database.
|
|
403
416
|
|
|
404
417
|
Returns
|
|
@@ -409,7 +422,7 @@ class Edb(EdbInit):
|
|
|
409
422
|
return [cell.name for cell in self.active_db.top_circuit_cells]
|
|
410
423
|
|
|
411
424
|
@property
|
|
412
|
-
def design_variables(self) ->
|
|
425
|
+
def design_variables(self) -> Dict[str, float]:
|
|
413
426
|
"""All design variables in active cell.
|
|
414
427
|
|
|
415
428
|
Returns
|
|
@@ -417,10 +430,10 @@ class Edb(EdbInit):
|
|
|
417
430
|
dict[str, float]
|
|
418
431
|
Variable names and values.
|
|
419
432
|
"""
|
|
420
|
-
return {i: self.active_cell.get_variable_value(i)
|
|
433
|
+
return {i: Value(self.active_cell.get_variable_value(i)) for i in self.active_cell.get_all_variable_names()}
|
|
421
434
|
|
|
422
435
|
@property
|
|
423
|
-
def project_variables(self) ->
|
|
436
|
+
def project_variables(self) -> Dict[str, float]:
|
|
424
437
|
"""All project variables in database.
|
|
425
438
|
|
|
426
439
|
Returns
|
|
@@ -428,7 +441,7 @@ class Edb(EdbInit):
|
|
|
428
441
|
dict[str, float]
|
|
429
442
|
Variable names and values.
|
|
430
443
|
"""
|
|
431
|
-
return {i: self.active_db.get_variable_value(i)
|
|
444
|
+
return {i: Value(self.active_db.get_variable_value(i)) for i in self.active_db.get_all_variable_names()}
|
|
432
445
|
|
|
433
446
|
@property
|
|
434
447
|
def layout_validation(self) -> LayoutValidation:
|
|
@@ -442,7 +455,7 @@ class Edb(EdbInit):
|
|
|
442
455
|
return LayoutValidation(self)
|
|
443
456
|
|
|
444
457
|
@property
|
|
445
|
-
def variables(self) ->
|
|
458
|
+
def variables(self) -> Dict[str, float]:
|
|
446
459
|
"""All variables (project + design) in database.
|
|
447
460
|
|
|
448
461
|
Returns
|
|
@@ -458,7 +471,7 @@ class Edb(EdbInit):
|
|
|
458
471
|
return all_vars
|
|
459
472
|
|
|
460
473
|
@property
|
|
461
|
-
def terminals(self) ->
|
|
474
|
+
def terminals(self) -> Dict[str, Terminal]:
|
|
462
475
|
"""Terminals in active layout.
|
|
463
476
|
|
|
464
477
|
Returns
|
|
@@ -469,7 +482,7 @@ class Edb(EdbInit):
|
|
|
469
482
|
return {i.name: i for i in self.layout.terminals}
|
|
470
483
|
|
|
471
484
|
@property
|
|
472
|
-
def excitations(self) ->
|
|
485
|
+
def excitations(self) -> Dict[str, GapPort]:
|
|
473
486
|
"""All layout excitations.
|
|
474
487
|
|
|
475
488
|
Returns
|
|
@@ -487,7 +500,7 @@ class Edb(EdbInit):
|
|
|
487
500
|
return temp
|
|
488
501
|
|
|
489
502
|
@property
|
|
490
|
-
def ports(self) ->
|
|
503
|
+
def ports(self) -> Dict[str, GapPort]:
|
|
491
504
|
"""All ports in design.
|
|
492
505
|
|
|
493
506
|
Returns
|
|
@@ -520,7 +533,7 @@ class Edb(EdbInit):
|
|
|
520
533
|
return ports
|
|
521
534
|
|
|
522
535
|
@property
|
|
523
|
-
def excitations_nets(self) -> [str]:
|
|
536
|
+
def excitations_nets(self) -> List[str]:
|
|
524
537
|
"""Nets with excitations defined.
|
|
525
538
|
|
|
526
539
|
Returns
|
|
@@ -531,7 +544,7 @@ class Edb(EdbInit):
|
|
|
531
544
|
return list(set([i.net.name for i in self.layout.terminals if not i.is_reference_terminal]))
|
|
532
545
|
|
|
533
546
|
@property
|
|
534
|
-
def sources(self) ->
|
|
547
|
+
def sources(self) -> Dict[str, Terminal]:
|
|
535
548
|
"""All layout sources.
|
|
536
549
|
|
|
537
550
|
Returns
|
|
@@ -539,7 +552,11 @@ class Edb(EdbInit):
|
|
|
539
552
|
dict[str, :class:`Terminal <pyedb.grpc.database.terminal.terminal.Terminal>`]
|
|
540
553
|
Source names and objects.
|
|
541
554
|
"""
|
|
542
|
-
return
|
|
555
|
+
return {
|
|
556
|
+
k: i
|
|
557
|
+
for k, i in self.terminals.items()
|
|
558
|
+
if "source" in i.boundary_type or "terminal" in i.boundary_type or i.is_reference_terminal
|
|
559
|
+
}
|
|
543
560
|
|
|
544
561
|
@property
|
|
545
562
|
def voltage_regulator_modules(self):
|
|
@@ -557,7 +574,7 @@ class Edb(EdbInit):
|
|
|
557
574
|
return _vrms
|
|
558
575
|
|
|
559
576
|
@property
|
|
560
|
-
def probes(self) ->
|
|
577
|
+
def probes(self) -> Dict[str, Terminal]:
|
|
561
578
|
"""All layout probes.
|
|
562
579
|
|
|
563
580
|
Returns
|
|
@@ -565,7 +582,7 @@ class Edb(EdbInit):
|
|
|
565
582
|
dict[str, :class:`Terminal <pyedb.grpc.database.terminal.terminal.Terminal>`]
|
|
566
583
|
Probe names and objects.
|
|
567
584
|
"""
|
|
568
|
-
terms = [term for term in self.layout.terminals if term.boundary_type
|
|
585
|
+
terms = [term for term in self.layout.terminals if term.boundary_type == "voltage_probe"]
|
|
569
586
|
return {ter.name: ter for ter in terms}
|
|
570
587
|
|
|
571
588
|
def open(self, restart_rpc_server=False) -> bool:
|
|
@@ -924,6 +941,7 @@ class Edb(EdbInit):
|
|
|
924
941
|
ValueError
|
|
925
942
|
If cell not found in database.
|
|
926
943
|
"""
|
|
944
|
+
self._layout = None
|
|
927
945
|
if isinstance(value, str):
|
|
928
946
|
_cell = [cell for cell in self.circuit_cells if cell.name == value]
|
|
929
947
|
if _cell:
|
|
@@ -1043,16 +1061,16 @@ class Edb(EdbInit):
|
|
|
1043
1061
|
return self._nets
|
|
1044
1062
|
|
|
1045
1063
|
@property
|
|
1046
|
-
def net_classes(self) ->
|
|
1064
|
+
def net_classes(self) -> NetClasses:
|
|
1047
1065
|
"""Net class management.
|
|
1048
1066
|
|
|
1049
1067
|
Returns
|
|
1050
1068
|
-------
|
|
1051
|
-
|
|
1052
|
-
Net
|
|
1069
|
+
:class:`NetClass <pyedb.grpc.database.nets.NetClasses>`
|
|
1070
|
+
Net classes objects.
|
|
1053
1071
|
"""
|
|
1054
1072
|
if self.active_db:
|
|
1055
|
-
return
|
|
1073
|
+
return NetClasses(self)
|
|
1056
1074
|
|
|
1057
1075
|
@property
|
|
1058
1076
|
def extended_nets(self) -> ExtendedNets:
|
|
@@ -1102,7 +1120,10 @@ class Edb(EdbInit):
|
|
|
1102
1120
|
:class:`Layout <pyedb.grpc.database.layout.layout.Layout>`
|
|
1103
1121
|
Layout manipulation tools.
|
|
1104
1122
|
"""
|
|
1105
|
-
|
|
1123
|
+
if self._layout:
|
|
1124
|
+
return self._layout
|
|
1125
|
+
self._layout = Layout(self)
|
|
1126
|
+
return self._layout
|
|
1106
1127
|
|
|
1107
1128
|
@property
|
|
1108
1129
|
def active_layout(self) -> Layout:
|
|
@@ -1285,7 +1306,7 @@ class Edb(EdbInit):
|
|
|
1285
1306
|
func : str
|
|
1286
1307
|
Command to execute.
|
|
1287
1308
|
"""
|
|
1288
|
-
# return self.
|
|
1309
|
+
# return self.core.utility.utility.Command.Execute(func)
|
|
1289
1310
|
pass
|
|
1290
1311
|
|
|
1291
1312
|
def import_cadence_file(self, inputBrd, WorkDir=None, anstranslator_full_path="", use_ppe=False) -> bool:
|
|
@@ -1384,7 +1405,7 @@ class Edb(EdbInit):
|
|
|
1384
1405
|
print(command)
|
|
1385
1406
|
temp_inputGDS = inputGDS.split(".gds")[0]
|
|
1386
1407
|
self.edbpath = temp_inputGDS + ".aedb"
|
|
1387
|
-
return self.
|
|
1408
|
+
return self.open()
|
|
1388
1409
|
|
|
1389
1410
|
def _create_extent(
|
|
1390
1411
|
self,
|
|
@@ -1403,6 +1424,7 @@ class Edb(EdbInit):
|
|
|
1403
1424
|
|
|
1404
1425
|
if extent_type in [
|
|
1405
1426
|
"Conforming",
|
|
1427
|
+
"Conformal",
|
|
1406
1428
|
GrpcExtentType.CONFORMING,
|
|
1407
1429
|
1,
|
|
1408
1430
|
]:
|
|
@@ -1504,13 +1526,26 @@ class Edb(EdbInit):
|
|
|
1504
1526
|
unite_polys = []
|
|
1505
1527
|
for i in _polys:
|
|
1506
1528
|
if "PolygonData" not in str(i):
|
|
1507
|
-
obj_data = i.polygon_data.expand(
|
|
1529
|
+
obj_data = i.polygon_data.expand(
|
|
1530
|
+
expansion_size,
|
|
1531
|
+
round_corner,
|
|
1532
|
+
round_extension,
|
|
1533
|
+
tolerance,
|
|
1534
|
+
)
|
|
1508
1535
|
else:
|
|
1509
|
-
obj_data = i.expand(
|
|
1536
|
+
obj_data = i.expand(
|
|
1537
|
+
expansion_size,
|
|
1538
|
+
round_corner,
|
|
1539
|
+
round_extension,
|
|
1540
|
+
tolerance,
|
|
1541
|
+
)
|
|
1510
1542
|
if inlcude_voids_in_extents and "PolygonData" not in str(i) and i.has_voids and obj_data:
|
|
1511
1543
|
for void in i.voids:
|
|
1512
1544
|
void_data = void.polygon_data.expand(
|
|
1513
|
-
-1 * expansion_size,
|
|
1545
|
+
-1 * expansion_size,
|
|
1546
|
+
round_corner,
|
|
1547
|
+
round_extension,
|
|
1548
|
+
tolerance,
|
|
1514
1549
|
)
|
|
1515
1550
|
if void_data:
|
|
1516
1551
|
for v in list(void_data):
|
|
@@ -1559,7 +1594,7 @@ class Edb(EdbInit):
|
|
|
1559
1594
|
for term in terms:
|
|
1560
1595
|
if term.type == "PointTerminal" and term.net.name in reference_list:
|
|
1561
1596
|
pd = term.get_parameters()[1]
|
|
1562
|
-
locations.append([pd.x
|
|
1597
|
+
locations.append([Value(pd.x), Value(pd.y)])
|
|
1563
1598
|
for point in locations:
|
|
1564
1599
|
pointA = GrpcPointData([point[0] - expansion_size, point[1] - expansion_size])
|
|
1565
1600
|
pointB = GrpcPointData([point[0] + expansion_size, point[1] + expansion_size])
|
|
@@ -1827,7 +1862,7 @@ class Edb(EdbInit):
|
|
|
1827
1862
|
include_pingroups=True,
|
|
1828
1863
|
inlcude_voids_in_extents=False,
|
|
1829
1864
|
):
|
|
1830
|
-
expansion_size =
|
|
1865
|
+
expansion_size = Value(expansion_size)
|
|
1831
1866
|
|
|
1832
1867
|
# validate nets in layout
|
|
1833
1868
|
net_signals = [net for net in self.layout.nets if net.name in signal_list]
|
|
@@ -1910,7 +1945,7 @@ class Edb(EdbInit):
|
|
|
1910
1945
|
self.components.delete_single_pin_rlc()
|
|
1911
1946
|
self.logger.info_timer("Single Pins components deleted")
|
|
1912
1947
|
self.components.refresh_components()
|
|
1913
|
-
return [[pt.x
|
|
1948
|
+
return [[Value(pt.x), Value(pt.y)] for pt in _poly.without_arcs().points]
|
|
1914
1949
|
|
|
1915
1950
|
def _create_cutout_multithread(
|
|
1916
1951
|
self,
|
|
@@ -1939,7 +1974,7 @@ class Edb(EdbInit):
|
|
|
1939
1974
|
if output_aedb_path:
|
|
1940
1975
|
self.save_edb_as(output_aedb_path)
|
|
1941
1976
|
self.logger.info("Cutout Multithread started.")
|
|
1942
|
-
expansion_size =
|
|
1977
|
+
expansion_size = Value(expansion_size)
|
|
1943
1978
|
|
|
1944
1979
|
timer_start = self.logger.reset_timer()
|
|
1945
1980
|
if custom_extent:
|
|
@@ -1975,25 +2010,32 @@ class Edb(EdbInit):
|
|
|
1975
2010
|
if isinstance(term, PadstackInstanceTerminal):
|
|
1976
2011
|
if term.net.name in reference_list:
|
|
1977
2012
|
pins_to_preserve.append(term.edb_uid)
|
|
2013
|
+
delete_list = []
|
|
1978
2014
|
|
|
1979
2015
|
for i in self.nets.nets.values():
|
|
1980
2016
|
name = i.name
|
|
1981
2017
|
if name not in all_list and name not in nets_to_preserve:
|
|
1982
|
-
|
|
2018
|
+
delete_list.append(i)
|
|
2019
|
+
# i.delete()
|
|
2020
|
+
for i in delete_list:
|
|
2021
|
+
i.delete()
|
|
1983
2022
|
reference_pinsts = []
|
|
1984
2023
|
reference_prims = []
|
|
1985
2024
|
reference_paths = []
|
|
2025
|
+
delete_list = []
|
|
1986
2026
|
for i in self.padstacks.instances.values():
|
|
1987
2027
|
net_name = i.net_name
|
|
1988
2028
|
id = i.id
|
|
1989
2029
|
if net_name not in all_list and id not in pins_to_preserve:
|
|
1990
|
-
|
|
2030
|
+
delete_list.append(i)
|
|
2031
|
+
# i.delete()
|
|
1991
2032
|
elif net_name in reference_list and id not in pins_to_preserve:
|
|
1992
2033
|
reference_pinsts.append(i)
|
|
1993
2034
|
for i in self.modeler.primitives:
|
|
1994
2035
|
if not i.is_null and not i.net.is_null:
|
|
1995
2036
|
if i.net.name not in all_list:
|
|
1996
|
-
i.delete()
|
|
2037
|
+
# i.delete()
|
|
2038
|
+
delete_list.append(i)
|
|
1997
2039
|
elif i.net.name in reference_list and not i.is_void:
|
|
1998
2040
|
if keep_lines_as_path and isinstance(i, Path):
|
|
1999
2041
|
reference_paths.append(i)
|
|
@@ -2001,7 +2043,8 @@ class Edb(EdbInit):
|
|
|
2001
2043
|
reference_prims.append(i)
|
|
2002
2044
|
self.logger.info_timer("Net clean up")
|
|
2003
2045
|
self.logger.reset_timer()
|
|
2004
|
-
|
|
2046
|
+
for i in delete_list:
|
|
2047
|
+
i.delete()
|
|
2005
2048
|
if custom_extent and isinstance(custom_extent, list):
|
|
2006
2049
|
if custom_extent[0] != custom_extent[-1]:
|
|
2007
2050
|
custom_extent.append(custom_extent[0])
|
|
@@ -2033,7 +2076,7 @@ class Edb(EdbInit):
|
|
|
2033
2076
|
ExtentType as GrpcExtentType,
|
|
2034
2077
|
)
|
|
2035
2078
|
|
|
2036
|
-
if extent_type in ["Conforming", GrpcExtentType.CONFORMING, 1]:
|
|
2079
|
+
if extent_type in ["Conformal", "Conforming", GrpcExtentType.CONFORMING, 1]:
|
|
2037
2080
|
if extent_defeature > 0:
|
|
2038
2081
|
_poly = _poly.defeature(extent_defeature)
|
|
2039
2082
|
_poly1 = GrpcPolygonData(arcs=_poly.arc_data, closed=True)
|
|
@@ -2156,7 +2199,7 @@ class Edb(EdbInit):
|
|
|
2156
2199
|
self.save_edb()
|
|
2157
2200
|
self.logger.info_timer("Cutout completed.", timer_start)
|
|
2158
2201
|
self.logger.reset_timer()
|
|
2159
|
-
return [[pt.x
|
|
2202
|
+
return [[Value(pt.x), Value(pt.y)] for pt in _poly.without_arcs().points]
|
|
2160
2203
|
|
|
2161
2204
|
def get_conformal_polygon_from_netlist(self, netlist=None) -> Union[bool, Polygon]:
|
|
2162
2205
|
"""Returns conformal polygon data based on a netlist.
|
|
@@ -2282,7 +2325,7 @@ class Edb(EdbInit):
|
|
|
2282
2325
|
for p in p_missing:
|
|
2283
2326
|
position = GrpcPointData(p.position)
|
|
2284
2327
|
net = self.nets.find_or_create_net(p.net_name)
|
|
2285
|
-
rotation =
|
|
2328
|
+
rotation = Value(p.rotation)
|
|
2286
2329
|
sign_layers = list(self.stackup.signal_layers.keys())
|
|
2287
2330
|
if not p.start_layer: # pragma: no cover
|
|
2288
2331
|
fromlayer = self.stackup.signal_layers[sign_layers[0]]
|
|
@@ -2374,7 +2417,7 @@ class Edb(EdbInit):
|
|
|
2374
2417
|
self.logger.warning("aedb def file manually created.")
|
|
2375
2418
|
except:
|
|
2376
2419
|
pass
|
|
2377
|
-
return [[pt.x
|
|
2420
|
+
return [[Value(pt.x), Value(pt.y)] for pt in polygon_data.without_arcs().points]
|
|
2378
2421
|
|
|
2379
2422
|
@staticmethod
|
|
2380
2423
|
def write_export3d_option_config_file(path_to_output, config_dictionaries=None):
|
|
@@ -2447,7 +2490,7 @@ class Edb(EdbInit):
|
|
|
2447
2490
|
>>> # Export to HFSS project:
|
|
2448
2491
|
>>> edb.export_hfss(r"C:/output", net_list=["SignalNet"])
|
|
2449
2492
|
"""
|
|
2450
|
-
siwave_s = SiwaveSolve(self.edbpath
|
|
2493
|
+
siwave_s = SiwaveSolve(self.edbpath)
|
|
2451
2494
|
return siwave_s.export_3d_cad("HFSS", path_to_output, net_list, num_cores, aedt_file_name, hidden=hidden)
|
|
2452
2495
|
|
|
2453
2496
|
def export_q3d(
|
|
@@ -2549,7 +2592,7 @@ class Edb(EdbInit):
|
|
|
2549
2592
|
>>> # Solve with SIwave:
|
|
2550
2593
|
>>> edb.solve_siwave()
|
|
2551
2594
|
"""
|
|
2552
|
-
process = SiwaveSolve(self.edbpath
|
|
2595
|
+
process = SiwaveSolve(self.edbpath)
|
|
2553
2596
|
try:
|
|
2554
2597
|
self.close()
|
|
2555
2598
|
except:
|
|
@@ -2657,15 +2700,39 @@ class Edb(EdbInit):
|
|
|
2657
2700
|
Variable value if exists, else False.
|
|
2658
2701
|
"""
|
|
2659
2702
|
if self.variable_exists(variable_name):
|
|
2660
|
-
if "$"
|
|
2661
|
-
|
|
2662
|
-
variable = next(var for var in self.active_db.get_all_variable_names())
|
|
2663
|
-
else:
|
|
2664
|
-
variable = next(var for var in self.active_cell.get_all_variable_names())
|
|
2703
|
+
if variable_name.startswith("$"):
|
|
2704
|
+
variable = next(var for var in self.active_db.get_all_variable_names())
|
|
2665
2705
|
return self.db.get_variable_value(variable)
|
|
2706
|
+
else:
|
|
2707
|
+
variable = next(var for var in self.active_cell.get_all_variable_names())
|
|
2708
|
+
return self.active_cell.get_variable_value(variable)
|
|
2666
2709
|
self.logger.info(f"Variable {variable_name} doesn't exists.")
|
|
2667
2710
|
return False
|
|
2668
2711
|
|
|
2712
|
+
def get_variable_value(self, variable_name):
|
|
2713
|
+
"""
|
|
2714
|
+
Deprecated method to get the value of a variable.
|
|
2715
|
+
|
|
2716
|
+
.. deprecated:: pyedb 0.55.0
|
|
2717
|
+
Use :func:`get_variable` instead.
|
|
2718
|
+
"""
|
|
2719
|
+
warnings.warn(
|
|
2720
|
+
"`get_variable_value` is deprecated use `get_variable` instead.",
|
|
2721
|
+
DeprecationWarning,
|
|
2722
|
+
)
|
|
2723
|
+
return self.get_variable(variable_name)
|
|
2724
|
+
|
|
2725
|
+
def get_all_variable_names(self) -> List[str]:
|
|
2726
|
+
"""Method added for compatibility with grpc.
|
|
2727
|
+
|
|
2728
|
+
Returns
|
|
2729
|
+
-------
|
|
2730
|
+
List[str]
|
|
2731
|
+
List of variable names.
|
|
2732
|
+
|
|
2733
|
+
"""
|
|
2734
|
+
return list(self.active_cell.get_all_variable_names())
|
|
2735
|
+
|
|
2669
2736
|
def add_project_variable(self, variable_name, variable_value, description=None) -> bool:
|
|
2670
2737
|
"""Add project variable.
|
|
2671
2738
|
|
|
@@ -2736,11 +2803,11 @@ class Edb(EdbInit):
|
|
|
2736
2803
|
"""
|
|
2737
2804
|
if self.variable_exists(variable_name):
|
|
2738
2805
|
if variable_name in self.db.get_all_variable_names():
|
|
2739
|
-
self.db.set_variable_value(variable_name,
|
|
2806
|
+
self.db.set_variable_value(variable_name, Value(variable_value))
|
|
2740
2807
|
elif variable_name in self.active_cell.get_all_variable_names():
|
|
2741
|
-
self.active_cell.set_variable_value(variable_name,
|
|
2808
|
+
self.active_cell.set_variable_value(variable_name, Value(variable_value))
|
|
2742
2809
|
|
|
2743
|
-
def get_bounding_box(self) ->
|
|
2810
|
+
def get_bounding_box(self) -> tuple[tuple[float, float], tuple[float, float]]:
|
|
2744
2811
|
"""Get layout bounding box.
|
|
2745
2812
|
|
|
2746
2813
|
Returns
|
|
@@ -2750,7 +2817,7 @@ class Edb(EdbInit):
|
|
|
2750
2817
|
"""
|
|
2751
2818
|
lay_inst_polygon_data = [obj_inst.get_bbox() for obj_inst in self.layout_instance.query_layout_obj_instances()]
|
|
2752
2819
|
layout_bbox = GrpcPolygonData.bbox_of_polygons(lay_inst_polygon_data)
|
|
2753
|
-
return
|
|
2820
|
+
return ((Value(layout_bbox[0].x), Value(layout_bbox[0].y)), (Value(layout_bbox[1].x), Value(layout_bbox[1].y)))
|
|
2754
2821
|
|
|
2755
2822
|
def get_statistics(self, compute_area=False):
|
|
2756
2823
|
"""Get layout statistics.
|
|
@@ -3437,7 +3504,7 @@ class Edb(EdbInit):
|
|
|
3437
3504
|
_layers = {k: v for k, v in self.stackup.layers.items() if k in layer_filter}
|
|
3438
3505
|
for layer_name, layer in _layers.items():
|
|
3439
3506
|
var, val = _apply_variable(f"${layer_name}", layer.thickness)
|
|
3440
|
-
layer.thickness =
|
|
3507
|
+
layer.thickness = Value(var, self.active_db)
|
|
3441
3508
|
parameters.append(val)
|
|
3442
3509
|
if materials:
|
|
3443
3510
|
if not material_filter:
|
|
@@ -3447,14 +3514,14 @@ class Edb(EdbInit):
|
|
|
3447
3514
|
for mat_name, material in _materials.items():
|
|
3448
3515
|
if not material.conductivity or material.conductivity < 1e4:
|
|
3449
3516
|
var, val = _apply_variable(f"$epsr_{mat_name}", material.permittivity)
|
|
3450
|
-
material.permittivity =
|
|
3517
|
+
material.permittivity = Value(var, self.active_db)
|
|
3451
3518
|
parameters.append(val)
|
|
3452
3519
|
var, val = _apply_variable(f"$loss_tangent_{mat_name}", material.dielectric_loss_tangent)
|
|
3453
|
-
material.dielectric_loss_tangent =
|
|
3520
|
+
material.dielectric_loss_tangent = Value(var, self.active_db)
|
|
3454
3521
|
parameters.append(val)
|
|
3455
3522
|
else:
|
|
3456
3523
|
var, val = _apply_variable(f"$sigma_{mat_name}", material.conductivity)
|
|
3457
|
-
material.conductivity =
|
|
3524
|
+
material.conductivity = Value(var, self.active_db)
|
|
3458
3525
|
parameters.append(val)
|
|
3459
3526
|
if traces:
|
|
3460
3527
|
if not trace_net_filter:
|
|
@@ -3470,7 +3537,7 @@ class Edb(EdbInit):
|
|
|
3470
3537
|
else:
|
|
3471
3538
|
trace_width_variable = f"{path.aedt_name}"
|
|
3472
3539
|
var, val = _apply_variable(trace_width_variable, path.width)
|
|
3473
|
-
path.width =
|
|
3540
|
+
path.width = Value(var, self.active_cell)
|
|
3474
3541
|
parameters.append(val)
|
|
3475
3542
|
if not padstack_definition_filter:
|
|
3476
3543
|
if trace_net_filter:
|
|
@@ -3497,7 +3564,7 @@ class Edb(EdbInit):
|
|
|
3497
3564
|
hole_variable = f"${def_name}_hole_diameter"
|
|
3498
3565
|
if padstack_def.hole_diameter:
|
|
3499
3566
|
var, val = _apply_variable(hole_variable, padstack_def.hole_diameter)
|
|
3500
|
-
padstack_def.hole_properties =
|
|
3567
|
+
padstack_def.hole_properties = Value(var, self.active_db)
|
|
3501
3568
|
parameters.append(val)
|
|
3502
3569
|
if pads:
|
|
3503
3570
|
for layer, pad in padstack_def.pad_by_layer.items():
|
|
@@ -3712,7 +3779,7 @@ class Edb(EdbInit):
|
|
|
3712
3779
|
material="pec",
|
|
3713
3780
|
)
|
|
3714
3781
|
if launching_box_thickness:
|
|
3715
|
-
launching_box_thickness = str(
|
|
3782
|
+
launching_box_thickness = str(Value(launching_box_thickness))
|
|
3716
3783
|
cloned_edb.stackup.add_layer(
|
|
3717
3784
|
layer_name="ref",
|
|
3718
3785
|
layer_type="signal",
|
|
@@ -3747,7 +3814,7 @@ class Edb(EdbInit):
|
|
|
3747
3814
|
.parameters_values
|
|
3748
3815
|
)
|
|
3749
3816
|
else:
|
|
3750
|
-
pad_diameter =
|
|
3817
|
+
pad_diameter = Value(terminal_diameter)
|
|
3751
3818
|
_temp_circle = cloned_edb.modeler.create_circle(
|
|
3752
3819
|
layer_name="ports",
|
|
3753
3820
|
x=inst.position[0],
|
pyedb/grpc/edb_init.py
CHANGED
|
@@ -31,24 +31,17 @@ import time
|
|
|
31
31
|
import ansys.edb.core.database as database
|
|
32
32
|
|
|
33
33
|
from pyedb import __version__
|
|
34
|
-
from pyedb.edb_logger import pyedb_logger
|
|
35
34
|
from pyedb.generic.general_methods import env_path, env_value, is_linux
|
|
35
|
+
from pyedb.generic.settings import settings
|
|
36
36
|
from pyedb.grpc.rpc_session import RpcSession
|
|
37
|
-
from pyedb.misc.misc import list_installed_ansysem
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
class EdbInit(object):
|
|
41
40
|
"""Edb Dot Net Class."""
|
|
42
41
|
|
|
43
42
|
def __init__(self, edbversion):
|
|
44
|
-
self.logger =
|
|
43
|
+
self.logger = settings.logger
|
|
45
44
|
self._db = None
|
|
46
|
-
if not edbversion: # pragma: no cover
|
|
47
|
-
try:
|
|
48
|
-
edbversion = "20{}.{}".format(list_installed_ansysem()[0][-3:-1], list_installed_ansysem()[0][-1:])
|
|
49
|
-
self.logger.info("Edb version " + edbversion)
|
|
50
|
-
except IndexError:
|
|
51
|
-
raise Exception("No ANSYSEM_ROOTxxx is found.")
|
|
52
45
|
self.edbversion = edbversion
|
|
53
46
|
self.logger.info("Logger is initialized in EDB.")
|
|
54
47
|
self.logger.info("legacy v%s", __version__)
|
|
@@ -79,7 +72,7 @@ class EdbInit(object):
|
|
|
79
72
|
|
|
80
73
|
@staticmethod
|
|
81
74
|
def _signal_handler(signum=None, frame=None):
|
|
82
|
-
RpcSession.
|
|
75
|
+
RpcSession.kill_all_instances()
|
|
83
76
|
|
|
84
77
|
@property
|
|
85
78
|
def db(self):
|
pyedb/grpc/rpc_session.py
CHANGED
|
@@ -34,8 +34,8 @@ from ansys.edb.core.utility.io_manager import (
|
|
|
34
34
|
import psutil
|
|
35
35
|
|
|
36
36
|
from pyedb import __version__
|
|
37
|
-
from pyedb.edb_logger import pyedb_logger
|
|
38
37
|
from pyedb.generic.general_methods import env_path, env_value, is_linux
|
|
38
|
+
from pyedb.generic.settings import settings
|
|
39
39
|
from pyedb.misc.misc import list_installed_ansysem
|
|
40
40
|
|
|
41
41
|
latency_delay = 0.1
|
|
@@ -80,12 +80,12 @@ class RpcSession:
|
|
|
80
80
|
if not edb_version: # pragma: no cover
|
|
81
81
|
try:
|
|
82
82
|
edb_version = "20{}.{}".format(list_installed_ansysem()[0][-3:-1], list_installed_ansysem()[0][-1:])
|
|
83
|
-
|
|
83
|
+
settings.logger.info("Edb version " + edb_version)
|
|
84
84
|
except IndexError:
|
|
85
85
|
raise Exception("No ANSYSEM_ROOTxxx is found.")
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
settings.logger.info("Logger is initialized in EDB.")
|
|
87
|
+
settings.logger.info("legacy v%s", __version__)
|
|
88
|
+
settings.logger.info("Python version %s", sys.version)
|
|
89
89
|
if is_linux:
|
|
90
90
|
if env_value(edb_version) in os.environ:
|
|
91
91
|
RpcSession.base_path = env_path(edb_version)
|
|
@@ -106,18 +106,18 @@ class RpcSession:
|
|
|
106
106
|
|
|
107
107
|
if RpcSession.pid:
|
|
108
108
|
if restart_server:
|
|
109
|
-
|
|
109
|
+
settings.logger.logger.info("Restarting RPC server")
|
|
110
110
|
RpcSession.kill()
|
|
111
111
|
RpcSession.__start_rpc_server()
|
|
112
112
|
else:
|
|
113
|
-
|
|
113
|
+
settings.logger.info(f"Server already running on port {RpcSession.port}")
|
|
114
114
|
else:
|
|
115
115
|
RpcSession.__start_rpc_server()
|
|
116
116
|
if RpcSession.rpc_session:
|
|
117
117
|
RpcSession.server_pid = RpcSession.rpc_session.local_server_proc.pid
|
|
118
|
-
|
|
118
|
+
settings.logger.info(f"Grpc session started: pid={RpcSession.server_pid}")
|
|
119
119
|
else:
|
|
120
|
-
|
|
120
|
+
settings.logger.error("Failed to start EDB_RPC_server process")
|
|
121
121
|
|
|
122
122
|
@staticmethod
|
|
123
123
|
def __get_process_id():
|
|
@@ -135,7 +135,7 @@ class RpcSession:
|
|
|
135
135
|
time.sleep(latency_delay)
|
|
136
136
|
if RpcSession.rpc_session:
|
|
137
137
|
RpcSession.pid = RpcSession.rpc_session.local_server_proc.pid
|
|
138
|
-
|
|
138
|
+
settings.logger.logger.info("Grpc session started")
|
|
139
139
|
|
|
140
140
|
@staticmethod
|
|
141
141
|
def kill():
|