6060from pyTooling .Common import getFullyQualifiedName
6161from pyTooling .Decorators import export , readonly
6262from pyTooling .Graph import Graph , Vertex , Edge
63+ from pyTooling .Warning import WarningCollector
6364
64- from pyVHDLModel .Exception import VHDLModelException
65+ from pyVHDLModel .Exception import VHDLModelException , NotImplementedWarning , BlackboxWarning
6566from pyVHDLModel .Exception import LibraryExistsInDesignError , LibraryRegisteredToForeignDesignError , LibraryNotRegisteredError , EntityExistsInLibraryError
6667from pyVHDLModel .Exception import ArchitectureExistsInLibraryError , PackageExistsInLibraryError , PackageBodyExistsError , ConfigurationExistsInLibraryError
6768from pyVHDLModel .Exception import ContextExistsInLibraryError , ReferencedLibraryNotExistingError
@@ -1054,6 +1055,8 @@ def CreateCompileOrderGraph(self) -> None:
10541055
10551056 def ImportObjects (self ) -> None :
10561057 def _ImportObjects (package : Package ) -> None :
1058+ from pyVHDLModel .Declaration import AttributeSpecification
1059+
10571060 for referencedLibrary in package ._referencedPackages .values ():
10581061 for referencedPackage in referencedLibrary .values ():
10591062 for declaredItem in referencedPackage ._declaredItems :
@@ -1062,6 +1065,10 @@ def _ImportObjects(package: Package) -> None:
10621065 package ._namespace ._elements [normalizedIdentifier ] = declaredItem
10631066 elif isinstance (declaredItem , NamedEntityMixin ):
10641067 package ._namespace ._elements [declaredItem ._normalizedIdentifier ] = declaredItem
1068+ elif isinstance (declaredItem , AttributeSpecification ):
1069+ # FIXME: actually, this is not a declared item, but a application of an attribute to named entities
1070+ WarningCollector .Raise (NotImplementedWarning (f"Attribute specification." ))
1071+
10651072 else :
10661073 raise VHDLModelException (f"Unexpected declared item." )
10671074
@@ -1154,15 +1161,15 @@ def _LinkSymbolsInExpression(expression, namespace: Namespace, typeVertex: Verte
11541161 _LinkSymbolsInExpression (expression .LeftOperand , namespace , typeVertex )
11551162 _LinkSymbolsInExpression (expression .RightOperand , namespace , typeVertex )
11561163 elif isinstance (expression , TernaryExpression ):
1157- pass
1164+ WarningCollector . Raise ( NotImplementedWarning ( f"Handling of ternary expression." ))
11581165 elif isinstance (expression , SimpleObjectOrFunctionCallSymbol ):
11591166 obj = namespace .FindObject (expression )
11601167 expression ._reference = obj
11611168
11621169 edge = obj ._objectVertex .EdgeToVertex (typeVertex )
11631170 edge ["kind" ] = ObjectGraphEdgeKind .ReferenceInExpression
11641171 else :
1165- pass
1172+ WarningCollector . Raise ( NotImplementedWarning ( f"Unhandled else-branch" ))
11661173
11671174 def _LinkItems (package : Package ):
11681175 for item in package ._declaredItems :
@@ -1301,10 +1308,11 @@ def LinkContexts(self) -> None:
13011308
13021309 # TODO: update the namespace with visible members
13031310 if isinstance (symbol , AllPackageMembersReferenceSymbol ):
1304- pass
1311+ WarningCollector . Raise ( NotImplementedWarning ( f"Handling of 'myLib.myPackage.all'." ))
13051312
13061313 elif isinstance (symbol , PackageMemberReferenceSymbol ):
1307- raise NotImplementedError ()
1314+ WarningCollector .Raise (NotImplementedWarning (f"Handling of 'myLib.myPackage.mySymbol'." ))
1315+
13081316 else :
13091317 raise VHDLModelException ()
13101318
@@ -1495,11 +1503,14 @@ def LinkPackageReferences(self) -> None:
14951503
14961504 # TODO: update the namespace with visible members
14971505 if isinstance (packageMemberSymbol , AllPackageMembersReferenceSymbol ):
1506+ WarningCollector .Raise (NotImplementedWarning (f"Handling of 'myLib.myPackage.all'. Exception: components are handled." ))
1507+
14981508 for componentIdentifier , component in package ._components .items ():
14991509 designUnit ._namespace ._elements [componentIdentifier ] = component
15001510
15011511 elif isinstance (packageMemberSymbol , PackageMemberReferenceSymbol ):
1502- raise NotImplementedError ()
1512+ WarningCollector .Raise (NotImplementedWarning (f"Handling of 'myLib.myPackage.mySymbol'." ))
1513+
15031514 else :
15041515 raise VHDLModelException ()
15051516
@@ -1624,11 +1635,10 @@ def LinkInstantiations(self) -> None:
16241635 dependency = architecture ._dependencyVertex .EdgeToVertex (component .Entity ._dependencyVertex , edgeValue = instance )
16251636 dependency ["kind" ] = DependencyGraphEdgeKind .ComponentInstantiation
16261637 else :
1627- print ( f"Found a blackbox for '{ instance .Label } : { instance .Component .Name } '." )
1638+ WarningCollector . Raise ( BlackboxWarning ( f"Blackbox caused by '{ instance .Label } : { instance .Component .Name } '.") )
16281639
16291640 elif isinstance (instance , ConfigurationInstantiation ):
1630- # pass
1631- print (instance .Label , instance .Configuration )
1641+ WarningCollector .Raise (NotImplementedWarning (f"Configuration instantiation of '{ instance .Label } : { instance .Configuration } '." ))
16321642
16331643 def IndexPackages (self ) -> None :
16341644 """
@@ -1841,7 +1851,7 @@ def IterateDocumentsInCompileOrder(self) -> Generator['Document', None, None]:
18411851 yield compileOrderNode .Value
18421852
18431853 def GetUnusedDesignUnits (self ) -> List [DesignUnit ]:
1844- raise NotImplementedError ( )
1854+ WarningCollector . Raise ( NotImplementedWarning ( f"Compute unused design units." ) )
18451855
18461856 def __repr__ (self ) -> str :
18471857 """
0 commit comments