aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/dom/DesignUnit.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-19 02:22:36 +0200
committerPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-06-19 15:25:07 +0200
commitd9a096facfde93a78f1ce7546bb4f34f4e3cbde1 (patch)
tree6a597ea2b7196fdff3b70a48dbaa4383ed261ccc /pyGHDL/dom/DesignUnit.py
parent5764b4a86c3389ed0388c9382a112640a04dc0b0 (diff)
downloadghdl-d9a096facfde93a78f1ce7546bb4f34f4e3cbde1.tar.gz
ghdl-d9a096facfde93a78f1ce7546bb4f34f4e3cbde1.tar.bz2
ghdl-d9a096facfde93a78f1ce7546bb4f34f4e3cbde1.zip
Improvements to pyGHDL.dom.
Diffstat (limited to 'pyGHDL/dom/DesignUnit.py')
-rw-r--r--pyGHDL/dom/DesignUnit.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/pyGHDL/dom/DesignUnit.py b/pyGHDL/dom/DesignUnit.py
index 3619c47c5..534149677 100644
--- a/pyGHDL/dom/DesignUnit.py
+++ b/pyGHDL/dom/DesignUnit.py
@@ -41,7 +41,8 @@ This module contains all DOM classes for VHDL's design units (:class:`context <E
"""
from pydecor import export
-from pyVHDLModel.VHDLModel import Entity as VHDLModel_Entity
+from pyGHDL.dom.Symbol import EntitySymbol
+from pyVHDLModel.VHDLModel import Entity as VHDLModel_Entity, EntityOrSymbol
from pyVHDLModel.VHDLModel import Architecture as VHDLModel_Architecture
from pyVHDLModel.VHDLModel import Package as VHDLModel_Package
from pyVHDLModel.VHDLModel import PackageBody as VHDLModel_PackageBody
@@ -87,17 +88,18 @@ class Entity(VHDLModel_Entity, GHDLMixin):
@export
class Architecture(VHDLModel_Architecture, GHDLMixin):
- def __init__(self, name: str, entityName: str):
+ def __init__(self, name: str, entity: EntityOrSymbol):
super().__init__(name)
- self.__entityName = entityName
+ self._entity = entity
@classmethod
def parse(cls, libraryUnit):
name = NodeToName(libraryUnit)
entityName = NodeToName(nodes.Get_Entity_Name(libraryUnit))
+ entity = EntitySymbol(entityName)
- architecture = cls(name, entityName)
+ architecture = cls(name, entity)
for item in GetDeclaredItemsFromChainedNodes(
nodes.Get_Declaration_Chain(libraryUnit), "architecture", name