File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,23 @@ class Context(PrimaryUnit):
311
311
"""
312
312
Represents a context declaration.
313
313
314
+ A context contains a generic list of all its items (library clauses, use clauses and context references) in
315
+ :data:`_references`.
316
+
317
+ Furthermore, when a context gets initialized, the item kinds get separated into individual lists:
318
+
319
+ * :class:`~pyVHDLModel.DesignUnit.LibraryClause` |rarr| :data:`_libraryReferences`
320
+ * :class:`~pyVHDLModel.DesignUnit.UseClause` |rarr| :data:`_packageReferences`
321
+ * :class:`~pyVHDLModel.DesignUnit.ContextReference` |rarr| :data:`_contextReferences`
322
+
323
+ When :meth:`pyVHDLModel.Design.LinkContexts` got called, these lists were processed and the fields:
324
+
325
+ * :data:`_referencedLibraries` (:pycode:`Dict[libName, Library]`)
326
+ * :data:`_referencedPackages` (:pycode:`Dict[libName, [pkgName, Package]]`)
327
+ * :data:`_referencedContexts` (:pycode:`Dict[libName, [ctxName, Context]]`)
328
+
329
+ are populated.
330
+
314
331
.. admonition:: Example
315
332
316
333
.. code-block:: VHDL
Original file line number Diff line number Diff line change @@ -836,6 +836,21 @@ def _LinkItems(package: Package):
836
836
_LinkItems (package )
837
837
838
838
def LinkContexts (self ) -> None :
839
+ """
840
+ Resolves and links all items (library clauses, use clauses and nested context references) in contexts.
841
+
842
+ It iterates all contexts in the design. Therefore, the library of the context is used as the working library. By
843
+ default, the working library is implicitly referenced in :data:`_referencedLibraries`. In addition, a new empty
844
+ dictionary is created in :data:`_referencedPackages` and :data:`_referencedContexts` for that working library.
845
+
846
+ At first, all library clauses are resolved (a library clause my have multiple library reference symbols). For each
847
+ referenced library an entry in :data:`_referencedLibraries` is generated and new empty dictionaries in
848
+ :data:`_referencedPackages` and :data:`_referencedContexts` for that working library. In addition, a vertex in the
849
+ dependency graph is added for that relationship.
850
+
851
+ At second, all use clauses are resolved (a use clause my have multiple package member reference symbols). For each
852
+ references package,
853
+ """
839
854
for context in self .IterateDesignUnits (DesignUnitKind .Context ): # type: Context
840
855
# Create entries in _referenced*** for the current working library under its real name.
841
856
workingLibrary : Library = context .Library
You can’t perform that action at this time.
0 commit comments