From 9e62d1331be4bdf8ee0e134d99465a013db198f9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 23 Jun 2021 16:28:57 +0200 Subject: [PATCH 01/10] Bump version to v0.10.4. --- doc/conf.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9cb49e600..4c3ccb714 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -37,7 +37,7 @@ def _LatestTagName(): # The full version, including alpha/beta/rc tags version = "0.9" # The short X.Y version. -release = "0.10.3" # The full version, including alpha/beta/rc tags. +release = "0.10.4" # The full version, including alpha/beta/rc tags. try: if _IsUnderGitControl: latestTagName = _LatestTagName()[1:] # remove prefix "v" diff --git a/setup.py b/setup.py index a47371481..cd98d8c95 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ # Assemble all package information setuptools_setup( name=projectName, - version="0.10.3", + version="0.10.4", author="Patrick Lehmann", author_email="Paebbels@gmail.com", From 90ac5d012d4804171eab846b1bfe3a775e7900a0 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 23 Jun 2021 17:17:44 +0200 Subject: [PATCH 02/10] Added example to README. --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index d482d4c54..1b5dcf92a 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,41 @@ frontends. * Created a (re)formatted output of VHDL. +## Examples +### List all Entities with Generics and Ports + +The following tiny example is based on GHDL's [`pyGHDL.dom`](https://github.com/ghdl/ghdl/tree/master/pyGHDL/dom) package implementing +pyVHDLModel. + +```python +from pathlib import Path +from pyGHDL.dom.NonStandard import Design, Document + +sourceFile = Path("example.vhdl") + +design = Design() +library = Design.GetLibrary("lib") +document = Document(sourceFile) +design.AddDocument(document, library) + +for entity in document.Entities: + print("{}".format(entity.Name)) + print(" generics:") + for generic in entity.Generics: + print(" - {} : {!s} {}".format( + generic.Name, generic.Mode, generic.SubTypeIndication) + ) + print(" ports:") + for port in entity.Ports: + print(" - {} : {!s} {}".format( + port.Name, port.Mode, port.SubTypeIndication) + ) +``` + + + + + ## Contributors * [Patrick Lehmann](https://github.com/Paebbels) (Maintainer) * [Unai Martinez-Corral](https://github.com/umarcor) From 5dbafc18e58234005fcd79ef555717ec306ad8d9 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Wed, 23 Jun 2021 23:57:00 +0200 Subject: [PATCH 03/10] Enhanced Names. --- pyVHDLModel/VHDLModel.py | 139 ++++++++++++++++++++++++++++++--------- 1 file changed, 109 insertions(+), 30 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index ebaa65bf9..f28354a84 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -56,6 +56,8 @@ class Protocol: __all__ = [] #__api__ = __all__ # FIXME: disabled due to a bug in pydecors export decorator +SimpleOrAttribute = Union['SimpleName', 'AttributeName'] + LibraryOrSymbol = Union['Library', 'LibrarySymbol'] EntityOrSymbol = Union['Entity', 'EntitySymbol'] ArchitectureOrSymbol = Union['Architecture', 'ArchitectureSymbol'] @@ -197,29 +199,106 @@ def Label(self) -> str: """Returns a model entity's label.""" return self._label +@export +class Name: + _name: str + _root: 'Name' + _prefix: 'Name' + + def __init__(self, name: str): + self._name = name + + @property + def Name(self) -> str: + return self._name + + @property + def Root(self) -> 'Name': + return self._root + + @property + def Prefix(self) -> 'Name': + return self._prefix + + @property + def Has_Prefix(self) -> bool: + return self._prefix is not None + + +@export +class SimpleName(Name): + def __str__(self): + return self._name + + +@export +class IndexedName(Name): + _index: Expression + + @property + def Index(self) -> Expression: + return self._index + + +@export +class SlicedName(Name): + pass + + +@export +class SelectedName(Name): + _element: Name + + def __init__(self, name: str, element: Name): + super().__init__(name) + self._element = element + + @property + def Element(self) -> Name: + return self._element + + def __str__(self): + return self._name + "." + str(self._element) + + +@export +class AttributeName(Name): + _attribute: SimpleOrAttribute + + def __init__(self, name: str, attribute: SimpleOrAttribute): + super().__init__(name) + self._attribute = attribute + + @property + def Attribute(self) -> SimpleOrAttribute: + return self._attribute + + def __str__(self): + return self._name + "'" + str(self._attribute) + @export class Symbol(ModelEntity): - _symbolName: str + _symbolName: Name - def __init__(self, symbolName: str): + def __init__(self, symbolName: Name): super().__init__() self._symbolName = symbolName @property - def SymbolName(self) -> str: + def SymbolName(self) -> Name: return self._symbolName def __str__(self) -> str: - return self._symbolName + return str(self._symbolName) @export class LibrarySymbol(Symbol): _library: 'Library' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._library = None @property @@ -234,7 +313,7 @@ def ResolvesTo(self, library: 'Library'): class EntitySymbol(Symbol): _entity: 'Entity' - def __init__(self, entityName: str): + def __init__(self, entityName: Name): super().__init__(symbolName=entityName) self._entity = None @@ -248,8 +327,8 @@ def Package(self) -> 'Entity': class ArchitectureSymbol(Symbol): _architecture: 'Architecture' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._architecture = None @property @@ -261,8 +340,8 @@ def Architecture(self) -> 'Architecture': class ComponentSymbol(Symbol): _component: 'Component' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._component = None @property @@ -274,8 +353,8 @@ def Component(self) -> 'Component': class ConfigurationSymbol(Symbol): _configuration: 'Configuration' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._configuration = None @property @@ -287,8 +366,8 @@ def Configuration(self) -> 'Configuration': class PackageSymbol(Symbol): _package: 'Package' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._package = None @property @@ -300,8 +379,8 @@ def Package(self) -> 'Package': class ContextSymbol(Symbol): _context: 'Context' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._context = None @property @@ -320,7 +399,7 @@ def SubType(self) -> 'SubType': @export class SimpleSubTypeSymbol(SubTypeSymbol): - def __init__(self, subTypeName: str): + def __init__(self, subTypeName: Name): super().__init__(symbolName = subTypeName) self._subType = None @@ -329,7 +408,7 @@ def __init__(self, subTypeName: str): class ConstrainedScalarSubTypeSymbol(SubTypeSymbol): _range: 'Range' - def __init__(self, subTypeName: str, range: 'Range' = None): + def __init__(self, subTypeName: Name, range: 'Range' = None): super().__init__(symbolName = subTypeName) self._subType = None self._range = range @@ -343,7 +422,7 @@ def Range(self) -> 'Range': class ConstrainedCompositeSubTypeSymbol(SubTypeSymbol): _constraints: List[Constraint] - def __init__(self, subTypeName: str, constraints: List[Constraint] = None): + def __init__(self, subTypeName: Name, constraints: List[Constraint] = None): super().__init__(symbolName = subTypeName) self._subType = None self._constraints = constraints @@ -367,7 +446,7 @@ class ObjectSymbol(Symbol): class SimpleObjectOrFunctionCallSymbol(Symbol): _object: Union['Constant', 'Signal', 'Variable', 'Function'] - def __init__(self, objectName: str): + def __init__(self, objectName: Name): super().__init__(objectName) self._object = None @@ -385,7 +464,7 @@ def __str__(self) -> str: class IndexedObjectOrFunctionCallSymbol(Symbol): _object: Union['Constant', 'Signal', 'Variable', 'Function'] - def __init__(self, objectName: str): + def __init__(self, objectName: Name): super().__init__(objectName) self._object = None @@ -403,8 +482,8 @@ def __str__(self) -> str: class ConstantSymbol(ObjectSymbol): _constant: 'Constant' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._constant = None @property @@ -416,8 +495,8 @@ def Constant(self) -> 'Constant': class VariableSymbol(ObjectSymbol): _variable: 'Variable' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._variable = None @property @@ -429,8 +508,8 @@ def Variable(self) -> 'Variable': class SignalSymbol(ObjectSymbol): _signal: 'Signal' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._signal = None @property @@ -442,8 +521,8 @@ def Signal(self) -> 'Signal': class FileSymbol(ObjectSymbol): _file: 'File' - def __init__(self): - super().__init__() + def __init__(self, symbolName: Name): + super().__init__(symbolName) self._file = None @property From 41e91e8c5683b1c5b9a18cc16c72b77f89343b6d Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Jun 2021 11:00:10 +0200 Subject: [PATCH 04/10] Reworked Names and Ranges. --- pyVHDLModel/VHDLModel.py | 97 ++++++++++++++++++++++++++++------------ 1 file changed, 68 insertions(+), 29 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index f28354a84..eac98f2a2 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -143,7 +143,7 @@ class Class(Enum): @export class ModelEntity: """ - ``ModelEntity`` is a base class for all classes in the VHDL language model, + ``ModelEntity`` is the base class for all classes in the VHDL language model, except for mixin classes (see multiple inheritance) and enumerations. Each entity in this model has a reference to its parent entity. Therefore @@ -201,12 +201,18 @@ def Label(self) -> str: @export class Name: + """ + ``Name`` is the base class for all *names* in the VHDL language model. + """ + _name: str _root: 'Name' _prefix: 'Name' - def __init__(self, name: str): + def __init__(self, name: str, prefix: 'Name' = None): self._name = name + self._prefix = prefix + self._root = prefix._root @property def Name(self) -> str: @@ -227,17 +233,49 @@ def Has_Prefix(self) -> bool: @export class SimpleName(Name): + def __init__(self, name: str): + self._name = name + self._root = self + self._prefix = None + + @property + def Root(self) -> 'Name': + return self + + @property + def Prefix(self) -> 'Name': + return None + + @property + def Has_Prefix(self) -> bool: + return False + def __str__(self): return self._name +@export +class ParenthesisName(Name): + _associations: List + + def __init__(self, prefix: Name, associations: List): + super().__init__("", prefix=prefix) + self._associations = associations + + @property + def Associations(self) -> List: + return self._associations + + def __str__(self): + return str(self._prefix) + "(" + ", ".join([str(a) for a in self._associations]) + ")" + @export class IndexedName(Name): - _index: Expression + _indices: List[Expression] @property - def Index(self) -> Expression: - return self._index + def Indices(self) -> List[Expression]: + return self._indices @export @@ -247,34 +285,20 @@ class SlicedName(Name): @export class SelectedName(Name): - _element: Name - - def __init__(self, name: str, element: Name): - super().__init__(name) - self._element = element - - @property - def Element(self) -> Name: - return self._element + def __init__(self, name: str, prefix: Name): + super().__init__(name, prefix=prefix) def __str__(self): - return self._name + "." + str(self._element) + return str(self._prefix) + "." + self._name @export class AttributeName(Name): - _attribute: SimpleOrAttribute - - def __init__(self, name: str, attribute: SimpleOrAttribute): - super().__init__(name) - self._attribute = attribute - - @property - def Attribute(self) -> SimpleOrAttribute: - return self._attribute + def __init__(self, name: str, prefix: Name): + super().__init__(name, prefix=prefix) def __str__(self): - return self._name + "'" + str(self._attribute) + return str(self._prefix) + "'" + self._name @export @@ -1165,6 +1189,21 @@ def __str__(self) -> str: ) +@export +class RangeExpression(BinaryExpression): + pass + + +@export +class AscendingRangeExpression(RangeExpression): + _FORMAT = ("", " to ", "") + + +@export +class DescendingRangeExpression(RangeExpression): + _FORMAT = ("", " downto ", "") + + @export class AddingExpression(BinaryExpression): """ @@ -1914,7 +1953,7 @@ def PackageReferences(self) -> List[UseStatement]: class Entity(PrimaryUnit, MixinDesignUnitWithContext): _genericItems: List[GenericInterfaceItem] _portItems: List[PortInterfaceItem] - _declaredItems: List # FIXME: define list element type e.g. via Union + _declaredItems: List # FIXME: define list prefix type e.g. via Union _bodyItems: List['ConcurrentStatement'] def __init__(self, name: str, genericItems: List[GenericInterfaceItem] = None, portItems: List[PortInterfaceItem] = None, declaredItems: List = None, bodyItems: List['ConcurrentStatement'] = None): @@ -1935,7 +1974,7 @@ def PortItems(self) -> List[PortInterfaceItem]: return self._portItems @property - def DeclaredItems(self) -> List: # FIXME: define list element type e.g. via Union + def DeclaredItems(self) -> List: # FIXME: define list prefix type e.g. via Union return self._declaredItems @property @@ -1946,7 +1985,7 @@ def BodyItems(self) -> List['ConcurrentStatement']: @export class Architecture(SecondaryUnit, MixinDesignUnitWithContext): _entity: EntityOrSymbol - _declaredItems: List # FIXME: define list element type e.g. via Union + _declaredItems: List # FIXME: define list prefix type e.g. via Union _bodyItems: List['ConcurrentStatement'] def __init__(self, name: str, entity: EntityOrSymbol, declaredItems: List = None, bodyItems: List['ConcurrentStatement'] = None): @@ -1962,7 +2001,7 @@ def Entity(self) -> EntityOrSymbol: return self._entity @property - def DeclaredItems(self) -> List: # FIXME: define list element type e.g. via Union + def DeclaredItems(self) -> List: # FIXME: define list prefix type e.g. via Union return self._declaredItems @property From 11681925599880d4ef1343f340a1964462a7e359 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Jun 2021 12:17:01 +0200 Subject: [PATCH 05/10] Added Attribute. --- pyVHDLModel/VHDLModel.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index eac98f2a2..96a2dd2ba 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -1536,6 +1536,7 @@ class BaseConstraint(ModelEntity): pass +# FIXME: exists 2 times @export class RangeExpression(BaseConstraint): _range: Range @@ -1544,12 +1545,12 @@ class RangeExpression(BaseConstraint): def Range(self): return self._range - +# FIXME: Is this used? @export class RangeAttribute(BaseConstraint): pass - +# FIXME: Is this used? @export class RangeSubtype(BaseConstraint): pass @@ -1705,6 +1706,21 @@ def __init__(self, name: str, protectedType: ProtectedType): Method.__init__(self, protectedType) +@export +class Attribute(ModelEntity, NamedEntity): + _subType: SubTypeOrSymbol + + def __init__(self, name: str, subType: SubTypeOrSymbol): + super().__init__() + NamedEntity.__init__(self, name) + + self._subType = subType + + @property + def SubType(self): + return self._subType + + @export class InterfaceItem: """ From 050b49279e68c31ccd3e7e2f4f4c1b3d9fddd20a Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Jun 2021 14:15:58 +0200 Subject: [PATCH 06/10] Added protected type and matching body. --- pyVHDLModel/VHDLModel.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 96a2dd2ba..0799c106a 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -43,7 +43,7 @@ # load dependencies from enum import Enum from pathlib import Path -from typing import List, Tuple, Union, Dict +from typing import List, Tuple, Union, Dict, Iterator try: from typing import Protocol @@ -811,7 +811,28 @@ class CompositeType(Type): @export class ProtectedType(Type): - pass + _methods: List[Union['Procedure', 'Function']] + + def __init__(self, name: str, methods: Union[List, Iterator] = None): + super().__init__(name) + self._methods = [] if methods is None else [m for m in methods] + + @property + def Methods(self) -> List[Union['Procedure', 'Function']]: + return self._methods + + +@export +class ProtectedTypeBody(Type): + _methods: List[Union['Procedure', 'Function']] + + def __init__(self, name: str, methods: Union[List, Iterator] = None): + super().__init__(name) + self._methods = [] if methods is None else [m for m in methods] + + @property + def Methods(self) -> List[Union['Procedure', 'Function']]: + return self._methods @export From d619acc16122fbfa2559d3d6ff3b3232a5ac24d1 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Thu, 24 Jun 2021 15:06:58 +0200 Subject: [PATCH 07/10] Added NullLiteral. --- pyVHDLModel/VHDLModel.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 0799c106a..66e0d1136 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -974,6 +974,12 @@ class Literal(BaseExpression): # TODO: add a reference to a basetype ? +@export +class NullLiteral(Literal): + def __str__(self) -> str: + return "null" + + @export class EnumerationLiteral(Literal): _value: str From eed77997559ea1fadb076eb04d4f414bae61de9c Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 25 Jun 2021 09:53:38 +0200 Subject: [PATCH 08/10] Package instantiations. --- pyVHDLModel/VHDLModel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 66e0d1136..94b1e7d4a 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -2181,14 +2181,15 @@ class PackageInstantiation(PrimaryUnit, GenericEntityInstantiation): _packageReference: Package _genericAssociations: List[GenericAssociationItem] - def __init__(self, name: str): + def __init__(self, name: str, uninstantiatedPackage: PackageOrSymbol): super().__init__(name) GenericEntityInstantiation.__init__(self) + self._packageReference = uninstantiatedPackage self._genericAssociations = [] @property - def PackageReference(self) -> Package: + def PackageReference(self) -> PackageOrSymbol: return self._packageReference @property From 09add868f534d25a0aa663bb313bde0eee843e42 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 25 Jun 2021 10:44:50 +0200 Subject: [PATCH 09/10] Added AllName and AttributeSpecification. --- doc/LanguageModel/DesignUnits.rst | 8 ++++---- pyVHDLModel/VHDLModel.py | 28 ++++++++++++++++++++++------ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/doc/LanguageModel/DesignUnits.rst b/doc/LanguageModel/DesignUnits.rst index 2b6f8d281..b265193ab 100644 --- a/doc/LanguageModel/DesignUnits.rst +++ b/doc/LanguageModel/DesignUnits.rst @@ -83,7 +83,7 @@ types). An entity's list of statements is called body items. def LibraryReferences(self) -> List[Library]: @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: @property def ContextReferences(self) -> List[Context]: @@ -131,7 +131,7 @@ Package def LibraryReferences(self) -> List[Library]: @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: @property def ContextReferences(self) -> List[Context]: @@ -178,7 +178,7 @@ Architeture def LibraryReferences(self) -> List[Library]: @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: @property def ContextReferences(self) -> List[Context]: @@ -223,7 +223,7 @@ Package Body def LibraryReferences(self) -> List[Library]: @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: @property def ContextReferences(self) -> List[Context]: diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 94b1e7d4a..310686e70 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -301,6 +301,14 @@ def __str__(self): return str(self._prefix) + "'" + self._name +@export +class AllName(Name): + def __init__(self, prefix: Name): + super().__init__("all", prefix) + + def __str__(self): + return "all" + @export class Symbol(ModelEntity): _symbolName: Name @@ -1748,6 +1756,14 @@ def SubType(self): return self._subType +@export +class AttributeSpecification(ModelEntity): + _attribute: Name + + def __init__(self, attribute: Name): + self._attribute = attribute + + @export class InterfaceItem: """ @@ -1883,12 +1899,12 @@ def Library(self) -> Union[None, LibraryOrSymbol]: @export -class UseStatement(Reference): +class UseClause(Reference): _library: Union[None, LibraryOrSymbol] _package: 'Package' _item: str - def __init__(self): + def __init__(self, name: Name): super().__init__() @property @@ -1937,7 +1953,7 @@ class MixinDesignUnitWithContext: A ``DesignUnitWithReferences`` is a base-class for all design units with contexts. """ _libraryReferences: List[LibraryStatement] - _packageReferences: List[UseStatement] + _packageReferences: List[UseClause] _contextReferences: List['Context'] def __init__(self): @@ -1950,7 +1966,7 @@ def LibraryReferences(self) -> List[LibraryStatement]: return self._libraryReferences @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: return self._packageReferences @property @@ -1975,7 +1991,7 @@ class SecondaryUnit(DesignUnit): @export class Context(PrimaryUnit): _libraryReferences: List[LibraryStatement] - _packageReferences: List[UseStatement] + _packageReferences: List[UseClause] def __init__(self, name): super().__init__(name) @@ -1988,7 +2004,7 @@ def LibraryReferences(self) -> List[LibraryStatement]: return self._libraryReferences @property - def PackageReferences(self) -> List[UseStatement]: + def PackageReferences(self) -> List[UseClause]: return self._packageReferences From 48af71cf350f3aa4e885c50b995d22c1c2a099f4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 25 Jun 2021 11:29:45 +0200 Subject: [PATCH 10/10] Added Property Attribute to AttributeSpecification. --- pyVHDLModel/VHDLModel.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 310686e70..1732fc170 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -1763,6 +1763,9 @@ class AttributeSpecification(ModelEntity): def __init__(self, attribute: Name): self._attribute = attribute + @property + def Attribute(self) -> Attribute: + return self._attribute @export class InterfaceItem: @@ -1906,6 +1909,7 @@ class UseClause(Reference): def __init__(self, name: Name): super().__init__() + self._item = str(name) @property def Library(self) -> Union[None, LibraryOrSymbol]: