|
54 | 54 | from enum import unique, Enum, Flag, auto
|
55 | 55 | from pathlib import Path
|
56 | 56 |
|
57 |
| -from typing import Union, Dict, cast, List, Generator |
| 57 | +from typing import Union, Dict, cast, List, Generator, Optional as Nullable |
58 | 58 |
|
59 | 59 | from pyTooling.Decorators import export
|
60 | 60 | from pyTooling.Graph import Graph, Vertex, Edge
|
@@ -371,17 +371,23 @@ class Design(ModelEntity):
|
371 | 371 | A ``Design`` represents all loaded and analysed files (see :class:`~pyVHDLModel.Document`). It's the root of this
|
372 | 372 | document-object-model (DOM). It contains at least one VHDL library (see :class:`~pyVHDLModel.Library`).
|
373 | 373 | """
|
374 |
| - _libraries: Dict[str, 'Library'] #: List of all libraries defined for a design. |
375 |
| - _documents: List['Document'] #: List of all documents loaded for a design. |
376 |
| - |
377 |
| - _compileOrderGraph: Graph[None, None, None, None, None, 'Document', None, None, None, None, None, None, None] |
378 |
| - _dependencyGraph: Graph[None, None, None, None, str, DesignUnit, None, None, None, None, None, None, None] |
379 |
| - _hierarchyGraph: Graph[None, None, None, None, str, DesignUnit, None, None, None, None, None, None, None] |
380 |
| - _toplevel: Union[Entity, Configuration] |
| 374 | + name: Nullable[str] #: Name of the design |
| 375 | + _libraries: Dict[str, 'Library'] #: List of all libraries defined for a design. |
| 376 | + _documents: List['Document'] #: List of all documents loaded for a design. |
| 377 | + _dependencyGraph: Graph[None, None, None, None, str, DesignUnit, None, None, None, None, None, None, None] #: The graph of all dependencies in the designs. |
| 378 | + _compileOrderGraph: Graph[None, None, None, None, None, 'Document', None, None, None, None, None, None, None] #: A graph derived from dependency graph containing the order of documents for compilation. |
| 379 | + _hierarchyGraph: Graph[None, None, None, None, str, DesignUnit, None, None, None, None, None, None, None] #: A graph derived from dependency graph containing the design hierarchy. |
| 380 | + _toplevel: Union[Entity, Configuration] #: When computed, the toplevel design unit is cached in this field. |
| 381 | + |
| 382 | + def __init__(self, name: str = None): |
| 383 | + """ |
| 384 | + Initializes a VHDL design. |
381 | 385 |
|
382 |
| - def __init__(self): |
| 386 | + :param name: Name of the design. |
| 387 | + """ |
383 | 388 | super().__init__()
|
384 | 389 |
|
| 390 | + self.name = name |
385 | 391 | self._libraries = {}
|
386 | 392 | self._documents = []
|
387 | 393 |
|
|
0 commit comments