Skip to content

Commit

Permalink
v0.25.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Apr 16, 2023
2 parents d315d8a + c36c2d8 commit 3776f27
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion pyVHDLModel/Namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pyVHDLModel/STD.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions pyVHDLModel/Symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
__email__ = "[email protected]"
__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
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")),
Expand Down
8 changes: 4 additions & 4 deletions tests/unit/Instantiate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 3776f27

Please sign in to comment.