|
| 1 | +.. _analyze: |
| 2 | + |
| 3 | +Analyze |
| 4 | +####### |
| 5 | + |
| 6 | +1. Dependency analysis |
| 7 | + |
| 8 | +Dependency Analysis |
| 9 | +******************* |
| 10 | + |
| 11 | +1. Create Dependency Graph |
| 12 | +========================== |
| 13 | + |
| 14 | +Create unconnected vertices in the design's dependency graph for every VHDL library object and every design unit. |
| 15 | + |
| 16 | +The vertex's ``ID`` field is set to a unique identifying string. |br| |
| 17 | +The following patterns are used: |
| 18 | + |
| 19 | +Libraries |
| 20 | + The normalized library name: ``library``. |
| 21 | +Contexts |
| 22 | + The normalized library and context name: ``library.context``. |
| 23 | +Entities |
| 24 | + The normalized library and entity name: ``library.entity``. |
| 25 | +Architectures |
| 26 | + The normalized library, entity and architecture name in parenthesis: ``library.entity(architecture)``. |
| 27 | +Packages |
| 28 | + The normalized library and package name: ``library.package``. |
| 29 | +Package Bodies |
| 30 | + The normalized library and package name: ``library.package(body)``. |
| 31 | + |
| 32 | +The vertex's ``Value`` field references to the library or design unit object respectively. |
| 33 | + |
| 34 | +Each vertex has two attributes: |
| 35 | + |
| 36 | +``"kind"`` |
| 37 | + A kind attribute is set to an enumeration value of :py:class:`~pyVHDLModel.DependencyGraphVertexKind` representing |
| 38 | + vertex kind (type). |
| 39 | +``"predefined"`` |
| 40 | + A predefined attribute is set to ``True``, if the library or design unit is a VHDL predefined language entity from |
| 41 | + e.g. from ``std`` or ``ieee``. |
| 42 | + |
| 43 | +Lastly, every vertex is assigned to a :py:attr:``~pyVHDLModel.DesignUnit.DesignUnit._dependencyVertex`` field. Thus, |
| 44 | +there is a double reference from graph's vertex via ``Value`` to the DOM object as well as in reverse via |
| 45 | +``_dependencyVertex`` to the representing vertex. |
| 46 | + |
| 47 | +.. code-block:: vhdl |
| 48 | +
|
| 49 | + predefinedLibraries = ("std", "ieee") |
| 50 | +
|
| 51 | + for libraryIdentifier, library in self._libraries.items(): |
| 52 | + dependencyVertex = Vertex(vertexID=f"{libraryIdentifier}", value=library, graph=self._dependencyGraph) |
| 53 | + dependencyVertex["kind"] = DependencyGraphVertexKind.Library |
| 54 | + dependencyVertex["predefined"] = libraryIdentifier in predefinedLibraries |
| 55 | + library._dependencyVertex = dependencyVertex |
| 56 | +
|
| 57 | + for contextIdentifier, context in library._contexts.items(): |
| 58 | + dependencyVertex = Vertex(vertexID=f"{libraryIdentifier}.{contextIdentifier}", value=context, graph=self._dependencyGraph) |
| 59 | + dependencyVertex["kind"] = DependencyGraphVertexKind.Context |
| 60 | + dependencyVertex["predefined"] = context._library._normalizedIdentifier in predefinedLibraries |
| 61 | + context._dependencyVertex = dependencyVertex |
| 62 | +
|
| 63 | +
|
| 64 | +2. Create Compile Order Graph |
| 65 | +============================= |
| 66 | + |
| 67 | +3. Index Packages |
| 68 | +================= |
| 69 | + |
| 70 | +4. Index Architectures |
| 71 | +====================== |
| 72 | + |
| 73 | +5. Link Contexts |
| 74 | +================ |
| 75 | + |
| 76 | +6. Link Architectures |
| 77 | +===================== |
| 78 | + |
| 79 | +7. Link Package Bodies |
| 80 | +====================== |
| 81 | + |
| 82 | +8. Link Library References |
| 83 | +========================== |
| 84 | + |
| 85 | +9. Link Package References |
| 86 | +========================== |
| 87 | + |
| 88 | +10. Link Context References |
| 89 | +=========================== |
| 90 | + |
| 91 | +11. Link Components |
| 92 | +=================== |
| 93 | + |
| 94 | +12. Link Instantiations |
| 95 | +======================= |
| 96 | + |
| 97 | +13. Create Hierarchy Graph |
| 98 | +========================== |
| 99 | + |
| 100 | +14. Compute Compile Order |
| 101 | +========================= |
| 102 | + |
| 103 | + |
0 commit comments