pyVHDLModel 0.44.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.
Files changed (69) hide show
  1. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/PKG-INFO +23 -23
  2. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Association.py +12 -21
  3. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Base.py +102 -14
  4. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Common.py +2 -11
  5. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Concurrent.py +8 -16
  6. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Declaration.py +186 -48
  7. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/DesignUnit.py +329 -44
  8. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Exception.py +171 -0
  9. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Expression.py +25 -33
  10. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Formatting/VHDL.py +128 -39
  11. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedFloatTypesPkg.py +74 -0
  12. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedGenericPkg.py +632 -0
  13. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FixedPkg.py +97 -0
  14. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FloatGenericPkg.py +695 -0
  15. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/FloatPkg.py +106 -0
  16. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/IeeeBitContext.py +66 -0
  17. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/IeeeStdContext.py +68 -0
  18. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/MathComplexPkg.py +306 -0
  19. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/MathRealPkg.py +177 -0
  20. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericBitPkg.py +434 -0
  21. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericBitUnsignedPkg.py +233 -0
  22. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericStdPkg.py +453 -0
  23. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/NumericStdUnsignedPkg.py +245 -0
  24. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogic1164Pkg.py +435 -0
  25. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicArithPkg.py +418 -0
  26. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicMiscPkg.py +184 -0
  27. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicSignedPkg.py +148 -0
  28. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicTextIOPkg.py +191 -0
  29. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/StdLogicUnsignedPkg.py +145 -0
  30. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALMemoryPkg.py +599 -0
  31. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALPrimitivesPkg.py +418 -0
  32. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/VITALTimingPkg.py +508 -0
  33. pyvhdlmodel-0.45.0/pyVHDLModel/IEEE/__init__.py +257 -0
  34. pyvhdlmodel-0.45.0/pyVHDLModel/Instantiation.py +878 -0
  35. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Interface.py +236 -45
  36. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Name.py +492 -33
  37. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Namespace.py +182 -18
  38. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Object.py +105 -10
  39. pyvhdlmodel-0.45.0/pyVHDLModel/Predefined.py +458 -0
  40. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Regions.py +181 -35
  41. pyvhdlmodel-0.45.0/pyVHDLModel/STD/EnvPkg.py +406 -0
  42. pyvhdlmodel-0.45.0/pyVHDLModel/STD/StandardPkg.py +630 -0
  43. pyvhdlmodel-0.45.0/pyVHDLModel/STD/TextIOPkg.py +274 -0
  44. pyvhdlmodel-0.45.0/pyVHDLModel/STD/__init__.py +81 -0
  45. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Subprogram.py +481 -29
  46. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Symbol.py +814 -75
  47. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Type.py +1272 -45
  48. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Visitor.py +123 -24
  49. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/__init__.py +575 -70
  50. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/PKG-INFO +23 -23
  51. pyvhdlmodel-0.45.0/pyVHDLModel.egg-info/SOURCES.txt +62 -0
  52. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/requires.txt +22 -22
  53. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyproject.toml +1 -1
  54. pyvhdlmodel-0.44.0/pyVHDLModel/IEEE.py +0 -767
  55. pyvhdlmodel-0.44.0/pyVHDLModel/Instantiation.py +0 -406
  56. pyvhdlmodel-0.44.0/pyVHDLModel/Predefined.py +0 -173
  57. pyvhdlmodel-0.44.0/pyVHDLModel/STD.py +0 -277
  58. pyvhdlmodel-0.44.0/pyVHDLModel.egg-info/SOURCES.txt +0 -37
  59. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/LICENSE.md +0 -0
  60. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/README.md +0 -0
  61. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Configuration.py +0 -0
  62. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Formatting/__init__.py +0 -0
  63. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/PSLModel.py +0 -0
  64. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/Sequential.py +0 -0
  65. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel/py.typed +0 -0
  66. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/dependency_links.txt +0 -0
  67. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/pyVHDLModel.egg-info/top_level.txt +0 -0
  68. {pyvhdlmodel-0.44.0 → pyvhdlmodel-0.45.0}/setup.cfg +0 -0
  69. {pyvhdlmodel-0.44.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.44.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.2.0
29
+ Requires-Dist: pyTooling<11.0,>=10.3.0
30
30
  Provides-Extra: doc
31
- Requires-Dist: pyTooling<11.0,>=10.2.0; extra == "doc"
31
+ Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "doc"
32
32
  Requires-Dist: sphinx_rtd_theme~=3.1; extra == "doc"
33
- Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
34
- Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "doc"
35
33
  Requires-Dist: sphinx-copybutton>=0.5.2; extra == "doc"
34
+ Requires-Dist: docutils_stubs~=0.0.22; extra == "doc"
36
35
  Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "doc"
37
- Requires-Dist: sphinx_design~=0.7.0; extra == "doc"
38
- Requires-Dist: pyTooling.Sphinx[reports]~=1.0; extra == "doc"
39
- Requires-Dist: sphinx~=9.2; 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: typing_extensions~=4.16; extra == "test"
43
- Requires-Dist: pyTooling<11.0,>=10.2.0; extra == "test"
42
+ Requires-Dist: lxml<7.0,>=6.1.3; extra == "test"
43
+ Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "test"
44
44
  Requires-Dist: pytest-xdist~=3.8; extra == "test"
45
+ Requires-Dist: typing_extensions~=4.16; extra == "test"
45
46
  Requires-Dist: pytest-cov~=7.1; extra == "test"
46
- Requires-Dist: pytest~=9.2; extra == "test"
47
47
  Requires-Dist: Coverage~=7.17; extra == "test"
48
- Requires-Dist: lxml<7.0,>=6.1.3; extra == "test"
48
+ Requires-Dist: pytest~=9.2; extra == "test"
49
49
  Requires-Dist: mypy[reports]~=2.4; extra == "test"
50
50
  Provides-Extra: all
51
- Requires-Dist: typing_extensions~=4.16; extra == "all"
52
- Requires-Dist: pyTooling<11.0,>=10.2.0; extra == "all"
53
- Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
51
+ Requires-Dist: lxml<7.0,>=6.1.3; extra == "all"
52
+ Requires-Dist: pyTooling<11.0,>=10.3.0; extra == "all"
54
53
  Requires-Dist: sphinx_rtd_theme~=3.1; extra == "all"
55
- Requires-Dist: sphinx-copybutton>=0.5.2; extra == "all"
56
- Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
57
54
  Requires-Dist: sphinx_autodoc_typehints~=3.17; extra == "all"
55
+ Requires-Dist: docutils_stubs~=0.0.22; extra == "all"
56
+ Requires-Dist: pyTooling.Sphinx[reports]~=1.1; extra == "all"
58
57
  Requires-Dist: pytest-xdist~=3.8; extra == "all"
58
+ Requires-Dist: typing_extensions~=4.16; extra == "all"
59
59
  Requires-Dist: pytest-cov~=7.1; extra == "all"
60
- Requires-Dist: sphinx_design~=0.7.0; extra == "all"
61
- Requires-Dist: pytest~=9.2; extra == "all"
62
60
  Requires-Dist: Coverage~=7.17; extra == "all"
63
- Requires-Dist: pyTooling.Sphinx[reports]~=1.0; extra == "all"
64
- Requires-Dist: lxml<7.0,>=6.1.3; extra == "all"
65
- Requires-Dist: sphinx~=9.2; extra == "all"
66
- Requires-Dist: mypy[reports]~=2.4; extra == "all"
67
61
  Requires-Dist: autoapi>=2.0.1; extra == "all"
62
+ Requires-Dist: sphinx_design~=0.8.0; extra == "all"
63
+ Requires-Dist: sphinxcontrib-mermaid~=2.1; extra == "all"
64
+ Requires-Dist: pytest~=9.2; extra == "all"
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__ import annotations
37
+ from __future__ import annotations
38
38
 
39
- from typing import TYPE_CHECKING, Iterable, Optional as Nullable, Union, Self
39
+ from typing import TYPE_CHECKING, Iterable, Optional as Nullable, Self
40
40
 
41
- from pyTooling.Common import getFullyQualifiedName, getTypeName
42
- from pyTooling.Decorators import export, readonly
43
- from pyTooling.MetaClasses import ExtendedType, abstractclass
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 import 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
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 import 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.__class__(formal, actual)
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 import DesignUnit
49
- from pyVHDLModel.Interface import SingleDeclarationMixin
50
- from pyVHDLModel.Name import Name
51
- from pyVHDLModel.Regions import DeclarativeRegionMixin
52
- from pyVHDLModel.Symbol import Symbol, SubtypeSymbol
53
- from pyVHDLModel.Visitor import Visitor
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
- _parent: ModelEntity #: Reference to a parent entity in the logical model hierarchy.
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[tuple[str, ModelEntity], None, None]:
385
+ def IterateImplicitDeclarations(self) -> Generator[ModelEntity, None, None]:
359
386
  """
360
387
  Iterate the declarations this declaration implies.
361
388
 
362
- An enumerated type implies its enumeration literals, a physical type its units; they override this method.
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 (normalized designator, declaration) pairs, in declaration order: none.
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.__class__(self._leftBound.Copy(), self._rightBound.Copy(), self._direction)
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.__class__(self._symbol.Copy())
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, BaseChoice, \
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, BaseChoice, \
46
- BaseCase, IfBranchMixin, ElsifBranchMixin, ElseBranchMixin, AssertStatementMixin, \
47
- BlockStatementMixin, WaveformElement, ChoicesMixin, ReservedWord
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 _Declarations(self) -> tuple[ModelEntity, ...]:
1212
+ def _InterfaceDeclarations(self) -> tuple[ModelEntity, ...]:
1221
1213
  """
1222
- Return all declarations of this block: its generics and ports share the declarative region.
1214
+ Return the interface items of this block: its generics and ports share the declarative region.
1223
1215
 
1224
- :returns: Tuple of declarations: the generics, the ports, then the declared items.
1216
+ :returns: Tuple of the generics, then the ports.
1225
1217
  """
1226
- return (*self._genericItems, *self._portItems, *super()._Declarations())
1218
+ return (*self._genericItems, *self._portItems)
1227
1219
 
1228
1220
 
1229
1221
  @export