KNOWNBUG test for assignments to packed array elements - #2137
Merged
kroening merged 1 commit intoSep 23, 2026
Merged
Conversation
kroening
force-pushed
the
kroening/knownbug-packed-array-element-lhs
branch
from
September 23, 2026 21:09
ade10ab to
2291dd3
Compare
tautschnig
approved these changes
Sep 23, 2026
The RTL construction places the elements of packed arrays as it does for unpacked arrays, i.e., the element with the left index of the declared range in the least significant position. In a packed array, the element with the left index is the most significant (1800-2017 7.4.1), which is what the lowering of reads assumes. Assignments to the elements of a packed array are hence written in reverse order, irrespective of the direction of the range.
kroening
force-pushed
the
kroening/knownbug-packed-array-element-lhs
branch
from
September 23, 2026 21:41
2291dd3 to
82f00ae
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a KNOWNBUG regression test for a soundness bug in the RTL construction introduced with #2119.
verilog_rtl_buildert::decompose_lhsplaces the elements of packed arrays as it does for unpacked arrays: the element with the left index of the declared range in the least significant position. In a packed array the element with the left index is the most significant (1800-2017 7.4.1), which is whatverilog_loweringassumes for reads. Assignments to the elements of a packed array are hence written in reverse order, irrespective of the direction of the range.--show-rtlshowsa1[3:0] register, next-state value: 4'b1010for the assignment toa1[1].Testing
regression/verilog/arrays/packed_element_assignment1.descis reported as SKIPPED bytest.pl.e224197c.Root cause
decompose_lhsinsrc/verilog/verilog_rtl.cpp,ID_verilog_bit_selectbranch on array types: the layout differs for packed arrays.