pyVHDLModel 0.40.0rc3__tar.gz → 0.41.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.40.0rc3 → pyvhdlmodel-0.41.0}/PKG-INFO +27 -27
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Association.py +2 -2
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Base.py +72 -6
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Common.py +4 -4
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Concurrent.py +42 -15
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Configuration.py +13 -3
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Declaration.py +4 -1
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/DesignUnit.py +40 -2
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Exception.py +33 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Expression.py +266 -21
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Formatting/VHDL.py +1064 -774
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/IEEE.py +10 -10
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Instantiation.py +3 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Interface.py +119 -21
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Name.py +6 -4
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Object.py +14 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Regions.py +269 -15
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/STD.py +18 -17
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Sequential.py +51 -15
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Subprogram.py +123 -15
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Symbol.py +131 -3
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Type.py +94 -4
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Visitor.py +186 -26
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/__init__.py +1 -1
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel.egg-info/PKG-INFO +27 -27
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel.egg-info/requires.txt +26 -26
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyproject.toml +2 -2
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/LICENSE.md +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/README.md +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Formatting/__init__.py +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Namespace.py +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/PSLModel.py +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/Predefined.py +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel/py.typed +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel.egg-info/SOURCES.txt +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel.egg-info/dependency_links.txt +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/pyVHDLModel.egg-info/top_level.txt +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.0}/setup.cfg +0 -0
- {pyvhdlmodel-0.40.0rc3 → pyvhdlmodel-0.41.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.41.0
|
|
4
4
|
Summary: An abstract VHDL language model.
|
|
5
5
|
Home-page: https://GitHub.com/VHDL/pyVHDLModel
|
|
6
6
|
Author: Patrick Lehmann
|
|
@@ -26,45 +26,45 @@ Classifier: Development Status :: 4 - Beta
|
|
|
26
26
|
Requires-Python: >=3.11
|
|
27
27
|
Description-Content-Type: text/markdown
|
|
28
28
|
License-File: LICENSE.md
|
|
29
|
-
Requires-Dist: pyTooling<11.0,>=10.
|
|
29
|
+
Requires-Dist: pyTooling<11.0,>=10.1.1
|
|
30
30
|
Provides-Extra: doc
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
|
|
31
|
+
Requires-Dist: sphinx~=9.2; extra == "doc"
|
|
33
32
|
Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist: pyTooling.Sphinx[reports]~=0.1.0rc5; extra == "doc"
|
|
36
|
-
Requires-Dist: sphinx~=9.1; extra == "doc"
|
|
37
|
-
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
33
|
+
Requires-Dist: autoapi>=2.0.1; extra == "doc"
|
|
38
34
|
Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "doc"
|
|
39
|
-
Requires-Dist:
|
|
35
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
36
|
+
Requires-Dist: pyTooling.Sphinx[reports]~=1.0; extra == "doc"
|
|
37
|
+
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
|
|
40
38
|
Requires-Dist: sphinx_design~=0.7.0; extra == "doc"
|
|
39
|
+
Requires-Dist: pyTooling<11.0,>=10.1.1; extra == "doc"
|
|
40
|
+
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "doc"
|
|
41
41
|
Provides-Extra: test
|
|
42
|
-
Requires-Dist: Coverage~=7.16; extra == "test"
|
|
43
|
-
Requires-Dist: mypy[reports]~=2.4; extra == "test"
|
|
44
|
-
Requires-Dist: pyTooling<11.0,>=10.0.0rc8; extra == "test"
|
|
45
|
-
Requires-Dist: pytest~=9.1; extra == "test"
|
|
46
|
-
Requires-Dist: lxml<7.0,>=6.1.3; extra == "test"
|
|
47
42
|
Requires-Dist: pytest-xdist~=3.8; extra == "test"
|
|
48
|
-
Requires-Dist:
|
|
43
|
+
Requires-Dist: lxml<7.0,>=6.1.3; extra == "test"
|
|
44
|
+
Requires-Dist: Coverage~=7.17; extra == "test"
|
|
49
45
|
Requires-Dist: pytest-cov~=7.1; extra == "test"
|
|
46
|
+
Requires-Dist: mypy[reports]~=2.4; extra == "test"
|
|
47
|
+
Requires-Dist: pyTooling<11.0,>=10.1.1; extra == "test"
|
|
48
|
+
Requires-Dist: typing_extensions~=4.16; extra == "test"
|
|
49
|
+
Requires-Dist: pytest~=9.1; extra == "test"
|
|
50
50
|
Provides-Extra: all
|
|
51
|
-
Requires-Dist:
|
|
52
|
-
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
51
|
+
Requires-Dist: sphinx~=9.2; extra == "all"
|
|
53
52
|
Requires-Dist: mypy[reports]~=2.4; extra == "all"
|
|
54
|
-
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
|
|
55
53
|
Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
|
|
56
|
-
Requires-Dist:
|
|
57
|
-
Requires-Dist: pyTooling.Sphinx[reports]~=0.1.0rc5; extra == "all"
|
|
58
|
-
Requires-Dist: sphinx~=9.1; extra == "all"
|
|
59
|
-
Requires-Dist: pytest~=9.1; extra == "all"
|
|
60
|
-
Requires-Dist: lxml<7.0,>=6.1.3; extra == "all"
|
|
61
|
-
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
62
|
-
Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "all"
|
|
63
|
-
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
|
|
54
|
+
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
64
55
|
Requires-Dist: pytest-xdist~=3.8; extra == "all"
|
|
56
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "all"
|
|
57
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
58
|
+
Requires-Dist: lxml<7.0,>=6.1.3; extra == "all"
|
|
59
|
+
Requires-Dist: pyTooling.Sphinx[reports]~=1.0; extra == "all"
|
|
60
|
+
Requires-Dist: Coverage~=7.17; extra == "all"
|
|
61
|
+
Requires-Dist: pytest-cov~=7.1; extra == "all"
|
|
62
|
+
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
|
|
65
63
|
Requires-Dist: sphinx_design~=0.7.0; extra == "all"
|
|
64
|
+
Requires-Dist: pyTooling<11.0,>=10.1.1; extra == "all"
|
|
66
65
|
Requires-Dist: typing_extensions~=4.16; extra == "all"
|
|
67
|
-
Requires-Dist: pytest
|
|
66
|
+
Requires-Dist: pytest~=9.1; extra == "all"
|
|
67
|
+
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
|
|
68
68
|
Dynamic: author
|
|
69
69
|
Dynamic: author-email
|
|
70
70
|
Dynamic: classifier
|
|
@@ -232,7 +232,7 @@ class GenericMapAspectMixin(metaclass=ExtendedType, mixin=True):
|
|
|
232
232
|
visitor.VisitGenericMapAspect(self)
|
|
233
233
|
for index, item in enumerate(self._genericAssociationItems):
|
|
234
234
|
if index > 0:
|
|
235
|
-
visitor.
|
|
235
|
+
visitor.VisitAssociationListSeparator(self)
|
|
236
236
|
|
|
237
237
|
item.Visit(visitor)
|
|
238
238
|
|
|
@@ -462,7 +462,7 @@ class PortMapAspectMixin(metaclass=ExtendedType, mixin=True):
|
|
|
462
462
|
visitor.VisitPortMapAspect(self)
|
|
463
463
|
for index, item in enumerate(self._portAssociationItems):
|
|
464
464
|
if index > 0:
|
|
465
|
-
visitor.
|
|
465
|
+
visitor.VisitAssociationListSeparator(self)
|
|
466
466
|
|
|
467
467
|
item.Visit(visitor)
|
|
468
468
|
|
|
@@ -43,8 +43,9 @@ from pyTooling.Common import StringEnum, getFullyQualifiedName
|
|
|
43
43
|
from pyTooling.Decorators import export, notimplemented, readonly
|
|
44
44
|
from pyTooling.MetaClasses import ExtendedType, abstractclass
|
|
45
45
|
if TYPE_CHECKING:
|
|
46
|
-
from pyVHDLModel.
|
|
47
|
-
from pyVHDLModel.
|
|
46
|
+
from pyVHDLModel.Interface import SingleDeclarationMixin
|
|
47
|
+
from pyVHDLModel.Symbol import Symbol
|
|
48
|
+
from pyVHDLModel.Visitor import Visitor
|
|
48
49
|
|
|
49
50
|
|
|
50
51
|
__all__ = ["ExpressionUnion", "ModelElementUnion"]
|
|
@@ -448,7 +449,11 @@ class OptionallyNamedEntityMixin(metaclass=ExtendedType, mixin=True):
|
|
|
448
449
|
|
|
449
450
|
|
|
450
451
|
@export
|
|
451
|
-
class MultipleNamedEntityMixin(
|
|
452
|
+
class MultipleNamedEntityMixin(
|
|
453
|
+
metaclass=ExtendedType,
|
|
454
|
+
mixin=True,
|
|
455
|
+
expects=("_parent", "Copy", "_SplitInParent")
|
|
456
|
+
):
|
|
452
457
|
"""
|
|
453
458
|
A ``MultipleNamedEntityMixin`` is a mixin class for all VHDL entities that declare multiple instances at once by
|
|
454
459
|
defining multiple identifiers.
|
|
@@ -456,6 +461,10 @@ class MultipleNamedEntityMixin(metaclass=ExtendedType, mixin=True):
|
|
|
456
461
|
Protected variables :attr:`_identifiers` and :attr:`_normalizedIdentifiers` are available to derived classes as well
|
|
457
462
|
as two readonly properties :attr:`Identifiers` and :attr:`NormalizedIdentifiers` for public access.
|
|
458
463
|
|
|
464
|
+
The host class provides ``Copy()`` and ``_SplitInParent()``, called by :meth:`Split`: the latter calls the parent's
|
|
465
|
+
mutator splitting the declaration, e.g.
|
|
466
|
+
:meth:`DeclarationRegionMixin.SplitDeclaredItem <pyVHDLModel.Regions.DeclarationRegionMixin.SplitDeclaredItem>`.
|
|
467
|
+
|
|
459
468
|
.. seealso::
|
|
460
469
|
|
|
461
470
|
* :class:`Mode view element <pyVHDLModel.Interface.ModeViewElement>`
|
|
@@ -463,17 +472,19 @@ class MultipleNamedEntityMixin(metaclass=ExtendedType, mixin=True):
|
|
|
463
472
|
* :class:`Record type element <pyVHDLModel.Type.RecordTypeElement>`
|
|
464
473
|
"""
|
|
465
474
|
|
|
466
|
-
_identifiers: tuple[str]
|
|
467
|
-
_normalizedIdentifiers: tuple[str]
|
|
475
|
+
_identifiers: tuple[str] #: A list of identifiers.
|
|
476
|
+
_normalizedIdentifiers: tuple[str] #: A list of normalized (lower case) identifiers.
|
|
477
|
+
_singleDeclarations: Nullable[list[SingleDeclarationMixin]] #: Cached single declarations, or ``None``.
|
|
468
478
|
|
|
469
479
|
def __init__(self, identifiers: Iterable[str]) -> None:
|
|
470
480
|
"""
|
|
471
|
-
Initializes a multiple-named entity.
|
|
481
|
+
Initializes a multiple-named entity without single declarations yet.
|
|
472
482
|
|
|
473
483
|
:param identifiers: Sequence of identifiers (names) of the model entity.
|
|
474
484
|
"""
|
|
475
485
|
self._identifiers = tuple(identifiers)
|
|
476
486
|
self._normalizedIdentifiers = tuple([identifier.lower() for identifier in self._identifiers])
|
|
487
|
+
self._singleDeclarations = None
|
|
477
488
|
|
|
478
489
|
@readonly
|
|
479
490
|
def Identifiers(self) -> tuple[str]:
|
|
@@ -493,6 +504,61 @@ class MultipleNamedEntityMixin(metaclass=ExtendedType, mixin=True):
|
|
|
493
504
|
"""
|
|
494
505
|
return self._normalizedIdentifiers
|
|
495
506
|
|
|
507
|
+
def Split(self) -> tuple[Self, ...]:
|
|
508
|
+
"""
|
|
509
|
+
Split this declaration into one declaration per identifier.
|
|
510
|
+
|
|
511
|
+
IEEE Std 1076 defines a declaration with an identifier list as equivalent to a sequence of single declarations,
|
|
512
|
+
one per identifier, in list order: ``signal a, b : bit;`` declares the same as ``signal a : bit; signal b : bit;``.
|
|
513
|
+
This declaration keeps its first identifier. For every other identifier, a new declaration is created by
|
|
514
|
+
``Copy()``: it has its own copy of the subtype indication and of the default expression, and the same
|
|
515
|
+
documentation. Single declarations created before are dropped.
|
|
516
|
+
|
|
517
|
+
Without a parent, the new declarations have no parent either: the caller places them. With a parent, the parent's
|
|
518
|
+
mutator splits the declaration and inserts the new declarations right after it, e.g.
|
|
519
|
+
:meth:`WithPortsMixin.SplitPortItem <pyVHDLModel.Regions.WithPortsMixin.SplitPortItem>` for a port.
|
|
520
|
+
|
|
521
|
+
A declaration with one identifier is unchanged.
|
|
522
|
+
|
|
523
|
+
:returns: Tuple of declarations, one per identifier in list order, starting with this
|
|
524
|
+
declaration.
|
|
525
|
+
:raises NotAChildError: If this declaration's parent doesn't list it.
|
|
526
|
+
:raises NotInNamespaceError: If the parent is an indexed declarative region, and an identifier of this declaration
|
|
527
|
+
refers to another element, e.g. a duplicate declaration.
|
|
528
|
+
"""
|
|
529
|
+
if self._parent is not None:
|
|
530
|
+
return self._SplitInParent()
|
|
531
|
+
elif len(self._identifiers) == 1:
|
|
532
|
+
return (self, )
|
|
533
|
+
|
|
534
|
+
declarations = self._SplitCopies()
|
|
535
|
+
self._KeepIdentifier(0)
|
|
536
|
+
return (self, *declarations)
|
|
537
|
+
|
|
538
|
+
def _SplitCopies(self) -> list[Self]:
|
|
539
|
+
"""
|
|
540
|
+
Create one parentless copy of this declaration per identifier after the first, each keeping its identifier.
|
|
541
|
+
|
|
542
|
+
:returns: List of new declarations, in list order.
|
|
543
|
+
"""
|
|
544
|
+
declarations = []
|
|
545
|
+
for position in range(1, len(self._identifiers)):
|
|
546
|
+
declaration = self.Copy()
|
|
547
|
+
declaration._KeepIdentifier(position)
|
|
548
|
+
declarations.append(declaration)
|
|
549
|
+
|
|
550
|
+
return declarations
|
|
551
|
+
|
|
552
|
+
def _KeepIdentifier(self, position: int) -> None:
|
|
553
|
+
"""
|
|
554
|
+
Reduce the identifier list to the identifier at a position and drop the single declarations.
|
|
555
|
+
|
|
556
|
+
:param position: The position of the identifier to keep.
|
|
557
|
+
"""
|
|
558
|
+
self._identifiers = (self._identifiers[position], )
|
|
559
|
+
self._normalizedIdentifiers = (self._normalizedIdentifiers[position], )
|
|
560
|
+
self._singleDeclarations = None
|
|
561
|
+
|
|
496
562
|
|
|
497
563
|
@export
|
|
498
564
|
def identifiersOf(item) -> tuple[str, ...]:
|
|
@@ -197,7 +197,7 @@ class ProcedureCallMixin(metaclass=ExtendedType, mixin=True):
|
|
|
197
197
|
visitor.VisitActualParameterPart(self)
|
|
198
198
|
for index, item in enumerate(self._parameterAssociationItems):
|
|
199
199
|
if index > 0:
|
|
200
|
-
visitor.
|
|
200
|
+
visitor.VisitAssociationListSeparator(self)
|
|
201
201
|
|
|
202
202
|
item.Visit(visitor)
|
|
203
203
|
|
|
@@ -533,7 +533,7 @@ class WaveformMixin(metaclass=ExtendedType, mixin=True):
|
|
|
533
533
|
"""
|
|
534
534
|
for index, element in enumerate(self._waveform):
|
|
535
535
|
if index > 0:
|
|
536
|
-
visitor.
|
|
536
|
+
visitor.VisitWaveformSeparator(self)
|
|
537
537
|
|
|
538
538
|
element.Visit(visitor)
|
|
539
539
|
|
|
@@ -956,7 +956,7 @@ class SelectedWaveformsMixin(metaclass=ExtendedType, mixin=True):
|
|
|
956
956
|
"""
|
|
957
957
|
for index, selectedWaveform in enumerate(self._selectedWaveforms):
|
|
958
958
|
if index > 0:
|
|
959
|
-
visitor.
|
|
959
|
+
visitor.VisitSelectedAlternativeSeparator(self)
|
|
960
960
|
|
|
961
961
|
selectedWaveform.Visit(visitor)
|
|
962
962
|
|
|
@@ -1002,7 +1002,7 @@ class SelectedExpressionsMixin(metaclass=ExtendedType, mixin=True):
|
|
|
1002
1002
|
"""
|
|
1003
1003
|
for index, selectedExpression in enumerate(self._selectedExpressions):
|
|
1004
1004
|
if index > 0:
|
|
1005
|
-
visitor.
|
|
1005
|
+
visitor.VisitSelectedAlternativeSeparator(self)
|
|
1006
1006
|
|
|
1007
1007
|
selectedExpression.Visit(visitor)
|
|
1008
1008
|
|
|
@@ -36,7 +36,7 @@ Concurrent defines all concurrent statements used in entities, architectures, ge
|
|
|
36
36
|
"""
|
|
37
37
|
from __future__ import annotations
|
|
38
38
|
|
|
39
|
-
from typing import TYPE_CHECKING, Union, Iterable, Generator, Optional as Nullable
|
|
39
|
+
from typing import TYPE_CHECKING, ClassVar, Union, Iterable, Generator, Optional as Nullable
|
|
40
40
|
|
|
41
41
|
from pyTooling.Common import getFullyQualifiedName, getTypeName
|
|
42
42
|
from pyTooling.Decorators import export, readonly
|
|
@@ -44,7 +44,7 @@ from pyTooling.MetaClasses import ExtendedType, abstractclass
|
|
|
44
44
|
|
|
45
45
|
from pyVHDLModel.Base import ModelEntity, LabeledEntityMixin, DocumentedEntityMixin, Range, BaseChoice, \
|
|
46
46
|
BaseCase, IfBranchMixin, ElsifBranchMixin, ElseBranchMixin, AssertStatementMixin, \
|
|
47
|
-
BlockStatementMixin, WaveformElement, ChoicesMixin
|
|
47
|
+
BlockStatementMixin, WaveformElement, ChoicesMixin, ReservedWord
|
|
48
48
|
from pyVHDLModel.Exception import AlreadyInDesignError, DuplicateLabelError, NotAChildError
|
|
49
49
|
from pyVHDLModel.Regions import ConcurrentDeclarationRegionMixin, SequentialDeclarationRegionMixin, \
|
|
50
50
|
WithGenericsMixin, WithPortsMixin
|
|
@@ -320,12 +320,12 @@ class ConcurrentStatementsMixin(metaclass=ExtendedType, mixin=True, expects=("_C
|
|
|
320
320
|
|
|
321
321
|
:param statement: The concurrent statement to insert.
|
|
322
322
|
:param before: The statement of this construct to insert before.
|
|
323
|
-
:raises ValueError: If parameter 'before' is ``None``.
|
|
324
|
-
:raises TypeError: If parameter 'before' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
325
|
-
:raises NotAChildError: If parameter 'before' is not a statement of this construct.
|
|
326
323
|
:raises ValueError: If parameter 'statement' is ``None``.
|
|
327
324
|
:raises TypeError: If parameter 'statement' is not of type :class:`ConcurrentStatement`.
|
|
328
325
|
:raises AlreadyInDesignError: If parameter 'statement' already has a parent.
|
|
326
|
+
:raises ValueError: If parameter 'before' is ``None``.
|
|
327
|
+
:raises TypeError: If parameter 'before' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
328
|
+
:raises NotAChildError: If parameter 'before' is not a statement of this construct.
|
|
329
329
|
:raises DuplicateLabelError: If the declarative region already declares the statement's label.
|
|
330
330
|
|
|
331
331
|
.. seealso::
|
|
@@ -366,12 +366,12 @@ class ConcurrentStatementsMixin(metaclass=ExtendedType, mixin=True, expects=("_C
|
|
|
366
366
|
|
|
367
367
|
:param statement: The concurrent statement to insert.
|
|
368
368
|
:param after: The statement of this construct to insert after.
|
|
369
|
-
:raises ValueError: If parameter 'after' is ``None``.
|
|
370
|
-
:raises TypeError: If parameter 'after' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
371
|
-
:raises NotAChildError: If parameter 'after' is not a statement of this construct.
|
|
372
369
|
:raises ValueError: If parameter 'statement' is ``None``.
|
|
373
370
|
:raises TypeError: If parameter 'statement' is not of type :class:`ConcurrentStatement`.
|
|
374
371
|
:raises AlreadyInDesignError: If parameter 'statement' already has a parent.
|
|
372
|
+
:raises ValueError: If parameter 'after' is ``None``.
|
|
373
|
+
:raises TypeError: If parameter 'after' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
374
|
+
:raises NotAChildError: If parameter 'after' is not a statement of this construct.
|
|
375
375
|
:raises DuplicateLabelError: If the declarative region already declares the statement's label.
|
|
376
376
|
|
|
377
377
|
.. seealso::
|
|
@@ -525,12 +525,12 @@ class ConcurrentStatementsMixin(metaclass=ExtendedType, mixin=True, expects=("_C
|
|
|
525
525
|
|
|
526
526
|
:param statement: The concurrent statement to move.
|
|
527
527
|
:param before: The statement of this construct to move before.
|
|
528
|
-
:raises ValueError: If parameter 'before' is ``None``.
|
|
529
|
-
:raises TypeError: If parameter 'before' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
530
|
-
:raises NotAChildError: If parameter 'before' is not a statement of this construct.
|
|
531
528
|
:raises ValueError: If parameter 'statement' is ``None``.
|
|
532
529
|
:raises TypeError: If parameter 'statement' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
533
530
|
:raises NotAChildError: If parameter 'statement' is not a statement of this construct.
|
|
531
|
+
:raises ValueError: If parameter 'before' is ``None``.
|
|
532
|
+
:raises TypeError: If parameter 'before' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
533
|
+
:raises NotAChildError: If parameter 'before' is not a statement of this construct.
|
|
534
534
|
|
|
535
535
|
.. seealso::
|
|
536
536
|
|
|
@@ -571,12 +571,12 @@ class ConcurrentStatementsMixin(metaclass=ExtendedType, mixin=True, expects=("_C
|
|
|
571
571
|
|
|
572
572
|
:param statement: The concurrent statement to move.
|
|
573
573
|
:param after: The statement of this construct to move after.
|
|
574
|
-
:raises ValueError: If parameter 'after' is ``None``.
|
|
575
|
-
:raises TypeError: If parameter 'after' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
576
|
-
:raises NotAChildError: If parameter 'after' is not a statement of this construct.
|
|
577
574
|
:raises ValueError: If parameter 'statement' is ``None``.
|
|
578
575
|
:raises TypeError: If parameter 'statement' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
579
576
|
:raises NotAChildError: If parameter 'statement' is not a statement of this construct.
|
|
577
|
+
:raises ValueError: If parameter 'after' is ``None``.
|
|
578
|
+
:raises TypeError: If parameter 'after' is not of type :class:`~pyVHDLModel.Base.ModelEntity`.
|
|
579
|
+
:raises NotAChildError: If parameter 'after' is not a statement of this construct.
|
|
580
580
|
|
|
581
581
|
.. seealso::
|
|
582
582
|
|
|
@@ -703,6 +703,7 @@ class ComponentInstantiation(Instantiation):
|
|
|
703
703
|
visitor.VisitComponentInstantiation(self)
|
|
704
704
|
self._component.Visit(visitor)
|
|
705
705
|
self._VisitMapAspects(visitor)
|
|
706
|
+
visitor.VisitTerminator(self)
|
|
706
707
|
visitor.DepartComponentInstantiation(self)
|
|
707
708
|
|
|
708
709
|
@readonly
|
|
@@ -778,6 +779,7 @@ class EntityInstantiation(Instantiation):
|
|
|
778
779
|
visitor.VisitRightParenthesis(self)
|
|
779
780
|
|
|
780
781
|
self._VisitMapAspects(visitor)
|
|
782
|
+
visitor.VisitTerminator(self)
|
|
781
783
|
visitor.DepartEntityInstantiation(self)
|
|
782
784
|
|
|
783
785
|
@readonly
|
|
@@ -848,6 +850,7 @@ class ConfigurationInstantiation(Instantiation):
|
|
|
848
850
|
visitor.VisitConfigurationInstantiation(self)
|
|
849
851
|
self._configuration.Visit(visitor)
|
|
850
852
|
self._VisitMapAspects(visitor)
|
|
853
|
+
visitor.VisitTerminator(self)
|
|
851
854
|
visitor.DepartConfigurationInstantiation(self)
|
|
852
855
|
|
|
853
856
|
@readonly
|
|
@@ -883,6 +886,9 @@ class ProcessStatement(ConcurrentStatement, SequentialDeclarationRegionMixin, Se
|
|
|
883
886
|
end process;
|
|
884
887
|
"""
|
|
885
888
|
|
|
889
|
+
_END_KEYWORDS: ClassVar[tuple[ReservedWord, ...]] = (ReservedWord.Process,) #: Reserved words after ``end``.
|
|
890
|
+
_END_KEYWORDS_OPTIONAL: ClassVar[bool] = False #: The reserved words after ``end`` are optional.
|
|
891
|
+
|
|
886
892
|
# TODO: implement a SignalSymbol
|
|
887
893
|
_sensitivityList: list[Name] #: List of all signal names in the sensitivity list, or ``None`` if none was given.
|
|
888
894
|
|
|
@@ -929,7 +935,7 @@ class ProcessStatement(ConcurrentStatement, SequentialDeclarationRegionMixin, Se
|
|
|
929
935
|
visitor.VisitSensitivityList(self)
|
|
930
936
|
for index, name in enumerate(self._sensitivityList):
|
|
931
937
|
if index > 0:
|
|
932
|
-
visitor.
|
|
938
|
+
visitor.VisitNameListSeparator(self)
|
|
933
939
|
|
|
934
940
|
name.Visit(visitor)
|
|
935
941
|
|
|
@@ -939,6 +945,8 @@ class ProcessStatement(ConcurrentStatement, SequentialDeclarationRegionMixin, Se
|
|
|
939
945
|
self._VisitDeclaredItems(visitor)
|
|
940
946
|
visitor.VisitBegin(self)
|
|
941
947
|
self._VisitStatements(visitor)
|
|
948
|
+
visitor.VisitEnd(self)
|
|
949
|
+
visitor.VisitTerminator(self)
|
|
942
950
|
visitor.DepartProcessStatement(self)
|
|
943
951
|
|
|
944
952
|
@ConcurrentStatement.Parent.setter
|
|
@@ -1012,6 +1020,7 @@ class ConcurrentProcedureCall(ConcurrentStatement, ProcedureCallMixin):
|
|
|
1012
1020
|
"""
|
|
1013
1021
|
visitor.VisitConcurrentProcedureCall(self)
|
|
1014
1022
|
self._VisitProcedureCall(visitor)
|
|
1023
|
+
visitor.VisitTerminator(self)
|
|
1015
1024
|
visitor.DepartConcurrentProcedureCall(self)
|
|
1016
1025
|
|
|
1017
1026
|
|
|
@@ -1063,6 +1072,9 @@ class ConcurrentBlockStatement(
|
|
|
1063
1072
|
|
|
1064
1073
|
* :class:`Generate statement <pyVHDLModel.Concurrent.GenerateStatement>`
|
|
1065
1074
|
"""
|
|
1075
|
+
|
|
1076
|
+
_END_KEYWORDS: ClassVar[tuple[ReservedWord, ...]] = (ReservedWord.Block,) #: Reserved words after ``end``.
|
|
1077
|
+
_END_KEYWORDS_OPTIONAL: ClassVar[bool] = False #: The reserved words after ``end`` are optional.
|
|
1066
1078
|
def __init__(
|
|
1067
1079
|
self,
|
|
1068
1080
|
label: str,
|
|
@@ -1120,6 +1132,8 @@ class ConcurrentBlockStatement(
|
|
|
1120
1132
|
self._VisitDeclaredItems(visitor)
|
|
1121
1133
|
visitor.VisitBegin(self)
|
|
1122
1134
|
self._VisitStatements(visitor)
|
|
1135
|
+
visitor.VisitEnd(self)
|
|
1136
|
+
visitor.VisitTerminator(self)
|
|
1123
1137
|
visitor.DepartConcurrentBlockStatement(self)
|
|
1124
1138
|
|
|
1125
1139
|
@ConcurrentStatement.Parent.setter
|
|
@@ -1397,6 +1411,9 @@ class GenerateStatement(ConcurrentStatement, AllowBlackboxMixin):
|
|
|
1397
1411
|
* :class:`For generate statement <pyVHDLModel.Concurrent.ForGenerateStatement>`
|
|
1398
1412
|
"""
|
|
1399
1413
|
|
|
1414
|
+
_END_KEYWORDS: ClassVar[tuple[ReservedWord, ...]] = (ReservedWord.Generate,) #: Reserved words after ``end``.
|
|
1415
|
+
_END_KEYWORDS_OPTIONAL: ClassVar[bool] = False #: The reserved words after ``end`` are optional.
|
|
1416
|
+
|
|
1400
1417
|
def __init__(
|
|
1401
1418
|
self,
|
|
1402
1419
|
label: Nullable[str] = None,
|
|
@@ -1511,6 +1528,8 @@ class IfGenerateStatement(GenerateStatement):
|
|
|
1511
1528
|
if self._elseBranch is not None:
|
|
1512
1529
|
self._elseBranch.Visit(visitor)
|
|
1513
1530
|
|
|
1531
|
+
visitor.VisitEnd(self)
|
|
1532
|
+
visitor.VisitTerminator(self)
|
|
1514
1533
|
visitor.DepartIfGenerateStatement(self)
|
|
1515
1534
|
|
|
1516
1535
|
@GenerateStatement.Parent.setter
|
|
@@ -1916,6 +1935,8 @@ class CaseGenerateStatement(GenerateStatement):
|
|
|
1916
1935
|
for case in self._cases:
|
|
1917
1936
|
case.Visit(visitor)
|
|
1918
1937
|
|
|
1938
|
+
visitor.VisitEnd(self)
|
|
1939
|
+
visitor.VisitTerminator(self)
|
|
1919
1940
|
visitor.DepartCaseGenerateStatement(self)
|
|
1920
1941
|
|
|
1921
1942
|
@GenerateStatement.Parent.setter
|
|
@@ -2028,6 +2049,8 @@ class ForGenerateStatement(GenerateStatement, ConcurrentDeclarationRegionMixin,
|
|
|
2028
2049
|
self._VisitDeclaredItems(visitor)
|
|
2029
2050
|
visitor.VisitBegin(self)
|
|
2030
2051
|
self._VisitStatements(visitor)
|
|
2052
|
+
visitor.VisitEnd(self)
|
|
2053
|
+
visitor.VisitTerminator(self)
|
|
2031
2054
|
visitor.DepartForGenerateStatement(self)
|
|
2032
2055
|
|
|
2033
2056
|
@GenerateStatement.Parent.setter
|
|
@@ -2137,6 +2160,7 @@ class ConcurrentSimpleSignalAssignment(ConcurrentSignalAssignment, WaveformMixin
|
|
|
2137
2160
|
self._target.Visit(visitor)
|
|
2138
2161
|
visitor.VisitSignalAssignment(self)
|
|
2139
2162
|
self._VisitWaveform(visitor)
|
|
2163
|
+
visitor.VisitTerminator(self)
|
|
2140
2164
|
visitor.DepartConcurrentSimpleSignalAssignment(self)
|
|
2141
2165
|
|
|
2142
2166
|
|
|
@@ -2199,6 +2223,7 @@ class ConcurrentSelectedSignalAssignment(ConcurrentSignalAssignment, ExpressionM
|
|
|
2199
2223
|
self._target.Visit(visitor)
|
|
2200
2224
|
visitor.VisitSignalAssignment(self)
|
|
2201
2225
|
self._VisitSelectedWaveforms(visitor)
|
|
2226
|
+
visitor.VisitTerminator(self)
|
|
2202
2227
|
visitor.DepartConcurrentSelectedSignalAssignment(self)
|
|
2203
2228
|
|
|
2204
2229
|
|
|
@@ -2255,6 +2280,7 @@ class ConcurrentConditionalSignalAssignment(ConcurrentSignalAssignment, Conditio
|
|
|
2255
2280
|
self._target.Visit(visitor)
|
|
2256
2281
|
visitor.VisitSignalAssignment(self)
|
|
2257
2282
|
self._VisitConditionalWaveforms(visitor)
|
|
2283
|
+
visitor.VisitTerminator(self)
|
|
2258
2284
|
visitor.DepartConcurrentConditionalSignalAssignment(self)
|
|
2259
2285
|
|
|
2260
2286
|
|
|
@@ -2308,4 +2334,5 @@ class ConcurrentAssertStatement(ConcurrentStatement, AssertStatementMixin):
|
|
|
2308
2334
|
"""
|
|
2309
2335
|
visitor.VisitConcurrentAssertStatement(self)
|
|
2310
2336
|
self._VisitAssertion(visitor)
|
|
2337
|
+
visitor.VisitTerminator(self)
|
|
2311
2338
|
visitor.DepartConcurrentAssertStatement(self)
|
|
@@ -36,12 +36,12 @@ identical configuration specifications), and block configurations.
|
|
|
36
36
|
"""
|
|
37
37
|
from __future__ import annotations
|
|
38
38
|
|
|
39
|
-
from typing import TYPE_CHECKING, Iterable, Union, Optional as Nullable
|
|
39
|
+
from typing import TYPE_CHECKING, ClassVar, Iterable, Union, Optional as Nullable
|
|
40
40
|
|
|
41
41
|
from pyTooling.Decorators import export, readonly
|
|
42
42
|
from pyTooling.MetaClasses import abstractclass
|
|
43
43
|
|
|
44
|
-
from pyVHDLModel.Base import ModelEntity
|
|
44
|
+
from pyVHDLModel.Base import ModelEntity, ReservedWord
|
|
45
45
|
from pyVHDLModel.Name import Name
|
|
46
46
|
from pyVHDLModel.Symbol import Symbol, EntitySymbol, ArchitectureSymbol, ConfigurationSymbol, \
|
|
47
47
|
ComponentInstantiationSymbol
|
|
@@ -342,6 +342,9 @@ class ComponentConfiguration(ModelEntity):
|
|
|
342
342
|
-- Instantiation list
|
|
343
343
|
"""
|
|
344
344
|
|
|
345
|
+
_END_KEYWORDS: ClassVar[tuple[ReservedWord, ...]] = (ReservedWord.For,) #: Reserved words after ``end``.
|
|
346
|
+
_END_KEYWORDS_OPTIONAL: ClassVar[bool] = False #: The reserved words after ``end`` are optional.
|
|
347
|
+
|
|
345
348
|
_instantiationList: InstantiationListUnion #: The instances this configuration applies to.
|
|
346
349
|
_componentName: ComponentInstantiationSymbol #: Reference to the component being configured.
|
|
347
350
|
_bindingIndication: Nullable[BindingIndication] #: The binding indication, or ``None`` if none was given.
|
|
@@ -389,7 +392,7 @@ class ComponentConfiguration(ModelEntity):
|
|
|
389
392
|
if isinstance(self._instantiationList, list):
|
|
390
393
|
for index, label in enumerate(self._instantiationList):
|
|
391
394
|
if index > 0:
|
|
392
|
-
visitor.
|
|
395
|
+
visitor.VisitNameListSeparator(self)
|
|
393
396
|
|
|
394
397
|
label.Visit(visitor)
|
|
395
398
|
else:
|
|
@@ -400,6 +403,8 @@ class ComponentConfiguration(ModelEntity):
|
|
|
400
403
|
if self._bindingIndication is not None:
|
|
401
404
|
self._bindingIndication.Visit(visitor)
|
|
402
405
|
|
|
406
|
+
visitor.VisitEnd(self)
|
|
407
|
+
visitor.VisitTerminator(self)
|
|
403
408
|
visitor.DepartComponentConfiguration(self)
|
|
404
409
|
|
|
405
410
|
@readonly
|
|
@@ -446,6 +451,9 @@ class BlockConfiguration(ModelEntity):
|
|
|
446
451
|
end for;
|
|
447
452
|
"""
|
|
448
453
|
|
|
454
|
+
_END_KEYWORDS: ClassVar[tuple[ReservedWord, ...]] = (ReservedWord.For,) #: Reserved words after ``end``.
|
|
455
|
+
_END_KEYWORDS_OPTIONAL: ClassVar[bool] = False #: The reserved words after ``end`` are optional.
|
|
456
|
+
|
|
449
457
|
_blockSpecification: Symbol #: The configured block.
|
|
450
458
|
_items: list[Union[BlockConfiguration, ComponentConfiguration]] #: Nested configurations.
|
|
451
459
|
|
|
@@ -486,6 +494,8 @@ class BlockConfiguration(ModelEntity):
|
|
|
486
494
|
for item in self._items:
|
|
487
495
|
item.Visit(visitor)
|
|
488
496
|
|
|
497
|
+
visitor.VisitEnd(self)
|
|
498
|
+
visitor.VisitTerminator(self)
|
|
489
499
|
visitor.DepartBlockConfiguration(self)
|
|
490
500
|
|
|
491
501
|
@readonly
|
|
@@ -165,6 +165,7 @@ class Attribute(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
|
|
|
165
165
|
"""
|
|
166
166
|
visitor.VisitAttribute(self)
|
|
167
167
|
self._subtype.Visit(visitor)
|
|
168
|
+
visitor.VisitTerminator(self)
|
|
168
169
|
visitor.DepartAttribute(self)
|
|
169
170
|
|
|
170
171
|
@readonly
|
|
@@ -250,13 +251,14 @@ class AttributeSpecification(ModelEntity, DocumentedEntityMixin):
|
|
|
250
251
|
visitor.VisitEntitySpecification(self)
|
|
251
252
|
for index, name in enumerate(self._identifiers):
|
|
252
253
|
if index > 0:
|
|
253
|
-
visitor.
|
|
254
|
+
visitor.VisitNameListSeparator(self)
|
|
254
255
|
|
|
255
256
|
name.Visit(visitor)
|
|
256
257
|
|
|
257
258
|
visitor.DepartEntitySpecification(self)
|
|
258
259
|
visitor.VisitIs(self)
|
|
259
260
|
self._expression.Visit(visitor)
|
|
261
|
+
visitor.VisitTerminator(self)
|
|
260
262
|
visitor.DepartAttributeSpecification(self)
|
|
261
263
|
|
|
262
264
|
@readonly
|
|
@@ -368,6 +370,7 @@ class Alias(ModelEntity, NamedEntityMixin, DocumentedEntityMixin):
|
|
|
368
370
|
|
|
369
371
|
visitor.VisitIs(self)
|
|
370
372
|
self._name.Visit(visitor)
|
|
373
|
+
visitor.VisitTerminator(self)
|
|
371
374
|
visitor.DepartAlias(self)
|
|
372
375
|
|
|
373
376
|
@readonly
|