From 4b2940a792aad81f0c37a4559963e940e3d96fa4 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 25 Jun 2021 15:22:59 +0200 Subject: [PATCH 1/4] Bump version to v0.10.5. --- 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 4c3ccb714..78934a090 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.4" # The full version, including alpha/beta/rc tags. +release = "0.10.5" # 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 cd98d8c95..2a3077b79 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ # Assemble all package information setuptools_setup( name=projectName, - version="0.10.4", + version="0.10.5", author="Patrick Lehmann", author_email="Paebbels@gmail.com", From b07081676fd98a708d47edfda1d4d901b1921225 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Fri, 25 Jun 2021 17:31:50 +0200 Subject: [PATCH 2/4] Cleanups. --- pyVHDLModel/VHDLModel.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 1732fc170..279497096 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -258,7 +258,7 @@ class ParenthesisName(Name): _associations: List def __init__(self, prefix: Name, associations: List): - super().__init__("", prefix=prefix) + super().__init__("", prefix) self._associations = associations @property @@ -286,7 +286,7 @@ class SlicedName(Name): @export class SelectedName(Name): def __init__(self, name: str, prefix: Name): - super().__init__(name, prefix=prefix) + super().__init__(name, prefix) def __str__(self): return str(self._prefix) + "." + self._name @@ -295,7 +295,7 @@ def __str__(self): @export class AttributeName(Name): def __init__(self, name: str, prefix: Name): - super().__init__(name, prefix=prefix) + super().__init__(name, prefix) def __str__(self): return str(self._prefix) + "'" + self._name @@ -834,10 +834,11 @@ def Methods(self) -> List[Union['Procedure', 'Function']]: class ProtectedTypeBody(Type): _methods: List[Union['Procedure', 'Function']] - def __init__(self, name: str, methods: Union[List, Iterator] = None): + def __init__(self, name: str, declaredItems: Union[List, Iterator] = None): super().__init__(name) - self._methods = [] if methods is None else [m for m in methods] + self._methods = [] if declaredItems is None else [m for m in declaredItems] + # FIXME: needs to be declared items or so @property def Methods(self) -> List[Union['Procedure', 'Function']]: return self._methods @@ -900,10 +901,11 @@ class PhysicalType(RangedScalarType, NumericType): _primaryUnit: str _secondaryUnits: List[Tuple[int, str]] - def __init__(self, name: str): + def __init__(self, name: str, primaryUnit: str, units: List[Tuple[str, 'PhysicalIntegerLiteral']]): super().__init__(name) - self._secondaryUnits = [] + self._primaryUnit = primaryUnit + self._secondaryUnits = units @property def PrimaryUnit(self) -> str: From 234d3c430df050bcf87faba6414aed69d3bf7023 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 26 Jun 2021 13:24:19 +0200 Subject: [PATCH 3/4] Fixed problems reported by PyCharm. --- pyVHDLModel/VHDLModel.py | 271 +++++++++++++++++++++++++++------------ 1 file changed, 188 insertions(+), 83 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index 279497096..a42a05658 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -41,9 +41,9 @@ This module contains a document language model for VHDL. """ # load dependencies -from enum import Enum -from pathlib import Path -from typing import List, Tuple, Union, Dict, Iterator +from enum import Enum +from pathlib import Path +from typing import List, Tuple, Union, Dict, Iterator, Optional try: from typing import Protocol @@ -54,7 +54,9 @@ class Protocol: from pydecor.decorators import export __all__ = [] -#__api__ = __all__ # FIXME: disabled due to a bug in pydecors export decorator +# __api__ = __all__ # FIXME: disabled due to a bug in pydecors export decorator + +Nullable = Optional SimpleOrAttribute = Union['SimpleName', 'AttributeName'] @@ -119,7 +121,7 @@ class Mode(Enum): Linkage = 5 def __str__(self): - return ("", "in", "out", "inout", "buffer", "linkage")[self.value] # TODO: check performance + return ("", "in", "out", "inout", "buffer", "linkage")[self.value] # TODO: check performance @export @@ -199,6 +201,7 @@ def Label(self) -> str: """Returns a model entity's label.""" return self._label + @export class Name: """ @@ -207,7 +210,7 @@ class Name: _name: str _root: 'Name' - _prefix: 'Name' + _prefix: Nullable['Name'] def __init__(self, name: str, prefix: 'Name' = None): self._name = name @@ -223,7 +226,7 @@ def Root(self) -> 'Name': return self._root @property - def Prefix(self) -> 'Name': + def Prefix(self) -> Nullable['Name']: return self._prefix @property @@ -243,7 +246,7 @@ def Root(self) -> 'Name': return self @property - def Prefix(self) -> 'Name': + def Prefix(self) -> Nullable['Name']: return None @property @@ -253,6 +256,7 @@ def Has_Prefix(self) -> bool: def __str__(self): return self._name + @export class ParenthesisName(Name): _associations: List @@ -309,6 +313,7 @@ def __init__(self, prefix: Name): def __str__(self): return "all" + @export class Symbol(ModelEntity): _symbolName: Name @@ -432,7 +437,7 @@ def SubType(self) -> 'SubType': @export class SimpleSubTypeSymbol(SubTypeSymbol): def __init__(self, subTypeName: Name): - super().__init__(symbolName = subTypeName) + super().__init__(subTypeName) self._subType = None @@ -440,10 +445,10 @@ def __init__(self, subTypeName: Name): class ConstrainedScalarSubTypeSymbol(SubTypeSymbol): _range: 'Range' - def __init__(self, subTypeName: Name, range: 'Range' = None): - super().__init__(symbolName = subTypeName) + def __init__(self, subTypeName: Name, r: 'Range' = None): + super().__init__(subTypeName) self._subType = None - self._range = range + self._range = r @property def Range(self) -> 'Range': @@ -455,7 +460,7 @@ class ConstrainedCompositeSubTypeSymbol(SubTypeSymbol): _constraints: List[Constraint] def __init__(self, subTypeName: Name, constraints: List[Constraint] = None): - super().__init__(symbolName = subTypeName) + super().__init__(subTypeName) self._subType = None self._constraints = constraints @@ -570,7 +575,7 @@ class Design(ModelEntity): at least on VHDL library (see :class:`~pyVHDLModel.VHDLModel.Library`). """ _libraries: Dict[str, 'Library'] #: List of all libraries defined for a design. - _documents: List['Document'] #: List of all documents loaded for a design. + _documents: List['Document'] #: List of all documents loaded for a design. def __init__(self): super().__init__() @@ -877,7 +882,7 @@ class EnumeratedType(ScalarType, DiscreteType): def __init__(self, name: str, literals: List['EnumerationLiteral']): super().__init__(name) - self._literals = [] if literals is None else [l for l in literals] + self._literals = [] if literals is None else [lit for lit in literals] @property def Literals(self) -> List['EnumerationLiteral']: @@ -899,7 +904,7 @@ def __init__(self, name: str): @export class PhysicalType(RangedScalarType, NumericType): _primaryUnit: str - _secondaryUnits: List[Tuple[int, str]] + _secondaryUnits: List[Tuple[str, 'PhysicalIntegerLiteral']] def __init__(self, name: str, primaryUnit: str, units: List[Tuple[str, 'PhysicalIntegerLiteral']]): super().__init__(name) @@ -912,7 +917,7 @@ def PrimaryUnit(self) -> str: return self._primaryUnit @property - def SecondaryUnits(self) -> List[Tuple[int, str]]: + def SecondaryUnits(self) -> List[Tuple[str, 'PhysicalIntegerLiteral']]: return self._secondaryUnits @@ -995,6 +1000,8 @@ class EnumerationLiteral(Literal): _value: str def __init__(self, value: str): + super().__init__() + self._value = value @property @@ -1139,7 +1146,7 @@ def __str__(self) -> str: class ParenthesisExpression(Protocol): @property def Operand(self) -> Expression: - pass + ... @export @@ -1165,26 +1172,32 @@ def __str__(self) -> str: rightOperator=self._FORMAT[1], ) + @export class NegationExpression(UnaryExpression): _FORMAT = ("-", "") + @export class IdentityExpression(UnaryExpression): _FORMAT = ("+", "") + @export class InverseExpression(UnaryExpression): _FORMAT = ("not ", "") + @export class AbsoluteExpression(UnaryExpression): _FORMAT = ("abs ", "") + @export class TypeConversion(UnaryExpression): pass + @export class FunctionCall(UnaryExpression): pass @@ -1242,150 +1255,182 @@ class DescendingRangeExpression(RangeExpression): @export -class AddingExpression(BinaryExpression): +class AddingExpression(BinaryExpression): """ A ``AddingExpression`` is a base-class for all adding expressions. """ + @export -class AdditionExpression(AddingExpression): +class AdditionExpression(AddingExpression): _FORMAT = ("", " + ", "") + @export -class SubtractionExpression(AddingExpression): +class SubtractionExpression(AddingExpression): _FORMAT = ("", " - ", "") + @export -class ConcatenationExpression(AddingExpression): +class ConcatenationExpression(AddingExpression): _FORMAT = ("", " & ", "") + @export -class MultiplyingExpression(BinaryExpression): +class MultiplyingExpression(BinaryExpression): """ A ``MultiplyingExpression`` is a base-class for all multiplying expressions. """ + @export -class MultiplyExpression(MultiplyingExpression): +class MultiplyExpression(MultiplyingExpression): _FORMAT = ("", " * ", "") + @export -class DivisionExpression(MultiplyingExpression): +class DivisionExpression(MultiplyingExpression): _FORMAT = ("", " / ", "") + @export -class RemainderExpression(MultiplyingExpression): +class RemainderExpression(MultiplyingExpression): _FORMAT = ("", " rem ", "") + @export -class ModuloExpression(MultiplyingExpression): +class ModuloExpression(MultiplyingExpression): _FORMAT = ("", " mod ", "") + @export -class ExponentiationExpression(MultiplyingExpression): +class ExponentiationExpression(MultiplyingExpression): _FORMAT = ("", "**", "") + @export -class LogicalExpression(BinaryExpression): +class LogicalExpression(BinaryExpression): """ A ``LogicalExpression`` is a base-class for all logical expressions. """ + @export class AndExpression(LogicalExpression): _FORMAT = ("", " and ", "") + @export class NandExpression(LogicalExpression): _FORMAT = ("", " nand ", "") + @export class OrExpression(LogicalExpression): _FORMAT = ("", " or ", "") + @export class NorExpression(LogicalExpression): _FORMAT = ("", " nor ", "") + @export class XorExpression(LogicalExpression): _FORMAT = ("", " xor ", "") + @export -class XnorExpression(LogicalExpression): +class XnorExpression(LogicalExpression): _FORMAT = ("", " xnor ", "") + @export -class RelationalExpression(BinaryExpression): +class RelationalExpression(BinaryExpression): """ A ``RelationalExpression`` is a base-class for all shifting expressions. """ + @export -class EqualExpression(RelationalExpression): +class EqualExpression(RelationalExpression): _FORMAT = ("", " = ", "") + @export -class UnequalExpression(RelationalExpression): +class UnequalExpression(RelationalExpression): _FORMAT = ("", " /= ", "") + @export -class GreaterThanExpression(RelationalExpression): +class GreaterThanExpression(RelationalExpression): _FORMAT = ("", " > ", "") + @export -class GreaterEqualExpression(RelationalExpression): +class GreaterEqualExpression(RelationalExpression): _FORMAT = ("", " >= ", "") + @export -class LessThanExpression(RelationalExpression): +class LessThanExpression(RelationalExpression): _FORMAT = ("", " < ", "") + @export -class LessEqualExpression(RelationalExpression): +class LessEqualExpression(RelationalExpression): _FORMAT = ("", " <= ", "") @export -class ShiftExpression(BinaryExpression): +class ShiftExpression(BinaryExpression): """ A ``ShiftExpression`` is a base-class for all shifting expressions. """ + @export class ShiftLogicExpression(ShiftExpression): pass + @export class ShiftArithmeticExpression(ShiftExpression): pass + @export class RotateExpression(ShiftExpression): pass + @export -class ShiftRightLogicExpression(ShiftLogicExpression): +class ShiftRightLogicExpression(ShiftLogicExpression): _FORMAT = ("", " srl ", "") + @export -class ShiftLeftLogicExpression(ShiftLogicExpression): +class ShiftLeftLogicExpression(ShiftLogicExpression): _FORMAT = ("", " sll ", "") + @export -class ShiftRightArithmeticExpression(ShiftArithmeticExpression): +class ShiftRightArithmeticExpression(ShiftArithmeticExpression): _FORMAT = ("", " sra ", "") + @export -class ShiftLeftArithmeticExpression(ShiftArithmeticExpression): +class ShiftLeftArithmeticExpression(ShiftArithmeticExpression): _FORMAT = ("", " sla ", "") + @export -class RotateRightExpression(RotateExpression): +class RotateRightExpression(RotateExpression): _FORMAT = ("", " ror ", "") + @export -class RotateLeftExpression(RotateExpression): +class RotateLeftExpression(RotateExpression): _FORMAT = ("", " rol ", "") @@ -1451,7 +1496,7 @@ def __str__(self) -> str: @export -class WhenElseExpression(TernaryExpression): +class WhenElseExpression(TernaryExpression): _FORMAT = ("", " when ", " else ", "") @@ -1582,11 +1627,13 @@ 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): @@ -1594,13 +1641,15 @@ class RangeSubtype(BaseConstraint): @export -class Object(ModelEntity, NamedEntity): +class Obj(ModelEntity, NamedEntity): _subType: SubTypeOrSymbol - def __init__(self, name: str): + def __init__(self, name: str, subType: SubTypeOrSymbol): super().__init__() NamedEntity.__init__(self, name) + self._subType = subType + @property def SubType(self) -> SubTypeOrSymbol: return self._subType @@ -1614,48 +1663,60 @@ class WithDefaultExpression: """ _defaultExpression: Expression + def __init__(self, defaultExpression: Expression = None): + self._defaultExpression = defaultExpression + @property def DefaultExpression(self) -> Expression: return self._defaultExpression @export -class BaseConstant(Object): +class BaseConstant(Obj): pass @export class Constant(BaseConstant, WithDefaultExpression): - pass + def __init__(self, name: str, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType) + WithDefaultExpression.__init__(self, defaultExpression) @export class DeferredConstant(BaseConstant): _constantReference: Constant + def __init__(self, name: str, subType: SubTypeOrSymbol): + super().__init__(name, subType) + @property def ConstantReference(self) -> Constant: return self._constantReference @export -class Variable(Object, WithDefaultExpression): - pass +class Variable(Obj, WithDefaultExpression): + def __init__(self, name: str, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType) + WithDefaultExpression.__init__(self, defaultExpression) @export -class SharedVariable(Object): +class SharedVariable(Obj): pass @export -class Signal(Object, WithDefaultExpression): - pass +class Signal(Obj, WithDefaultExpression): + def __init__(self, name: str, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType) + WithDefaultExpression.__init__(self, defaultExpression) + @export -class File(Object): +class File(Obj): pass -# _defaultExpression: Expression @export @@ -1763,18 +1824,29 @@ class AttributeSpecification(ModelEntity): _attribute: Name def __init__(self, attribute: Name): + super().__init__() + self._attribute = attribute @property def Attribute(self) -> Attribute: return self._attribute + @export -class InterfaceItem: +class InterfaceItem(ModelEntity): """ An ``InterfaceItem`` is a base-class for all mixin-classes for all interface items. """ + + +@export +class InterfaceItemWithMode: + """ + An ``InterfaceItemWithMode`` is a mixin-class to provide a ``Mode`` to + interface items. + """ _mode: Mode def __init__(self, mode: Mode): @@ -1793,79 +1865,100 @@ class GenericInterfaceItem(InterfaceItem): @export -class PortInterfaceItem(InterfaceItem): +class PortInterfaceItem(InterfaceItem, InterfaceItemWithMode): """ A ``PortInterfaceItem`` is a mixin class for all port interface items. """ + def __init__(self, mode: Mode): + super().__init__() + InterfaceItemWithMode.__init__(self, mode) + @export -class ParameterInterfaceItem(InterfaceItem): +class ParameterInterfaceItem(InterfaceItem, InterfaceItemWithMode): """ A ``ParameterInterfaceItem`` is a mixin class for all parameter interface items. """ + def __init__(self, mode: Mode): + super().__init__() + InterfaceItemWithMode.__init__(self, mode) + @export -class GenericConstantInterfaceItem(Constant, GenericInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) - GenericInterfaceItem.__init__(self, mode) +class GenericConstantInterfaceItem(Constant, GenericInterfaceItem, InterfaceItemWithMode): + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType, defaultExpression) + GenericInterfaceItem.__init__(self) + InterfaceItemWithMode.__init__(self, mode) @export -class GenericTypeInterfaceItem(GenericInterfaceItem): - pass +class GenericTypeInterfaceItem(Type, GenericInterfaceItem): + def __init__(self, name: str): + super().__init__(name) + GenericInterfaceItem.__init__(self) + @export class GenericSubprogramInterfaceItem(GenericInterfaceItem): pass + @export class GenericProcedureInterfaceItem(Procedure, GenericInterfaceItem): - pass + def __init__(self, name: str): + super().__init__(name) + GenericInterfaceItem.__init__(self) + @export class GenericFunctionInterfaceItem(Function, GenericInterfaceItem): - pass + def __init__(self, name: str): + super().__init__(name) + GenericInterfaceItem.__init__(self) + @export class GenericPackageInterfaceItem(GenericInterfaceItem): - pass + def __init__(self, name: str): + # super().__init__(name) + GenericInterfaceItem.__init__(self) @export class PortSignalInterfaceItem(Signal, PortInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType, defaultExpression) PortInterfaceItem.__init__(self, mode) @export class ParameterConstantInterfaceItem(Constant, ParameterInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType, defaultExpression) ParameterInterfaceItem.__init__(self, mode) @export class ParameterVariableInterfaceItem(Variable, ParameterInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType, defaultExpression) ParameterInterfaceItem.__init__(self, mode) @export class ParameterSignalInterfaceItem(Signal, ParameterInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol, defaultExpression: Expression = None): + super().__init__(name, subType, defaultExpression) ParameterInterfaceItem.__init__(self, mode) @export class ParameterFileInterfaceItem(File, ParameterInterfaceItem): - def __init__(self, name: str, mode: Mode): - super().__init__(name) + def __init__(self, name: str, mode: Mode, subType: SubTypeOrSymbol): + super().__init__(name, subType) ParameterInterfaceItem.__init__(self, mode) # class GenericItem(ModelEntity): @@ -1885,6 +1978,7 @@ def __init__(self, name: str, mode: Mode): # self._mode = None # self._class = None + @export class Reference(ModelEntity): pass @@ -1953,6 +2047,7 @@ def __init__(self, name: str): super().__init__() NamedEntity.__init__(self, name) + @export class MixinDesignUnitWithContext: """ @@ -2021,7 +2116,14 @@ class Entity(PrimaryUnit, MixinDesignUnitWithContext): _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): + def __init__( + self, + name: str, + genericItems: List[GenericInterfaceItem] = None, + portItems: List[PortInterfaceItem] = None, + declaredItems: List = None, + bodyItems: List['ConcurrentStatement'] = None + ): super().__init__(name) MixinDesignUnitWithContext.__init__(self) @@ -2263,6 +2365,7 @@ def __init__(self): def Statements(self) -> List[ConcurrentStatement]: return self._statements + @export class SequentialDeclarations: _declaredItems: List @@ -2296,10 +2399,12 @@ class Instantiation(ConcurrentStatement): class ComponentInstantiation(Instantiation): pass + @export class EntityInstantiation(Instantiation): pass + @export class ConfigurationInstantiation(Instantiation): pass @@ -2556,14 +2661,14 @@ class Assignment: An ``Assignment`` is a base-class for all assignment statements. """ - _target: Object + _target: Obj _expression: Expression def __init__(self): super().__init__() @property - def Target(self) -> Object: + def Target(self) -> Obj: return self._target @property @@ -2810,8 +2915,8 @@ class ExitStatement(LoopControlStatement): @export class WaitStatement(SequentialStatement, MixinConditional): - _sensitivityList : List[Signal] - _timeout: Expression + _sensitivityList: List[Signal] + _timeout: Expression def __init__(self): super().__init__() From 09497f9680244abadfca7c42fdb00be9ff076344 Mon Sep 17 00:00:00 2001 From: Patrick Lehmann Date: Sat, 26 Jun 2021 13:34:22 +0200 Subject: [PATCH 4/4] Fixed problems reported by PyCharm and Codacy. --- pyVHDLModel/VHDLModel.py | 21 +++++++-------------- pyVHDLModel/__init__.py | 4 +++- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/pyVHDLModel/VHDLModel.py b/pyVHDLModel/VHDLModel.py index a42a05658..5d0230f91 100644 --- a/pyVHDLModel/VHDLModel.py +++ b/pyVHDLModel/VHDLModel.py @@ -101,7 +101,8 @@ class Direction(Enum): DownTo = 1 def __str__(self): - return ("to", "downto")[self.value] # TODO: check performance + index: int = self.value + return ("to", "downto")[index] # TODO: check performance @export @@ -121,7 +122,8 @@ class Mode(Enum): Linkage = 5 def __str__(self): - return ("", "in", "out", "inout", "buffer", "linkage")[self.value] # TODO: check performance + index: int = self.value + return ("", "in", "out", "inout", "buffer", "linkage")[index] # TODO: check performance @export @@ -445,10 +447,10 @@ def __init__(self, subTypeName: Name): class ConstrainedScalarSubTypeSymbol(SubTypeSymbol): _range: 'Range' - def __init__(self, subTypeName: Name, r: 'Range' = None): + def __init__(self, subTypeName: Name, rng: 'Range' = None): super().__init__(subTypeName) self._subType = None - self._range = r + self._range = rng @property def Range(self) -> 'Range': @@ -734,6 +736,7 @@ def __init__(self, name: str): @export class BaseType(ModelEntity, NamedEntity): """``BaseType`` is the base class of all type entities in this model.""" + def __init__(self, name: str): """ Initializes underlying ``BaseType``. @@ -1618,16 +1621,6 @@ class BaseConstraint(ModelEntity): pass -# FIXME: exists 2 times -@export -class RangeExpression(BaseConstraint): - _range: Range - - @property - def Range(self): - return self._range - - # FIXME: Is this used? @export class RangeAttribute(BaseConstraint): diff --git a/pyVHDLModel/__init__.py b/pyVHDLModel/__init__.py index 2b052dfdd..0ed569bc0 100644 --- a/pyVHDLModel/__init__.py +++ b/pyVHDLModel/__init__.py @@ -35,7 +35,9 @@ # ============================================================================== # """ +An abstract VHDL language model. + :copyright: Copyright 2007-2021 Patrick Lehmann - Bötzingen, Germany :license: Apache License, Version 2.0 """ -__version__ = "0.8.1" +__version__ = "0.10.5"