Skip to content

Commit

Permalink
Fix package namespace bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Jul 29, 2024
2 parents 95974b8 + 5cbcc96 commit c19d6e0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyVHDLModel/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,13 @@ def _ImportObjects(package: Package) -> None:
for referencedLibrary in package._referencedPackages.values():
for referencedPackage in referencedLibrary.values():
for declaredItem in referencedPackage._declaredItems:
package._namespace._elements[declaredItem._identifier] = declaredItem
if isinstance(declaredItem, MultipleNamedEntityMixin):
for normalizedIdentifier in declaredItem._normalizedIdentifiers:
package._namespace._elements[normalizedIdentifier] = declaredItem
elif isinstance(declaredItem, NamedEntityMixin):
package._namespace._elements[declaredItem._normalizedIdentifier] = declaredItem
else:
raise VHDLModelException(f"Unexpected declared item.")

for libraryName in ("std", "ieee"):
for package in self.GetLibrary(libraryName).IterateDesignUnits(filter=DesignUnitKind.Package): # type: Package
Expand Down

0 comments on commit c19d6e0

Please sign in to comment.