Inconsistent LITENDIAN warnings on arrays #1382
Labels
area: data-types
Issue involves data-types
area: lint
Issue involves SystemVerilog lint checking
effort: hours
Expect this issue to require roughly hours of invested effort to resolve
resolution: abandoned
Closed; not enough information or otherwise never finished
Author Name: Al Grant
Original Redmine Issue: 1382 from https://www.veripool.org
This is something that has come up before in #614 and #1202 but still doesn't seem quite right as of 4.008. In this code:
Verilator warns as shown. This is in accordance with the resolution to #614 which was to warn for ascending dimensions when packed but not when unpacked. But what's really the issue here is whether the dimension is of a bit vector or not, i.e. would define the bit indexes into a contiguous bit vector that ends up as a single C object. And that to me looks independent of whether it's packed or unpacked - it has much more to do with whether the dimension is the first dimension or not. It just happens that often in cases like
the first dimension is a bit index and the second one isn't - so #644's rule that says to warn about packed but not unpacked turns out to do what we want. In cases like
it's less clear - perhaps Verilator would treat this as a 4x4 bit matrix and pack it into one word. But either way, whether it's packed or unpacked makes no difference. It's the order of the dimensions, and the overall size of the object as each dimension is applied, which determines whether objects might be packed into a bit vector.
I'd suggest a different rule:
This also does the right thing for arrays of structures. It makes the warning much more dependent on how objects are or aren't represented as data, and much less on how they are syntactically expressed in the source.
The text was updated successfully, but these errors were encountered: