Add hint of the signed rhsval in oversized replication error (#6098)

This commit is contained in:
Peter Birch 2025-06-18 00:59:18 +01:00 committed by GitHub
parent 48600c77b5
commit 75df36bc8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -180,6 +180,7 @@ Paul Wright
Pawel Jewstafjew
Pawel Sagan
Pengcheng Xu
Peter Birch
Peter Debacker
Peter Horvath
Peter Monsson

View File

@ -1474,7 +1474,7 @@ V3Number& V3Number::opRepl(const V3Number& lhs,
if (rhsval > (1UL << 24)) {
v3error("More than a 16 Mbit replication, perhaps the replication factor"
" was two's-complement negative: "
<< rhsval);
<< rhsval << " (" << static_cast<int32_t>(rhsval) << ")");
} else if (rhsval > 8192) {
v3warn(WIDTHCONCAT, "More than a 8k bit replication is probably wrong: " << rhsval);
}

View File

@ -1,4 +1,4 @@
%Error: t/t_math_repl2_bad.v:28:30: More than a 16 Mbit replication, perhaps the replication factor was two's-complement negative: 4294967291
%Error: t/t_math_repl2_bad.v:28:30: More than a 16 Mbit replication, perhaps the replication factor was two's-complement negative: 4294967291 (-5)
: ... note: In instance 't'
28 | out <= {{(P24 - P29){1'b0}}, in};
| ^