pyVHDLModel 0.43.0__tar.gz → 0.45.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.43.0 → pyvhdlmodel-0.45.0}/PKG-INFO +26 -26
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Association.py +12 -21
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Base.py +102 -14
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Common.py +2 -11
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Concurrent.py +8 -16
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Declaration.py +186 -48
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/DesignUnit.py +329 -44
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Exception.py +171 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Expression.py +25 -33
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Formatting/VHDL.py +138 -48
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedFloatTypesPkg.py +74 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedGenericPkg.py +632 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedPkg.py +97 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FloatGenericPkg.py +695 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FloatPkg.py +106 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/IeeeBitContext.py +66 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/IeeeStdContext.py +68 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/MathComplexPkg.py +306 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/MathRealPkg.py +177 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericBitPkg.py +434 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericBitUnsignedPkg.py +233 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericStdPkg.py +453 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericStdUnsignedPkg.py +245 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogic1164Pkg.py +435 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicArithPkg.py +418 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicMiscPkg.py +184 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicSignedPkg.py +148 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicTextIOPkg.py +191 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicUnsignedPkg.py +145 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALMemoryPkg.py +599 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALPrimitivesPkg.py +418 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALTimingPkg.py +508 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/__init__.py +257 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/Instantiation.py +878 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Interface.py +236 -45
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Name.py +492 -33
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Namespace.py +182 -18
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Object.py +105 -10
- pyvhdlmodel-0.45.0/pyVHDLModel/Predefined.py +458 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Regions.py +181 -35
- pyvhdlmodel-0.45.0/pyVHDLModel/STD/EnvPkg.py +406 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/STD/StandardPkg.py +630 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/STD/TextIOPkg.py +274 -0
- pyvhdlmodel-0.45.0/pyVHDLModel/STD/__init__.py +81 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Subprogram.py +481 -29
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Symbol.py +1011 -107
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Type.py +1272 -45
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Visitor.py +163 -33
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/__init__.py +575 -70
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/PKG-INFO +26 -26
- pyvhdlmodel-0.45.0/pyVHDLModel.egg-info/SOURCES.txt +62 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/requires.txt +25 -25
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyproject.toml +1 -1
- pyvhdlmodel-0.43.0/pyVHDLModel/IEEE.py +0 -767
- pyvhdlmodel-0.43.0/pyVHDLModel/Instantiation.py +0 -406
- pyvhdlmodel-0.43.0/pyVHDLModel/Predefined.py +0 -173
- pyvhdlmodel-0.43.0/pyVHDLModel/STD.py +0 -277
- pyvhdlmodel-0.43.0/pyVHDLModel.egg-info/SOURCES.txt +0 -37
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/LICENSE.md +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/README.md +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Configuration.py +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Formatting/__init__.py +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/PSLModel.py +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Sequential.py +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/py.typed +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/dependency_links.txt +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/top_level.txt +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.0}/setup.cfg +0 -0
- {pyvhdlmodel-0.43.0 → pyvhdlmodel-0.45.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.45.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.3.0
|
|
30
30
|
Provides-Extra: doc
|
|
31
|
-
Requires-Dist: pyTooling.
|
|
32
|
-
Requires-Dist:
|
|
31
|
+
Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "doc"
|
|
32
|
+
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
|
|
33
33
|
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
|
|
34
|
-
Requires-Dist: sphinx_design~=0.7.0; extra == "doc"
|
|
35
34
|
Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "doc"
|
|
38
|
-
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
|
|
39
|
-
Requires-Dist: pyTooling<11.0,>=10.2.0; extra == "doc"
|
|
35
|
+
Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "doc"
|
|
40
36
|
Requires-Dist: autoapi>=2.0.1; extra == "doc"
|
|
37
|
+
Requires-Dist: sphinx_design~=0.8.0; extra == "doc"
|
|
38
|
+
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "doc"
|
|
39
|
+
Requires-Dist: pyTooling.Sphinx[reports]~=1.1; extra == "doc"
|
|
40
|
+
Requires-Dist: sphinx~=9.2; extra == "doc"
|
|
41
41
|
Provides-Extra: test
|
|
42
|
-
Requires-Dist:
|
|
42
|
+
Requires-Dist: lxml<7.0,>=6.1.3; extra == "test"
|
|
43
|
+
Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "test"
|
|
44
|
+
Requires-Dist: pytest-xdist~=3.8; extra == "test"
|
|
43
45
|
Requires-Dist: typing_extensions~=4.16; extra == "test"
|
|
44
46
|
Requires-Dist: pytest-cov~=7.1; extra == "test"
|
|
45
|
-
Requires-Dist:
|
|
46
|
-
Requires-Dist: pytest-xdist~=3.8; extra == "test"
|
|
47
|
-
Requires-Dist: mypy[reports]~=2.4; extra == "test"
|
|
47
|
+
Requires-Dist: Coverage~=7.17; extra == "test"
|
|
48
48
|
Requires-Dist: pytest~=9.2; extra == "test"
|
|
49
|
-
Requires-Dist:
|
|
49
|
+
Requires-Dist: mypy[reports]~=2.4; extra == "test"
|
|
50
50
|
Provides-Extra: all
|
|
51
|
-
Requires-Dist:
|
|
51
|
+
Requires-Dist: lxml<7.0,>=6.1.3; extra == "all"
|
|
52
|
+
Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "all"
|
|
53
|
+
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
|
|
52
54
|
Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "all"
|
|
53
|
-
Requires-Dist:
|
|
55
|
+
Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
|
|
56
|
+
Requires-Dist: pyTooling.Sphinx[reports]~=1.1; extra == "all"
|
|
57
|
+
Requires-Dist: pytest-xdist~=3.8; extra == "all"
|
|
54
58
|
Requires-Dist: typing_extensions~=4.16; extra == "all"
|
|
55
|
-
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
56
59
|
Requires-Dist: pytest-cov~=7.1; extra == "all"
|
|
57
|
-
Requires-Dist:
|
|
58
|
-
Requires-Dist: sphinx~=9.2; extra == "all"
|
|
59
|
-
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
|
|
60
|
-
Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
|
|
60
|
+
Requires-Dist: Coverage~=7.17; extra == "all"
|
|
61
61
|
Requires-Dist: autoapi>=2.0.1; extra == "all"
|
|
62
|
-
Requires-Dist:
|
|
63
|
-
Requires-Dist:
|
|
64
|
-
Requires-Dist: mypy[reports]~=2.4; extra == "all"
|
|
62
|
+
Requires-Dist: sphinx_design~=0.8.0; extra == "all"
|
|
63
|
+
Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
|
|
65
64
|
Requires-Dist: pytest~=9.2; extra == "all"
|
|
66
|
-
Requires-Dist:
|
|
67
|
-
Requires-Dist:
|
|
65
|
+
Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
|
|
66
|
+
Requires-Dist: mypy[reports]~=2.4; extra == "all"
|
|
67
|
+
Requires-Dist: sphinx~=9.2; extra == "all"
|
|
68
68
|
Dynamic: author
|
|
69
69
|
Dynamic: author-email
|
|
70
70
|
Dynamic: classifier
|
|
@@ -34,32 +34,23 @@ This module contains parts of an abstract document language model for VHDL.
|
|
|
34
34
|
|
|
35
35
|
Associations are used in generic maps, port maps and parameter maps.
|
|
36
36
|
"""
|
|
37
|
-
from __future__
|
|
37
|
+
from __future__ import annotations
|
|
38
38
|
|
|
39
|
-
from typing
|
|
39
|
+
from typing import TYPE_CHECKING, Iterable, Optional as Nullable, Self
|
|
40
40
|
|
|
41
|
-
from pyTooling.Common
|
|
42
|
-
from pyTooling.Decorators
|
|
43
|
-
from pyTooling.MetaClasses
|
|
41
|
+
from pyTooling.Common import getFullyQualifiedName, getTypeName
|
|
42
|
+
from pyTooling.Decorators import export, readonly
|
|
43
|
+
from pyTooling.MetaClasses import ExtendedType, abstractclass
|
|
44
44
|
|
|
45
|
-
from pyVHDLModel.Base
|
|
46
|
-
from pyVHDLModel.Exception
|
|
47
|
-
|
|
48
|
-
from pyVHDLModel.Name
|
|
49
|
-
from pyVHDLModel.Symbol
|
|
50
|
-
from pyVHDLModel.Expression import BaseExpression, QualifiedExpression, FunctionCall, TypeConversion, Literal
|
|
45
|
+
from pyVHDLModel.Base import ExpressionUnion, ModelEntity
|
|
46
|
+
from pyVHDLModel.Exception import AlreadyInDesignError, NotAChildError, AssociationOrderError, \
|
|
47
|
+
DuplicateGenericAssociationError, DuplicatePortAssociationError
|
|
48
|
+
from pyVHDLModel.Name import Name, SimpleName
|
|
49
|
+
from pyVHDLModel.Symbol import Symbol
|
|
51
50
|
if TYPE_CHECKING:
|
|
52
|
-
from pyVHDLModel.Visitor
|
|
51
|
+
from pyVHDLModel.Visitor import Visitor
|
|
53
52
|
|
|
54
53
|
|
|
55
|
-
ExpressionUnion = Union[
|
|
56
|
-
BaseExpression,
|
|
57
|
-
QualifiedExpression,
|
|
58
|
-
FunctionCall,
|
|
59
|
-
TypeConversion,
|
|
60
|
-
# ConstantOrSymbol, TODO: ObjectSymbol
|
|
61
|
-
Literal,
|
|
62
|
-
]
|
|
63
54
|
|
|
64
55
|
|
|
65
56
|
@export
|
|
@@ -125,7 +116,7 @@ class AssociationItem(ModelEntity):
|
|
|
125
116
|
"""
|
|
126
117
|
formal = None if self._formal is None else self._formal.Copy()
|
|
127
118
|
actual = None if self._actual is None else self._actual.Copy()
|
|
128
|
-
return self.
|
|
119
|
+
return self._ModelClass()(formal, actual)
|
|
129
120
|
|
|
130
121
|
def Visit(self, visitor: Visitor) -> None:
|
|
131
122
|
"""
|
|
@@ -45,12 +45,13 @@ from pyTooling.Decorators import export, notimplemented, readonly
|
|
|
45
45
|
from pyTooling.MetaClasses import ExtendedType, abstractclass
|
|
46
46
|
from pyTooling.Warning import WarningCollector
|
|
47
47
|
if TYPE_CHECKING:
|
|
48
|
-
from pyVHDLModel.DesignUnit
|
|
49
|
-
from pyVHDLModel.
|
|
50
|
-
from pyVHDLModel.
|
|
51
|
-
from pyVHDLModel.
|
|
52
|
-
from pyVHDLModel.
|
|
53
|
-
from pyVHDLModel.
|
|
48
|
+
from pyVHDLModel.DesignUnit import DesignUnit
|
|
49
|
+
from pyVHDLModel.Instantiation import PackageInstantiation
|
|
50
|
+
from pyVHDLModel.Interface import SingleDeclarationMixin
|
|
51
|
+
from pyVHDLModel.Name import Name
|
|
52
|
+
from pyVHDLModel.Regions import DeclarativeRegionMixin
|
|
53
|
+
from pyVHDLModel.Symbol import Symbol, SubtypeSymbol
|
|
54
|
+
from pyVHDLModel.Visitor import Visitor
|
|
54
55
|
|
|
55
56
|
|
|
56
57
|
__all__ = ["ExpressionUnion"]
|
|
@@ -61,9 +62,14 @@ ExpressionUnion = Union[
|
|
|
61
62
|
'QualifiedExpression',
|
|
62
63
|
'FunctionCall',
|
|
63
64
|
'TypeConversion',
|
|
64
|
-
# ConstantOrSymbol, TODO: ObjectSymbol
|
|
65
65
|
'Literal',
|
|
66
|
+
'Symbol',
|
|
66
67
|
]
|
|
68
|
+
"""
|
|
69
|
+
An expression in the model: an operation, a qualified expression, a function call, a type conversion, a literal, or a
|
|
70
|
+
name in an expression, which is a symbol (e.g. :class:`~pyVHDLModel.Symbol.SimpleObjectOrFunctionCallSymbol` for
|
|
71
|
+
``read_mode``, :class:`~pyVHDLModel.Symbol.IndexedObjectOrFunctionCallSymbol` for ``TIME'HIGH``).
|
|
72
|
+
"""
|
|
67
73
|
|
|
68
74
|
|
|
69
75
|
@export
|
|
@@ -286,7 +292,9 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
286
292
|
available and a readonly property :attr:`Parent`.
|
|
287
293
|
"""
|
|
288
294
|
|
|
289
|
-
|
|
295
|
+
_modelClasses: ClassVar[dict[type, type]] = {} #: The pyVHDLModel class ``Copy()`` creates, indexed by class.
|
|
296
|
+
|
|
297
|
+
_parent: ModelEntity #: Reference to a parent entity in the logical model hierarchy.
|
|
290
298
|
|
|
291
299
|
def __init__(self, parent: Nullable[ModelEntity] = None) -> None:
|
|
292
300
|
"""
|
|
@@ -312,6 +320,25 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
312
320
|
|
|
313
321
|
self._parent = parent
|
|
314
322
|
|
|
323
|
+
def _ModelClass(self) -> type[Self]:
|
|
324
|
+
"""
|
|
325
|
+
Return the pyVHDLModel class, from which ``Copy()`` creates a copy of this entity.
|
|
326
|
+
|
|
327
|
+
It is the nearest class in the method resolution order, which a module of pyVHDLModel declares. A derived class of
|
|
328
|
+
another package, e.g. of ``pyGHDL.dom``, is skipped: its copy is an object of the pyVHDLModel class.
|
|
329
|
+
|
|
330
|
+
:returns: The pyVHDLModel class.
|
|
331
|
+
"""
|
|
332
|
+
cls = self.__class__
|
|
333
|
+
if (modelClass := ModelEntity._modelClasses.get(cls)) is None:
|
|
334
|
+
for modelClass in cls.__mro__:
|
|
335
|
+
if modelClass.__module__.partition(".")[0] == "pyVHDLModel":
|
|
336
|
+
break
|
|
337
|
+
|
|
338
|
+
ModelEntity._modelClasses[cls] = modelClass
|
|
339
|
+
|
|
340
|
+
return modelClass
|
|
341
|
+
|
|
315
342
|
def GetAncestor(self, type: Type) -> ModelEntity:
|
|
316
343
|
"""
|
|
317
344
|
Return the closest ancestor of the given ``type`` found by walking the parent chain upwards.
|
|
@@ -355,13 +382,15 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
355
382
|
"""
|
|
356
383
|
return False
|
|
357
384
|
|
|
358
|
-
def IterateImplicitDeclarations(self) -> Generator[
|
|
385
|
+
def IterateImplicitDeclarations(self) -> Generator[ModelEntity, None, None]:
|
|
359
386
|
"""
|
|
360
387
|
Iterate the declarations this declaration implies.
|
|
361
388
|
|
|
362
|
-
|
|
389
|
+
A full type implies its implicit operations, an enumerated type also its enumeration literals, a physical type
|
|
390
|
+
its units, a scalar type since VHDL-2019 its range record; they override this method. Each implied declaration
|
|
391
|
+
provides the key it's indexed by in a namespace as ``NormalizedDesignator``.
|
|
363
392
|
|
|
364
|
-
:returns: A generator to iterate
|
|
393
|
+
:returns: A generator to iterate the implied declarations, in declaration order: none.
|
|
365
394
|
"""
|
|
366
395
|
yield from ()
|
|
367
396
|
|
|
@@ -399,7 +428,9 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
399
428
|
|
|
400
429
|
def ResetReferences(self, designUnit: DesignUnit, region: DeclarativeRegionMixin) -> None:
|
|
401
430
|
"""
|
|
402
|
-
Reset the references :meth:`ResolveReferences` derived: the references of this declaration's type marks
|
|
431
|
+
Reset the references :meth:`ResolveReferences` derived: the references of this declaration's type marks, the kinds
|
|
432
|
+
of their attribute names (:meth:`Name.ResetKinds <pyVHDLModel.Name.Name.ResetKinds>`), and the references of their
|
|
433
|
+
resolution indications (:meth:`~pyVHDLModel.Design.ResolveResolutionFunctions`).
|
|
403
434
|
|
|
404
435
|
A use clause, an alias and a subtype extend this method.
|
|
405
436
|
|
|
@@ -408,6 +439,27 @@ class ModelEntity(metaclass=ExtendedType, slots=True):
|
|
|
408
439
|
"""
|
|
409
440
|
for _, _, typeMark in self.IterateTypeMarks(region):
|
|
410
441
|
typeMark._reference = None
|
|
442
|
+
typeMark._name.ResetKinds()
|
|
443
|
+
typeMark.ResetResolutionFunctions()
|
|
444
|
+
|
|
445
|
+
def MapReferences(self, original: ModelEntity, instance: PackageInstantiation) -> None:
|
|
446
|
+
"""
|
|
447
|
+
Set the references of this copy of a declaration to what the references of its original denote in a package
|
|
448
|
+
instantiation (:meth:`PackageInstantiation.MapToInstance
|
|
449
|
+
<pyVHDLModel.Instantiation.PackageInstantiation.MapToInstance>`).
|
|
450
|
+
|
|
451
|
+
The type marks of the copy (:meth:`IterateTypeMarks`) correspond in order to the type marks of the original. An
|
|
452
|
+
alias, a subtype and a subprogram extend this method.
|
|
453
|
+
|
|
454
|
+
:param original: The declaration this declaration is a copy of, e.g. :attr:`CopyMixin.Original`.
|
|
455
|
+
:param instance: The package instantiation owning the copy.
|
|
456
|
+
"""
|
|
457
|
+
typeMarks = zip(original.IterateTypeMarks(original._parent), self.IterateTypeMarks(self._parent))
|
|
458
|
+
for (_, _, originalTypeMark), (_, _, typeMark) in typeMarks:
|
|
459
|
+
if (reference := originalTypeMark._reference) is None:
|
|
460
|
+
typeMark._reference = None
|
|
461
|
+
else:
|
|
462
|
+
typeMark._reference = instance.MapToInstance(reference)
|
|
411
463
|
|
|
412
464
|
def DenoteBy(
|
|
413
465
|
self,
|
|
@@ -853,6 +905,42 @@ class DocumentedEntityMixin(metaclass=ExtendedType, mixin=True):
|
|
|
853
905
|
return self._documentation
|
|
854
906
|
|
|
855
907
|
|
|
908
|
+
@export
|
|
909
|
+
class CopyMixin(metaclass=ExtendedType, mixin=True):
|
|
910
|
+
"""
|
|
911
|
+
A ``CopyMixin`` is a mixin class for all declarations a package instantiation can copy: a copy points to its
|
|
912
|
+
original.
|
|
913
|
+
|
|
914
|
+
A package instantiation copies the generics and the declarations depending on a generic
|
|
915
|
+
(:meth:`PackageInstantiation.Instantiate <pyVHDLModel.Instantiation.PackageInstantiation.Instantiate>`). A protected
|
|
916
|
+
variable :attr:`_original` is available to derived classes as well as a readonly property :attr:`Original` for
|
|
917
|
+
public access.
|
|
918
|
+
|
|
919
|
+
.. seealso::
|
|
920
|
+
|
|
921
|
+
* :class:`Object <pyVHDLModel.Object.Obj>`
|
|
922
|
+
* :class:`Subprogram <pyVHDLModel.Subprogram.Subprogram>`
|
|
923
|
+
"""
|
|
924
|
+
|
|
925
|
+
_original: Nullable[ModelEntity] #: The declaration this declaration is a copy of, or ``None``.
|
|
926
|
+
|
|
927
|
+
def __init__(self) -> None:
|
|
928
|
+
"""
|
|
929
|
+
Initializes a declaration, which isn't a copy.
|
|
930
|
+
"""
|
|
931
|
+
self._original = None
|
|
932
|
+
|
|
933
|
+
@readonly
|
|
934
|
+
def Original(self) -> Nullable[ModelEntity]:
|
|
935
|
+
"""
|
|
936
|
+
Read-only property to access the original (:attr:`_original`): the declaration of an uninstantiated package, which
|
|
937
|
+
this declaration is a copy of in a package instantiation.
|
|
938
|
+
|
|
939
|
+
:returns: The original declaration, or ``None`` if this declaration isn't a copy of a package instantiation.
|
|
940
|
+
"""
|
|
941
|
+
return self._original
|
|
942
|
+
|
|
943
|
+
|
|
856
944
|
@export
|
|
857
945
|
class ConditionalMixin(metaclass=ExtendedType, mixin=True):
|
|
858
946
|
"""
|
|
@@ -1225,7 +1313,7 @@ class SimpleRange(Range):
|
|
|
1225
1313
|
|
|
1226
1314
|
:returns: The new simple range.
|
|
1227
1315
|
"""
|
|
1228
|
-
return self.
|
|
1316
|
+
return self._ModelClass()(self._leftBound.Copy(), self._rightBound.Copy(), self._direction)
|
|
1229
1317
|
|
|
1230
1318
|
def Visit(self, visitor: Visitor) -> None:
|
|
1231
1319
|
"""
|
|
@@ -1302,7 +1390,7 @@ class RangeFromName(Range):
|
|
|
1302
1390
|
|
|
1303
1391
|
:returns: The new range denoted by a name.
|
|
1304
1392
|
"""
|
|
1305
|
-
return self.
|
|
1393
|
+
return self._ModelClass()(self._symbol.Copy())
|
|
1306
1394
|
|
|
1307
1395
|
def Visit(self, visitor: Visitor) -> None:
|
|
1308
1396
|
"""
|
|
@@ -42,11 +42,10 @@ from pyTooling.Common import getFullyQualifiedName, getTypeName
|
|
|
42
42
|
from pyTooling.Decorators import export, readonly
|
|
43
43
|
from pyTooling.MetaClasses import ExtendedType, abstractclass
|
|
44
44
|
|
|
45
|
-
from pyVHDLModel.Base import ModelEntity, LabeledEntityMixin, DocumentedEntityMixin, BaseCase,
|
|
46
|
-
WaveformElement, ConditionalMixin, ChoicesMixin
|
|
45
|
+
from pyVHDLModel.Base import ExpressionUnion, ModelEntity, LabeledEntityMixin, DocumentedEntityMixin, BaseCase, \
|
|
46
|
+
BaseChoice, WaveformElement, ConditionalMixin, ChoicesMixin
|
|
47
47
|
from pyVHDLModel.Exception import AlreadyInDesignError, NotAChildError, AssociationOrderError, \
|
|
48
48
|
DuplicateParameterAssociationError
|
|
49
|
-
from pyVHDLModel.Expression import BaseExpression, QualifiedExpression, FunctionCall, TypeConversion, Literal
|
|
50
49
|
from pyVHDLModel.Name import SimpleName
|
|
51
50
|
from pyVHDLModel.Symbol import Symbol, SignalSymbol, VariableSymbol
|
|
52
51
|
from pyVHDLModel.Association import ParameterAssociationItem
|
|
@@ -55,14 +54,6 @@ if TYPE_CHECKING:
|
|
|
55
54
|
from pyVHDLModel.Visitor import Visitor
|
|
56
55
|
|
|
57
56
|
|
|
58
|
-
ExpressionUnion = Union[
|
|
59
|
-
BaseExpression,
|
|
60
|
-
QualifiedExpression,
|
|
61
|
-
FunctionCall,
|
|
62
|
-
TypeConversion,
|
|
63
|
-
# ConstantOrSymbol, TODO: ObjectSymbol
|
|
64
|
-
Literal,
|
|
65
|
-
]
|
|
66
57
|
|
|
67
58
|
|
|
68
59
|
@export
|
|
@@ -42,16 +42,16 @@ from pyTooling.Common import getFullyQualifiedName, getTypeName
|
|
|
42
42
|
from pyTooling.Decorators import export, readonly
|
|
43
43
|
from pyTooling.MetaClasses import ExtendedType, abstractclass, mustoverride
|
|
44
44
|
|
|
45
|
-
from pyVHDLModel.Base import ModelEntity, LabeledEntityMixin, DocumentedEntityMixin, Range,
|
|
46
|
-
BaseCase, IfBranchMixin, ElsifBranchMixin, ElseBranchMixin,
|
|
47
|
-
BlockStatementMixin, WaveformElement, ChoicesMixin,
|
|
45
|
+
from pyVHDLModel.Base import ExpressionUnion, ModelEntity, LabeledEntityMixin, DocumentedEntityMixin, Range, \
|
|
46
|
+
BaseChoice, BaseCase, IfBranchMixin, ElsifBranchMixin, ElseBranchMixin, \
|
|
47
|
+
AssertStatementMixin, BlockStatementMixin, WaveformElement, ChoicesMixin, \
|
|
48
|
+
ReservedWord
|
|
48
49
|
from pyVHDLModel.Exception import AlreadyInDesignError, DuplicateLabelError, NotAChildError
|
|
49
50
|
from pyVHDLModel.Regions import ConcurrentDeclarationRegionMixin, DeclarativeRegionMixin, \
|
|
50
51
|
SequentialDeclarationRegionMixin, WithGenericsMixin, WithPortsMixin
|
|
51
52
|
from pyVHDLModel.Name import Name
|
|
52
53
|
from pyVHDLModel.Symbol import ComponentInstantiationSymbol, EntityInstantiationSymbol, ArchitectureSymbol, \
|
|
53
54
|
ConfigurationInstantiationSymbol, Symbol, SignalSymbol
|
|
54
|
-
from pyVHDLModel.Expression import BaseExpression, QualifiedExpression, FunctionCall, TypeConversion, Literal
|
|
55
55
|
from pyVHDLModel.Association import ParameterAssociationItem, GenericAssociationItem, PortAssociationItem, \
|
|
56
56
|
GenericMapAspectMixin, PortMapAspectMixin
|
|
57
57
|
from pyVHDLModel.Interface import PortInterfaceItemMixin, GenericInterfaceItemMixin, GenericGroup, PortGroup
|
|
@@ -64,14 +64,6 @@ if TYPE_CHECKING:
|
|
|
64
64
|
from pyVHDLModel.Visitor import Visitor
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
ExpressionUnion = Union[
|
|
68
|
-
BaseExpression,
|
|
69
|
-
QualifiedExpression,
|
|
70
|
-
FunctionCall,
|
|
71
|
-
TypeConversion,
|
|
72
|
-
# ConstantOrSymbol, TODO: ObjectSymbol
|
|
73
|
-
Literal,
|
|
74
|
-
]
|
|
75
67
|
|
|
76
68
|
|
|
77
69
|
@export
|
|
@@ -1217,13 +1209,13 @@ class ConcurrentBlockStatement(
|
|
|
1217
1209
|
|
|
1218
1210
|
super().IndexDeclaredItems()
|
|
1219
1211
|
|
|
1220
|
-
def
|
|
1212
|
+
def _InterfaceDeclarations(self) -> tuple[ModelEntity, ...]:
|
|
1221
1213
|
"""
|
|
1222
|
-
Return
|
|
1214
|
+
Return the interface items of this block: its generics and ports share the declarative region.
|
|
1223
1215
|
|
|
1224
|
-
:returns: Tuple of
|
|
1216
|
+
:returns: Tuple of the generics, then the ports.
|
|
1225
1217
|
"""
|
|
1226
|
-
return (*self._genericItems, *self._portItems
|
|
1218
|
+
return (*self._genericItems, *self._portItems)
|
|
1227
1219
|
|
|
1228
1220
|
|
|
1229
1221
|
@export
|