diff options
author | Patrick Lehmann <Patrick.Lehmann@plc2.de> | 2021-08-13 23:12:20 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-08-23 16:35:35 +0200 |
commit | 6bd13c9f82e2b06bebdea8fc82a83604d5d500d1 (patch) | |
tree | 3949bd340a6ebd2f49ae70c626415dd50508efd8 /pyGHDL/dom | |
parent | 05b01cb126a3a18b2e067ea240a271f6de134311 (diff) | |
download | ghdl-6bd13c9f82e2b06bebdea8fc82a83604d5d500d1.tar.gz ghdl-6bd13c9f82e2b06bebdea8fc82a83604d5d500d1.tar.bz2 ghdl-6bd13c9f82e2b06bebdea8fc82a83604d5d500d1.zip |
Fixed missed adjustments to range in expressions.
Diffstat (limited to 'pyGHDL/dom')
-rw-r--r-- | pyGHDL/dom/Expression.py | 15 | ||||
-rw-r--r-- | pyGHDL/dom/_Translate.py | 4 |
2 files changed, 9 insertions, 10 deletions
diff --git a/pyGHDL/dom/Expression.py b/pyGHDL/dom/Expression.py index e8488b590..3769b9fb6 100644 --- a/pyGHDL/dom/Expression.py +++ b/pyGHDL/dom/Expression.py @@ -92,7 +92,7 @@ from pyVHDLModel.SyntaxModel import ( from pyGHDL.libghdl import utils from pyGHDL.libghdl._types import Iir from pyGHDL.libghdl.vhdl import nodes -from pyGHDL.dom import DOMMixin, DOMException +from pyGHDL.dom import DOMMixin, DOMException, Position from pyGHDL.dom._Utils import GetIirKindOfNode from pyGHDL.dom.Symbol import SimpleSubtypeSymbol from pyGHDL.dom.Aggregates import ( @@ -570,25 +570,24 @@ class Aggregate(VHDLModel_Aggregate, DOMMixin): index = GetExpressionFromNode(nodes.Get_Choice_Expression(item)) choices.append(IndexedAggregateElement(item, index, value)) elif kind == nodes.Iir_Kind.Choice_By_Range: - r = GetRangeFromNode(nodes.Get_Choice_Range(item)) - - rangeKind = GetIirKindOfNode(discreteRange) + choiceRange = nodes.Get_Choice_Range(item) + rangeKind = GetIirKindOfNode(choiceRange) if rangeKind == nodes.Iir_Kind.Range_Expression: - rng = GetRangeFromNode(discreteRange) + rng = GetRangeFromNode(choiceRange) elif rangeKind in ( nodes.Iir_Kind.Attribute_Name, nodes.Iir_Kind.Parenthesis_Name, ): - rng = GetNameFromNode(discreteRange) + rng = GetNameFromNode(choiceRange) else: - pos = Position.parse(generateNode) + pos = Position.parse(item) raise DOMException( "Unknown discete range kind '{kind}' in for...generate statement at line {line}.".format( kind=rangeKind.name, line=pos.Line ) ) - choices.append(RangedAggregateElement(item, r, value)) + choices.append(RangedAggregateElement(item, rng, value)) elif kind == nodes.Iir_Kind.Choice_By_Name: name = GetNameFromNode(nodes.Get_Choice_Name(item)) symbol = Symbol(item, name) diff --git a/pyGHDL/dom/_Translate.py b/pyGHDL/dom/_Translate.py index a4be6a792..f5f2eda3e 100644 --- a/pyGHDL/dom/_Translate.py +++ b/pyGHDL/dom/_Translate.py @@ -872,8 +872,8 @@ def GetSequentialStatementsFromChainedNodes( pos = Position.parse(statement) kind = GetIirKindOfNode(statement) -# if kind == nodes.Iir_Kind.Sensitized_Process_Statement: -# yield ProcessStatement.parse(statement, label, True) + # if kind == nodes.Iir_Kind.Sensitized_Process_Statement: + # yield ProcessStatement.parse(statement, label, True) if kind == nodes.Iir_Kind.If_Statement: print( "[NOT IMPLEMENTED] If statement (label: '{label}') at line {line}".format( |