diff --git a/pyVHDLModel/Namespace.py b/pyVHDLModel/Namespace.py index ec78a52eb..263bfaad9 100644 --- a/pyVHDLModel/Namespace.py +++ b/pyVHDLModel/Namespace.py @@ -78,7 +78,7 @@ def FindComponent(self, componentSymbol: ComponentInstantiationSymbol): from pyVHDLModel.DesignUnit import Component try: - element = self._elements[componentSymbol.NormalizedIdentifier] + element = self._elements[componentSymbol.Name.NormalizedIdentifier] if isinstance(element, Component): return element else: diff --git a/pyVHDLModel/STD.py b/pyVHDLModel/STD.py index de72ed9a8..6b48af1d5 100644 --- a/pyVHDLModel/STD.py +++ b/pyVHDLModel/STD.py @@ -36,7 +36,7 @@ from pyVHDLModel import Library from pyVHDLModel.Name import SimpleName, SelectedName, AllName -from pyVHDLModel.Symbol import LibraryReferenceSymbol, PackageMembersReferenceSymbol, AllPackageMembersReferenceSymbol, PackageSymbol +from pyVHDLModel.Symbol import LibraryReferenceSymbol, PackageMemberReferenceSymbol, AllPackageMembersReferenceSymbol, PackageSymbol from pyVHDLModel.DesignUnit import LibraryClause, UseClause, Package, PackageBody @@ -77,7 +77,7 @@ def _AddPackageClause(self, packages: Iterable[str]): if members.lower() == "all": symbols.append(AllPackageMembersReferenceSymbol(AllName(packageName))) else: - symbols.append(PackageMembersReferenceSymbol(SelectedName(members, packageName))) + symbols.append(PackageMemberReferenceSymbol(SelectedName(members, packageName))) useClause = UseClause(symbols) self._contextItems.append(useClause) diff --git a/pyVHDLModel/Symbol.py b/pyVHDLModel/Symbol.py index 30912162d..b8667a720 100644 --- a/pyVHDLModel/Symbol.py +++ b/pyVHDLModel/Symbol.py @@ -162,7 +162,7 @@ def Package(self, value: 'Package') -> None: @export -class PackageMembersReferenceSymbol(Symbol): +class PackageMemberReferenceSymbol(Symbol): """A package member reference in a use clause.""" def __init__(self, name: Name): @@ -181,7 +181,7 @@ def Member(self, value: 'Package') -> None: # TODO: typehint class AllPackageMembersReferenceSymbol(Symbol): """A package reference in a use clause.""" - def __init__(self, name: Name): + def __init__(self, name: AllName): super().__init__(name, PossibleReference.PackageMember) @property diff --git a/pyVHDLModel/__init__.py b/pyVHDLModel/__init__.py index d56dabdc1..613b84f7b 100644 --- a/pyVHDLModel/__init__.py +++ b/pyVHDLModel/__init__.py @@ -48,7 +48,7 @@ __email__ = "Paebbels@gmail.com" __copyright__ = "2016-2023, Patrick Lehmann" __license__ = "Apache License, Version 2.0" -__version__ = "0.25.0" +__version__ = "0.25.1" from enum import unique, Enum, Flag, auto @@ -64,7 +64,7 @@ from pyVHDLModel.Exception import ArchitectureExistsInLibraryError, PackageExistsInLibraryError, PackageBodyExistsError, ConfigurationExistsInLibraryError from pyVHDLModel.Exception import ContextExistsInLibraryError, ReferencedLibraryNotExistingError from pyVHDLModel.Base import ModelEntity, NamedEntityMixin, DocumentedEntityMixin -from pyVHDLModel.Symbol import AllPackageMembersReferenceSymbol, PackageMembersReferenceSymbol +from pyVHDLModel.Symbol import AllPackageMembersReferenceSymbol, PackageMemberReferenceSymbol from pyVHDLModel.Concurrent import EntityInstantiation, ComponentInstantiation, ConfigurationInstantiation from pyVHDLModel.DesignUnit import DesignUnit, PrimaryUnit, Architecture, PackageBody, Context, Entity, Configuration, Package from pyVHDLModel.PSLModel import VerificationUnit, VerificationProperty, VerificationMode @@ -704,7 +704,7 @@ def LinkContexts(self) -> None: if isinstance(symbol, AllPackageMembersReferenceSymbol): pass - elif isinstance(symbol, PackageMembersReferenceSymbol): + elif isinstance(symbol, PackageMemberReferenceSymbol): raise NotImplementedError() else: raise VHDLModelException() @@ -848,7 +848,7 @@ def LinkPackageReferences(self) -> None: for componentIdentifier, component in package._components.items(): designUnit._namespace._elements[componentIdentifier] = component - elif isinstance(packageMemeberSymbol, PackageMembersReferenceSymbol): + elif isinstance(packageMemeberSymbol, PackageMemberReferenceSymbol): raise NotImplementedError() else: raise VHDLModelException() diff --git a/tests/unit/Analyze.py b/tests/unit/Analyze.py index 06d9e55cd..9ade0cdfc 100644 --- a/tests/unit/Analyze.py +++ b/tests/unit/Analyze.py @@ -69,7 +69,7 @@ def CreateDesign(self) -> Design: entityAReferences = [ # UseClause([ - # PackageMembersReferenceSymbol("Stop", PackageReferenceSymbol("env", LibraryReferenceSymbol("std"))), + # PackageMemberReferenceSymbol("Stop", PackageReferenceSymbol("env", LibraryReferenceSymbol("std"))), # ]), LibraryClause([ LibraryReferenceSymbol(SimpleName("ieee")), diff --git a/tests/unit/Instantiate.py b/tests/unit/Instantiate.py index b96cd5c5b..7c59f6377 100644 --- a/tests/unit/Instantiate.py +++ b/tests/unit/Instantiate.py @@ -39,7 +39,7 @@ from pyVHDLModel.Base import Direction, Range from pyVHDLModel.Name import SelectedName, SimpleName, AllName, AttributeName from pyVHDLModel.Object import Constant, Signal -from pyVHDLModel.Symbol import LibraryReferenceSymbol, PackageReferenceSymbol, PackageMembersReferenceSymbol, SimpleSubtypeSymbol +from pyVHDLModel.Symbol import LibraryReferenceSymbol, PackageReferenceSymbol, PackageMemberReferenceSymbol, SimpleSubtypeSymbol from pyVHDLModel.Symbol import AllPackageMembersReferenceSymbol, ContextReferenceSymbol, EntitySymbol from pyVHDLModel.Symbol import ArchitectureSymbol, PackageSymbol, EntityInstantiationSymbol from pyVHDLModel.Symbol import ComponentInstantiationSymbol, ConfigurationInstantiationSymbol @@ -171,15 +171,15 @@ def test_PackageReferenceSymbol(self): self.assertEqual("PackageReferenceSymbol: 'Lib.Pack' -> Package: 'liB.pacK'", repr(symbol)) self.assertEqual("Package: 'liB.pacK'", str(symbol)) - def test_PackageMembersReferenceSymbol(self): + def test_PackageMemberReferenceSymbol(self): name = SelectedName("Obj", SelectedName("Pack", SimpleName("Lib"))) - symbol = PackageMembersReferenceSymbol(name) + symbol = PackageMemberReferenceSymbol(name) self.assertIs(name, symbol.Name) self.assertFalse(symbol.IsResolved) self.assertIsNone(symbol.Reference) self.assertIsNone(symbol.Member) - self.assertEqual("PackageMembersReferenceSymbol: 'Lib.Pack.Obj' -> unresolved", repr(symbol)) + self.assertEqual("PackageMemberReferenceSymbol: 'Lib.Pack.Obj' -> unresolved", repr(symbol)) self.assertEqual("Lib.Pack.Obj?", str(symbol)) library = Library("liB")