Skip to content

Commit cb6bb59

Browse files
committed
Added design name.
1 parent def0744 commit cb6bb59

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

pyVHDLModel/__init__.py

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from enum import unique, Enum, Flag, auto
5555
from pathlib import Path
5656

57-
from typing import Union, Dict, cast, List, Generator
57+
from typing import Union, Dict, cast, List, Generator, Optional as Nullable
5858

5959
from pyTooling.Decorators import export
6060
from pyTooling.Graph import Graph, Vertex, Edge
@@ -371,17 +371,23 @@ class Design(ModelEntity):
371371
A ``Design`` represents all loaded and analysed files (see :class:`~pyVHDLModel.Document`). It's the root of this
372372
document-object-model (DOM). It contains at least one VHDL library (see :class:`~pyVHDLModel.Library`).
373373
"""
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.
381385
382-
def __init__(self):
386+
:param name: Name of the design.
387+
"""
383388
super().__init__()
384389

390+
self.name = name
385391
self._libraries = {}
386392
self._documents = []
387393

0 commit comments

Comments
 (0)