pyVHDLModel 0.36.0__tar.gz → 0.37.0__tar.gz
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.
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/PKG-INFO +25 -25
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Association.py +1 -1
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Base.py +16 -9
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Common.py +4 -4
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Concurrent.py +87 -26
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Declaration.py +4 -4
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/DesignUnit.py +7 -7
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Expression.py +11 -11
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Instantiation.py +3 -3
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Interface.py +3 -3
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Name.py +2 -2
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Namespace.py +25 -11
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Object.py +2 -2
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Regions.py +2 -1
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Sequential.py +14 -14
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Subprogram.py +1 -1
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Symbol.py +1 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Type.py +10 -10
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/__init__.py +72 -11
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel.egg-info/PKG-INFO +25 -25
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel.egg-info/requires.txt +24 -24
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyproject.toml +1 -1
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/LICENSE.md +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/README.md +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Exception.py +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/IEEE.py +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/PSLModel.py +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/Predefined.py +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/STD.py +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel/py.typed +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel.egg-info/SOURCES.txt +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel.egg-info/dependency_links.txt +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/pyVHDLModel.egg-info/top_level.txt +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/setup.cfg +0 -0
- {pyvhdlmodel-0.36.0 → pyvhdlmodel-0.37.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyVHDLModel
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.37.0
|
|
4
4
|
Summary: An abstract VHDL language model.
|
|
5
5
|
Home-page: https://GitHub.com/VHDL/pyVHDLModel
|
|
6
6
|
Author: Patrick Lehmann
|
|
@@ -28,41 +28,41 @@ Description-Content-Type: text/markdown
|
|
|
28
28
|
License-File: LICENSE.md
|
|
29
29
|
Requires-Dist: pyTooling~=8.15
|
|
30
30
|
Provides-Extra: doc
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist: sphinx
|
|
33
|
-
Requires-Dist: pyTooling~=8.15; extra == "doc"
|
|
34
|
-
Requires-Dist: sphinx_design~=0.7.0; extra == "doc"
|
|
31
|
+
Requires-Dist: autoapi>=2.0.1; extra == "doc"
|
|
32
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
35
33
|
Requires-Dist: sphinxcontrib-mermaid~=2.0; extra == "doc"
|
|
36
|
-
Requires-Dist:
|
|
34
|
+
Requires-Dist: sphinx_design~=0.7.0; extra == "doc"
|
|
35
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.12; extra == "doc"
|
|
37
36
|
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
|
|
37
|
+
Requires-Dist: pyTooling~=8.15; extra == "doc"
|
|
38
|
+
Requires-Dist: sphinx~=9.1; extra == "doc"
|
|
39
|
+
Requires-Dist: sphinx_reports~=0.11.0; extra == "doc"
|
|
38
40
|
Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
|
|
39
|
-
Requires-Dist: autoapi>=2.0.1; extra == "doc"
|
|
40
|
-
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
41
41
|
Provides-Extra: test
|
|
42
|
-
Requires-Dist: lxml<7.0,>=6.1; extra == "test"
|
|
43
42
|
Requires-Dist: mypy[reports]~=2.1; extra == "test"
|
|
44
|
-
Requires-Dist:
|
|
45
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: typing_extensions~=4.16; extra == "test"
|
|
44
|
+
Requires-Dist: pytest~=9.1; extra == "test"
|
|
46
45
|
Requires-Dist: pytest-cov~=7.1; extra == "test"
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: pyTooling~=8.15; extra == "test"
|
|
47
|
+
Requires-Dist: lxml<7.0,>=6.1; extra == "test"
|
|
48
|
+
Requires-Dist: Coverage~=7.15; extra == "test"
|
|
49
49
|
Provides-Extra: all
|
|
50
|
-
Requires-Dist: lxml<7.0,>=6.1; extra == "all"
|
|
51
|
-
Requires-Dist: sphinx_autodoc_typehints~=3.11; extra == "all"
|
|
52
|
-
Requires-Dist: sphinx~=9.1; extra == "all"
|
|
53
50
|
Requires-Dist: mypy[reports]~=2.1; extra == "all"
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Requires-Dist:
|
|
56
|
-
Requires-Dist:
|
|
51
|
+
Requires-Dist: typing_extensions~=4.16; extra == "all"
|
|
52
|
+
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
53
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
57
54
|
Requires-Dist: sphinxcontrib-mermaid~=2.0; extra == "all"
|
|
58
|
-
Requires-Dist:
|
|
59
|
-
Requires-Dist: pytest
|
|
55
|
+
Requires-Dist: sphinx_design~=0.7.0; extra == "all"
|
|
56
|
+
Requires-Dist: pytest~=9.1; extra == "all"
|
|
60
57
|
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
|
|
58
|
+
Requires-Dist: sphinx~=9.1; extra == "all"
|
|
59
|
+
Requires-Dist: pytest-cov~=7.1; extra == "all"
|
|
60
|
+
Requires-Dist: pyTooling~=8.15; extra == "all"
|
|
61
|
+
Requires-Dist: lxml<7.0,>=6.1; extra == "all"
|
|
62
|
+
Requires-Dist: Coverage~=7.15; extra == "all"
|
|
63
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.12; extra == "all"
|
|
64
|
+
Requires-Dist: sphinx_reports~=0.11.0; extra == "all"
|
|
61
65
|
Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
|
|
62
|
-
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
63
|
-
Requires-Dist: typing_extensions~=4.15; extra == "all"
|
|
64
|
-
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
65
|
-
Requires-Dist: Coverage~=7.14; extra == "all"
|
|
66
66
|
Dynamic: author
|
|
67
67
|
Dynamic: author-email
|
|
68
68
|
Dynamic: classifier
|
|
@@ -117,15 +117,22 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
117
117
|
"""
|
|
118
118
|
self._parent = parent
|
|
119
119
|
|
|
120
|
-
@
|
|
120
|
+
@property
|
|
121
121
|
def Parent(self) -> 'ModelEntity':
|
|
122
122
|
"""
|
|
123
|
-
|
|
123
|
+
Property to access the model entity's parent element reference in a logical hierarchy (:attr:`_parent`).
|
|
124
124
|
|
|
125
125
|
:returns: Reference to the parent entity.
|
|
126
126
|
"""
|
|
127
127
|
return self._parent
|
|
128
128
|
|
|
129
|
+
@Parent.setter
|
|
130
|
+
def Parent(self, parent: 'ModelEntity') -> None:
|
|
131
|
+
if parent is None:
|
|
132
|
+
raise ValueError("Parameter 'parent' is None.")
|
|
133
|
+
|
|
134
|
+
self._parent = parent
|
|
135
|
+
|
|
129
136
|
def GetAncestor(self, type: Type) -> 'ModelEntity':
|
|
130
137
|
parent = self._parent
|
|
131
138
|
while not isinstance(parent, type):
|
|
@@ -339,7 +346,7 @@ class ConditionalMixin(metaclass=ExtendedType, mixin=True):
|
|
|
339
346
|
"""
|
|
340
347
|
self._condition = condition
|
|
341
348
|
if condition is not None:
|
|
342
|
-
condition.
|
|
349
|
+
condition.Parent = self
|
|
343
350
|
|
|
344
351
|
@readonly
|
|
345
352
|
def Condition(self) -> ExpressionUnion:
|
|
@@ -392,11 +399,11 @@ class ReportStatementMixin(metaclass=ExtendedType, mixin=True):
|
|
|
392
399
|
def __init__(self, message: Nullable[ExpressionUnion] = None, severity: Nullable[ExpressionUnion] = None) -> None:
|
|
393
400
|
self._message = message
|
|
394
401
|
if message is not None:
|
|
395
|
-
message.
|
|
402
|
+
message.Parent = self
|
|
396
403
|
|
|
397
404
|
self._severity = severity
|
|
398
405
|
if severity is not None:
|
|
399
|
-
severity.
|
|
406
|
+
severity.Parent = self
|
|
400
407
|
|
|
401
408
|
@property
|
|
402
409
|
def Message(self) -> Nullable[ExpressionUnion]:
|
|
@@ -445,10 +452,10 @@ class Range(ModelEntity):
|
|
|
445
452
|
super().__init__(parent)
|
|
446
453
|
|
|
447
454
|
self._leftBound = leftBound
|
|
448
|
-
leftBound.
|
|
455
|
+
leftBound.Parent = self
|
|
449
456
|
|
|
450
457
|
self._rightBound = rightBound
|
|
451
|
-
rightBound.
|
|
458
|
+
rightBound.Parent = self
|
|
452
459
|
|
|
453
460
|
self._direction = direction
|
|
454
461
|
|
|
@@ -477,11 +484,11 @@ class WaveformElement(ModelEntity):
|
|
|
477
484
|
super().__init__(parent)
|
|
478
485
|
|
|
479
486
|
self._expression = expression
|
|
480
|
-
expression.
|
|
487
|
+
expression.Parent = self
|
|
481
488
|
|
|
482
489
|
self._after = after
|
|
483
490
|
if after is not None:
|
|
484
|
-
after.
|
|
491
|
+
after.Parent = self
|
|
485
492
|
|
|
486
493
|
@property
|
|
487
494
|
def Expression(self) -> ExpressionUnion:
|
|
@@ -101,14 +101,14 @@ class ProcedureCallMixin(metaclass=ExtendedType, mixin=True):
|
|
|
101
101
|
|
|
102
102
|
def __init__(self, procedureName: Symbol, parameterMappings: Nullable[Iterable[ParameterAssociationItem]] = None) -> None:
|
|
103
103
|
self._procedure = procedureName
|
|
104
|
-
procedureName.
|
|
104
|
+
procedureName.Parent = self
|
|
105
105
|
|
|
106
106
|
# TODO: extract to mixin
|
|
107
107
|
self._parameterMappings = []
|
|
108
108
|
if parameterMappings is not None:
|
|
109
109
|
for parameterMapping in parameterMappings:
|
|
110
110
|
self._parameterMappings.append(parameterMapping)
|
|
111
|
-
parameterMapping.
|
|
111
|
+
parameterMapping.Parent = self
|
|
112
112
|
|
|
113
113
|
@readonly
|
|
114
114
|
def Procedure(self) -> Symbol:
|
|
@@ -127,7 +127,7 @@ class AssignmentMixin(metaclass=ExtendedType, mixin=True):
|
|
|
127
127
|
|
|
128
128
|
def __init__(self, target: Symbol) -> None:
|
|
129
129
|
self._target = target
|
|
130
|
-
target.
|
|
130
|
+
target.Parent = self
|
|
131
131
|
|
|
132
132
|
@property
|
|
133
133
|
def Target(self) -> Symbol:
|
|
@@ -150,7 +150,7 @@ class VariableAssignmentMixin(AssignmentMixin, mixin=True):
|
|
|
150
150
|
super().__init__(target)
|
|
151
151
|
|
|
152
152
|
self._expression = expression
|
|
153
|
-
expression.
|
|
153
|
+
expression.Parent = self
|
|
154
154
|
|
|
155
155
|
@property
|
|
156
156
|
def Expression(self) -> ExpressionUnion:
|
|
@@ -95,7 +95,7 @@ class ConcurrentStatementsMixin(metaclass=ExtendedType, mixin=True):
|
|
|
95
95
|
if statements is not None:
|
|
96
96
|
for statement in statements:
|
|
97
97
|
self._statements.append(statement)
|
|
98
|
-
statement.
|
|
98
|
+
statement.Parent = self
|
|
99
99
|
|
|
100
100
|
@readonly
|
|
101
101
|
def Statements(self) -> List[ConcurrentStatement]:
|
|
@@ -147,14 +147,14 @@ class Instantiation(ConcurrentStatement):
|
|
|
147
147
|
if genericAssociations is not None:
|
|
148
148
|
for association in genericAssociations:
|
|
149
149
|
self._genericAssociations.append(association)
|
|
150
|
-
association.
|
|
150
|
+
association.Parent = self
|
|
151
151
|
|
|
152
152
|
# TODO: extract to mixin
|
|
153
153
|
self._portAssociations = []
|
|
154
154
|
if portAssociations is not None:
|
|
155
155
|
for association in portAssociations:
|
|
156
156
|
self._portAssociations.append(association)
|
|
157
|
-
association.
|
|
157
|
+
association.Parent = self
|
|
158
158
|
|
|
159
159
|
@readonly
|
|
160
160
|
def GenericAssociations(self) -> List[AssociationItem]:
|
|
@@ -190,7 +190,7 @@ class ComponentInstantiation(Instantiation):
|
|
|
190
190
|
super().__init__(label, genericAssociations, portAssociations, parent)
|
|
191
191
|
|
|
192
192
|
self._component = componentSymbol
|
|
193
|
-
componentSymbol.
|
|
193
|
+
componentSymbol.Parent = self
|
|
194
194
|
|
|
195
195
|
@property
|
|
196
196
|
def Component(self) -> ComponentInstantiationSymbol:
|
|
@@ -224,11 +224,11 @@ class EntityInstantiation(Instantiation):
|
|
|
224
224
|
super().__init__(label, genericAssociations, portAssociations, parent)
|
|
225
225
|
|
|
226
226
|
self._entity = entitySymbol
|
|
227
|
-
entitySymbol.
|
|
227
|
+
entitySymbol.Parent = self
|
|
228
228
|
|
|
229
229
|
self._architecture = architectureSymbol
|
|
230
230
|
if architectureSymbol is not None:
|
|
231
|
-
architectureSymbol.
|
|
231
|
+
architectureSymbol.Parent = self
|
|
232
232
|
|
|
233
233
|
@property
|
|
234
234
|
def Entity(self) -> EntityInstantiationSymbol:
|
|
@@ -264,7 +264,7 @@ class ConfigurationInstantiation(Instantiation):
|
|
|
264
264
|
super().__init__(label, genericAssociations, portAssociations, parent)
|
|
265
265
|
|
|
266
266
|
self._configuration = configurationSymbol
|
|
267
|
-
configurationSymbol.
|
|
267
|
+
configurationSymbol.Parent = self
|
|
268
268
|
|
|
269
269
|
@property
|
|
270
270
|
def Configuration(self) -> ConfigurationInstantiationSymbol:
|
|
@@ -331,7 +331,9 @@ class ConcurrentProcedureCall(ConcurrentStatement, ProcedureCallMixin):
|
|
|
331
331
|
|
|
332
332
|
@export
|
|
333
333
|
class ConcurrentBlockStatement(ConcurrentStatement, BlockStatementMixin, LabeledEntityMixin, ConcurrentDeclarationRegionMixin, ConcurrentStatementsMixin, DocumentedEntityMixin, AllowBlackboxMixin):
|
|
334
|
-
_portItems:
|
|
334
|
+
_portItems: List[PortInterfaceItemMixin]
|
|
335
|
+
|
|
336
|
+
_namespace: Namespace
|
|
335
337
|
|
|
336
338
|
def __init__(
|
|
337
339
|
self,
|
|
@@ -344,6 +346,11 @@ class ConcurrentBlockStatement(ConcurrentStatement, BlockStatementMixin, Labeled
|
|
|
344
346
|
parent: Nullable[ModelEntity] = None
|
|
345
347
|
) -> None:
|
|
346
348
|
super().__init__(label, parent)
|
|
349
|
+
|
|
350
|
+
self._namespace = Namespace(self._normalizedLabel)
|
|
351
|
+
if parent is not None:
|
|
352
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
353
|
+
|
|
347
354
|
BlockStatementMixin.__init__(self)
|
|
348
355
|
LabeledEntityMixin.__init__(self, label)
|
|
349
356
|
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
@@ -356,7 +363,13 @@ class ConcurrentBlockStatement(ConcurrentStatement, BlockStatementMixin, Labeled
|
|
|
356
363
|
if portItems is not None:
|
|
357
364
|
for item in portItems:
|
|
358
365
|
self._portItems.append(item)
|
|
359
|
-
item.
|
|
366
|
+
item.Parent = self
|
|
367
|
+
|
|
368
|
+
@ConcurrentStatement.Parent.setter
|
|
369
|
+
def Parent(self, parent: ModelEntity) -> None:
|
|
370
|
+
ConcurrentStatement.Parent.fset(self, parent)
|
|
371
|
+
|
|
372
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
360
373
|
|
|
361
374
|
@property
|
|
362
375
|
def PortItems(self) -> List[PortInterfaceItemMixin]:
|
|
@@ -389,14 +402,17 @@ class GenerateBranch(ModelEntity, ConcurrentDeclarationRegionMixin, ConcurrentSt
|
|
|
389
402
|
parent: Nullable[ModelEntity] = None
|
|
390
403
|
) -> None:
|
|
391
404
|
super().__init__(parent)
|
|
392
|
-
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
393
|
-
ConcurrentStatementsMixin.__init__(self, statements)
|
|
394
|
-
AllowBlackboxMixin.__init__(self, allowBlackbox)
|
|
395
405
|
|
|
396
406
|
self._alternativeLabel = alternativeLabel
|
|
397
407
|
self._normalizedAlternativeLabel = alternativeLabel.lower() if alternativeLabel is not None else None
|
|
398
408
|
|
|
399
409
|
self._namespace = Namespace(self._normalizedAlternativeLabel)
|
|
410
|
+
if parent is not None:
|
|
411
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
412
|
+
|
|
413
|
+
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
414
|
+
ConcurrentStatementsMixin.__init__(self, statements)
|
|
415
|
+
AllowBlackboxMixin.__init__(self, allowBlackbox)
|
|
400
416
|
|
|
401
417
|
@property
|
|
402
418
|
def AlternativeLabel(self) -> Nullable[str]:
|
|
@@ -517,8 +533,6 @@ class GenerateStatement(ConcurrentStatement, AllowBlackboxMixin):
|
|
|
517
533
|
* :class:`For...generate statement <pyVHDLModel.Concurrent.ForGenerateStatement>`
|
|
518
534
|
"""
|
|
519
535
|
|
|
520
|
-
_namespace: Namespace
|
|
521
|
-
|
|
522
536
|
def __init__(
|
|
523
537
|
self,
|
|
524
538
|
label: Nullable[str] = None,
|
|
@@ -528,8 +542,6 @@ class GenerateStatement(ConcurrentStatement, AllowBlackboxMixin):
|
|
|
528
542
|
super().__init__(label, parent)
|
|
529
543
|
AllowBlackboxMixin.__init__(self, allowBlackbox)
|
|
530
544
|
|
|
531
|
-
self._namespace = Namespace(self._normalizedLabel)
|
|
532
|
-
|
|
533
545
|
# @mustoverride
|
|
534
546
|
def IterateInstantiations(self) -> Generator[Instantiation, None, None]:
|
|
535
547
|
raise NotImplementedError()
|
|
@@ -580,20 +592,38 @@ class IfGenerateStatement(GenerateStatement):
|
|
|
580
592
|
super().__init__(label, allowBlackbox, parent)
|
|
581
593
|
|
|
582
594
|
self._ifBranch = ifBranch
|
|
583
|
-
ifBranch.
|
|
595
|
+
ifBranch.Parent = self
|
|
584
596
|
|
|
585
597
|
self._elsifBranches = []
|
|
586
598
|
if elsifBranches is not None:
|
|
587
599
|
for branch in elsifBranches:
|
|
588
600
|
self._elsifBranches.append(branch)
|
|
589
|
-
branch.
|
|
601
|
+
branch.Parent = self
|
|
590
602
|
|
|
591
603
|
if elseBranch is not None:
|
|
592
604
|
self._elseBranch = elseBranch
|
|
593
|
-
elseBranch.
|
|
605
|
+
elseBranch.Parent = self
|
|
594
606
|
else:
|
|
595
607
|
self._elseBranch = None
|
|
596
608
|
|
|
609
|
+
@GenerateStatement.Parent.setter
|
|
610
|
+
def Parent(self, parent: ModelEntity) -> None:
|
|
611
|
+
from pyVHDLModel.DesignUnit import Architecture
|
|
612
|
+
|
|
613
|
+
GenerateStatement.Parent.fset(self, parent)
|
|
614
|
+
|
|
615
|
+
# Connect namespaces
|
|
616
|
+
namespace = self._ifBranch._namespace
|
|
617
|
+
namespace.ParentNamespace = parent._namespace
|
|
618
|
+
if namespace._name == "":
|
|
619
|
+
namespace._name = self._normalizedLabel
|
|
620
|
+
|
|
621
|
+
for elseBranch in self._elsifBranches:
|
|
622
|
+
elseBranch._namespace.ParentNamespace = parent._namespace
|
|
623
|
+
|
|
624
|
+
if self._elseBranch is not None:
|
|
625
|
+
self._elseBranch._namespace.ParentNamespace = parent._namespace
|
|
626
|
+
|
|
597
627
|
@property
|
|
598
628
|
def IfBranch(self) -> IfGenerateBranch:
|
|
599
629
|
return self._ifBranch
|
|
@@ -634,7 +664,7 @@ class IndexedGenerateChoice(ConcurrentChoice):
|
|
|
634
664
|
super().__init__(parent)
|
|
635
665
|
|
|
636
666
|
self._expression = expression
|
|
637
|
-
expression.
|
|
667
|
+
expression.Parent = self
|
|
638
668
|
|
|
639
669
|
@property
|
|
640
670
|
def Expression(self) -> ExpressionUnion:
|
|
@@ -652,7 +682,7 @@ class RangedGenerateChoice(ConcurrentChoice):
|
|
|
652
682
|
super().__init__(parent)
|
|
653
683
|
|
|
654
684
|
self._range = rng
|
|
655
|
-
rng.
|
|
685
|
+
rng.Parent = self
|
|
656
686
|
|
|
657
687
|
@property
|
|
658
688
|
def Range(self) -> 'Range':
|
|
@@ -664,6 +694,8 @@ class RangedGenerateChoice(ConcurrentChoice):
|
|
|
664
694
|
|
|
665
695
|
@export
|
|
666
696
|
class ConcurrentCase(BaseCase, LabeledEntityMixin, ConcurrentDeclarationRegionMixin, ConcurrentStatementsMixin, AllowBlackboxMixin):
|
|
697
|
+
_namespace: Namespace
|
|
698
|
+
|
|
667
699
|
def __init__(
|
|
668
700
|
self,
|
|
669
701
|
declaredItems: Nullable[Iterable] = None,
|
|
@@ -674,6 +706,14 @@ class ConcurrentCase(BaseCase, LabeledEntityMixin, ConcurrentDeclarationRegionMi
|
|
|
674
706
|
) -> None:
|
|
675
707
|
super().__init__(parent)
|
|
676
708
|
LabeledEntityMixin.__init__(self, alternativeLabel)
|
|
709
|
+
|
|
710
|
+
# TODO: Why not handover self?
|
|
711
|
+
# This allows access to Label and NormalizedLabel, also to create a full instance path in case a lookup goes wrong.
|
|
712
|
+
# TODO: How about a WithNamespaceMixin class?
|
|
713
|
+
self._namespace = Namespace(self._normalizedLabel)
|
|
714
|
+
if parent is not None:
|
|
715
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
716
|
+
|
|
677
717
|
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
678
718
|
ConcurrentStatementsMixin.__init__(self, statements)
|
|
679
719
|
AllowBlackboxMixin.__init__(self, allowBlackbox)
|
|
@@ -699,7 +739,7 @@ class GenerateCase(ConcurrentCase):
|
|
|
699
739
|
if choices is not None:
|
|
700
740
|
for choice in choices:
|
|
701
741
|
self._choices.append(choice)
|
|
702
|
-
choice.
|
|
742
|
+
choice.Parent = self
|
|
703
743
|
|
|
704
744
|
# TODO: move to parent or grandparent
|
|
705
745
|
@property
|
|
@@ -749,14 +789,22 @@ class CaseGenerateStatement(GenerateStatement):
|
|
|
749
789
|
super().__init__(label, allowBlackbox, parent)
|
|
750
790
|
|
|
751
791
|
self._expression = expression
|
|
752
|
-
expression.
|
|
792
|
+
expression.Parent = self
|
|
753
793
|
|
|
754
794
|
# TODO: create a mixin for things with cases
|
|
755
795
|
self._cases = []
|
|
756
796
|
if cases is not None:
|
|
757
797
|
for case in cases:
|
|
758
798
|
self._cases.append(case)
|
|
759
|
-
case.
|
|
799
|
+
case.Parent = self
|
|
800
|
+
|
|
801
|
+
@GenerateStatement.Parent.setter
|
|
802
|
+
def Parent(self, parent: ModelEntity) -> None:
|
|
803
|
+
GenerateStatement.Parent.fset(self, parent)
|
|
804
|
+
|
|
805
|
+
# Connect namespaces
|
|
806
|
+
for case in self._cases:
|
|
807
|
+
case._namespace.ParentNamespace = parent._namespace
|
|
760
808
|
|
|
761
809
|
@property
|
|
762
810
|
def SelectExpression(self) -> ExpressionUnion:
|
|
@@ -792,6 +840,8 @@ class ForGenerateStatement(GenerateStatement, ConcurrentDeclarationRegionMixin,
|
|
|
792
840
|
_loopIndex: str
|
|
793
841
|
_range: Range
|
|
794
842
|
|
|
843
|
+
_namespace: Namespace
|
|
844
|
+
|
|
795
845
|
def __init__(
|
|
796
846
|
self,
|
|
797
847
|
label: str,
|
|
@@ -803,13 +853,24 @@ class ForGenerateStatement(GenerateStatement, ConcurrentDeclarationRegionMixin,
|
|
|
803
853
|
parent: Nullable[ModelEntity] = None
|
|
804
854
|
) -> None:
|
|
805
855
|
super().__init__(label, allowBlackbox, parent)
|
|
856
|
+
|
|
857
|
+
self._namespace = Namespace(self._normalizedLabel)
|
|
858
|
+
if parent is not None:
|
|
859
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
860
|
+
|
|
806
861
|
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
807
862
|
ConcurrentStatementsMixin.__init__(self, statements)
|
|
808
863
|
|
|
809
864
|
self._loopIndex = loopIndex
|
|
810
865
|
|
|
811
866
|
self._range = rng
|
|
812
|
-
rng.
|
|
867
|
+
rng.Parent = self
|
|
868
|
+
|
|
869
|
+
@GenerateStatement.Parent.setter
|
|
870
|
+
def Parent(self, parent: ModelEntity) -> None:
|
|
871
|
+
GenerateStatement.Parent.fset(self, parent)
|
|
872
|
+
|
|
873
|
+
self._namespace.ParentNamespace = parent._namespace
|
|
813
874
|
|
|
814
875
|
@property
|
|
815
876
|
def LoopIndex(self) -> str:
|
|
@@ -859,7 +920,7 @@ class ConcurrentSimpleSignalAssignment(ConcurrentSignalAssignment):
|
|
|
859
920
|
if waveform is not None:
|
|
860
921
|
for waveformElement in waveform:
|
|
861
922
|
self._waveform.append(waveformElement)
|
|
862
|
-
waveformElement.
|
|
923
|
+
waveformElement.Parent = self
|
|
863
924
|
|
|
864
925
|
@property
|
|
865
926
|
def Waveform(self) -> List[WaveformElement]:
|
|
@@ -110,7 +110,7 @@ class Attribute(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
|
|
|
110
110
|
DocumentedEntityMixin.__init__(self, documentation)
|
|
111
111
|
|
|
112
112
|
self._subtype = subtype
|
|
113
|
-
subtype.
|
|
113
|
+
subtype.Parent = self
|
|
114
114
|
|
|
115
115
|
@readonly
|
|
116
116
|
def Subtype(self) -> None:
|
|
@@ -149,15 +149,15 @@ class AttributeSpecification(ModelEntity, DocumentedEntityMixin):
|
|
|
149
149
|
self._identifiers = [] # TODO: convert to dict
|
|
150
150
|
for identifier in identifiers:
|
|
151
151
|
self._identifiers.append(identifier)
|
|
152
|
-
identifier.
|
|
152
|
+
identifier.Parent = self
|
|
153
153
|
|
|
154
154
|
self._attribute = attribute
|
|
155
|
-
attribute.
|
|
155
|
+
attribute.Parent = self
|
|
156
156
|
|
|
157
157
|
self._entityClass = entityClass
|
|
158
158
|
|
|
159
159
|
self._expression = expression
|
|
160
|
-
expression.
|
|
160
|
+
expression.Parent = self
|
|
161
161
|
|
|
162
162
|
@readonly
|
|
163
163
|
def Identifiers(self) -> List[Name]:
|
|
@@ -384,7 +384,7 @@ class Context(PrimaryUnit):
|
|
|
384
384
|
if references is not None:
|
|
385
385
|
for reference in references:
|
|
386
386
|
self._references.append(reference)
|
|
387
|
-
reference.
|
|
387
|
+
reference.Parent = self
|
|
388
388
|
|
|
389
389
|
if isinstance(reference, LibraryClause):
|
|
390
390
|
self._libraryReferences.append(reference)
|
|
@@ -485,7 +485,7 @@ class Package(PrimaryUnit, DesignUnitWithContextMixin, WithGenericsMixin, Concur
|
|
|
485
485
|
for normalizedIdentifier in item.NormalizedIdentifiers:
|
|
486
486
|
self._deferredConstants[normalizedIdentifier] = item
|
|
487
487
|
elif isinstance(item, Component):
|
|
488
|
-
self._components[item.
|
|
488
|
+
self._components[item._normalizedIdentifier] = item
|
|
489
489
|
else:
|
|
490
490
|
super()._IndexOtherDeclaredItem(item)
|
|
491
491
|
|
|
@@ -529,7 +529,7 @@ class PackageBody(SecondaryUnit, DesignUnitWithContextMixin, ConcurrentDeclarati
|
|
|
529
529
|
ConcurrentDeclarationRegionMixin.__init__(self, declaredItems)
|
|
530
530
|
|
|
531
531
|
self._package = packageSymbol
|
|
532
|
-
packageSymbol.
|
|
532
|
+
packageSymbol.Parent = self
|
|
533
533
|
|
|
534
534
|
@property
|
|
535
535
|
def Package(self) -> PackageSymbol:
|
|
@@ -644,10 +644,10 @@ class Architecture(SecondaryUnit, DesignUnitWithContextMixin, ConcurrentDeclarat
|
|
|
644
644
|
AllowBlackboxMixin.__init__(self, allowBlackbox)
|
|
645
645
|
|
|
646
646
|
self._entity = entity
|
|
647
|
-
entity.
|
|
647
|
+
entity.Parent = self
|
|
648
648
|
|
|
649
649
|
@property
|
|
650
|
-
def Entity(self) -> EntitySymbol:
|
|
650
|
+
def Entity(self) -> EntitySymbol: # FIXME: change to entitySymbol, offer entity directly, but raise exception if not resolved.
|
|
651
651
|
return self._entity
|
|
652
652
|
|
|
653
653
|
def __str__(self) -> str:
|
|
@@ -706,14 +706,14 @@ class Component(ModelEntity, NamedEntityMixin, DocumentedEntityMixin, AllowBlack
|
|
|
706
706
|
if genericItems is not None:
|
|
707
707
|
for item in genericItems:
|
|
708
708
|
self._genericItems.append(item)
|
|
709
|
-
item.
|
|
709
|
+
item.Parent = self
|
|
710
710
|
|
|
711
711
|
# TODO: extract to mixin
|
|
712
712
|
self._portItems = []
|
|
713
713
|
if portItems is not None:
|
|
714
714
|
for item in portItems:
|
|
715
715
|
self._portItems.append(item)
|
|
716
|
-
item.
|
|
716
|
+
item.Parent = self
|
|
717
717
|
|
|
718
718
|
@property
|
|
719
719
|
def IsBlackbox(self) -> Nullable[bool]:
|
|
@@ -302,7 +302,7 @@ class UnaryExpression(BaseExpression):
|
|
|
302
302
|
super().__init__(parent)
|
|
303
303
|
|
|
304
304
|
self._operand = operand
|
|
305
|
-
# operand.
|
|
305
|
+
# operand.Parent = self # FIXME: operand is provided as None
|
|
306
306
|
|
|
307
307
|
@readonly
|
|
308
308
|
def Operand(self):
|
|
@@ -384,10 +384,10 @@ class BinaryExpression(BaseExpression):
|
|
|
384
384
|
super().__init__(parent)
|
|
385
385
|
|
|
386
386
|
self._leftOperand = leftOperand
|
|
387
|
-
leftOperand.
|
|
387
|
+
leftOperand.Parent = self
|
|
388
388
|
|
|
389
389
|
self._rightOperand = rightOperand
|
|
390
|
-
rightOperand.
|
|
390
|
+
rightOperand.Parent = self
|
|
391
391
|
|
|
392
392
|
@property
|
|
393
393
|
def LeftOperand(self):
|
|
@@ -642,10 +642,10 @@ class QualifiedExpression(BaseExpression, ParenthesisExpression):
|
|
|
642
642
|
super().__init__(parent)
|
|
643
643
|
|
|
644
644
|
self._operand = operand
|
|
645
|
-
operand.
|
|
645
|
+
operand.Parent = self
|
|
646
646
|
|
|
647
647
|
self._subtype = subtype
|
|
648
|
-
subtype.
|
|
648
|
+
subtype.Parent = self
|
|
649
649
|
|
|
650
650
|
@property
|
|
651
651
|
def Operand(self):
|
|
@@ -720,7 +720,7 @@ class SubtypeAllocation(Allocation):
|
|
|
720
720
|
super().__init__(parent)
|
|
721
721
|
|
|
722
722
|
self._subtype = subtype
|
|
723
|
-
subtype.
|
|
723
|
+
subtype.Parent = self
|
|
724
724
|
|
|
725
725
|
@property
|
|
726
726
|
def Subtype(self) -> Symbol:
|
|
@@ -738,7 +738,7 @@ class QualifiedExpressionAllocation(Allocation):
|
|
|
738
738
|
super().__init__(parent)
|
|
739
739
|
|
|
740
740
|
self._qualifiedExpression = qualifiedExpression
|
|
741
|
-
qualifiedExpression.
|
|
741
|
+
qualifiedExpression.Parent = self
|
|
742
742
|
|
|
743
743
|
@property
|
|
744
744
|
def QualifiedExpression(self) -> QualifiedExpression:
|
|
@@ -758,7 +758,7 @@ class AggregateElement(ModelEntity):
|
|
|
758
758
|
super().__init__(parent)
|
|
759
759
|
|
|
760
760
|
self._expression = expression
|
|
761
|
-
expression.
|
|
761
|
+
expression.Parent = self
|
|
762
762
|
|
|
763
763
|
@property
|
|
764
764
|
def Expression(self):
|
|
@@ -796,7 +796,7 @@ class RangedAggregateElement(AggregateElement):
|
|
|
796
796
|
super().__init__(expression, parent)
|
|
797
797
|
|
|
798
798
|
self._range = rng
|
|
799
|
-
rng.
|
|
799
|
+
rng.Parent = self
|
|
800
800
|
|
|
801
801
|
@property
|
|
802
802
|
def Range(self) -> Range:
|
|
@@ -814,7 +814,7 @@ class NamedAggregateElement(AggregateElement):
|
|
|
814
814
|
super().__init__(expression, parent)
|
|
815
815
|
|
|
816
816
|
self._name = name
|
|
817
|
-
name.
|
|
817
|
+
name.Parent = self
|
|
818
818
|
|
|
819
819
|
@property
|
|
820
820
|
def Name(self) -> Symbol:
|
|
@@ -845,7 +845,7 @@ class Aggregate(BaseExpression):
|
|
|
845
845
|
self._elements = []
|
|
846
846
|
for element in elements:
|
|
847
847
|
self._elements.append(element)
|
|
848
|
-
element.
|
|
848
|
+
element.Parent = self
|
|
849
849
|
|
|
850
850
|
@property
|
|
851
851
|
def Elements(self) -> List[AggregateElement]:
|
|
@@ -83,12 +83,12 @@ class PackageInstantiation(Package, GenericInstantiationMixin): # TODO: maybe a
|
|
|
83
83
|
_packageReference: PackageReferenceSymbol
|
|
84
84
|
_genericAssociations: List[GenericAssociationItem]
|
|
85
85
|
|
|
86
|
-
def __init__(self, identifier: str,
|
|
86
|
+
def __init__(self, identifier: str, genericPackage: PackageReferenceSymbol, documentation: Nullable[str] = None, parent: Nullable[ModelEntity] = None) -> None:
|
|
87
87
|
super().__init__(identifier, documentation=documentation, parent=parent)
|
|
88
88
|
GenericEntityInstantiationMixin.__init__(self)
|
|
89
89
|
|
|
90
|
-
self._packageReference =
|
|
91
|
-
|
|
90
|
+
self._packageReference = genericPackage
|
|
91
|
+
self._packageReference.Parent = self
|
|
92
92
|
|
|
93
93
|
# TODO: extract to mixin
|
|
94
94
|
self._genericAssociations = []
|