While reviewing LINT errors from an industry tool, we found a real RTL width-mismatch bug that is not reported by Slang. I was expecting that -Wwidth-expand should flag an error for both the param and the logic-var assignments in the below example.
The LHS is 40 bits and the RHS is 30 bits for both the param and the logic-var. The RTL bug was that the 2nd packed dimension was changed from 5:0 to 7:0 without increasing the width from 6-bits to 8-bits in the concatenation values. This resulted in getting unintended values when directly accessing A[1], A[2], etc.
-Wpacked-array-conv also does not trigger.
module top;
localparam bit [4:0][7:0] A = {
6'd2,
6'd4,
6'd9,
6'd24,
6'd24
};
logic [4:0][7:0] b;
always_comb begin
b = {
6'd2,
6'd4,
6'd9,
6'd24,
6'd24
};
end
endmodule