diff --git a/docs/CONTRIBUTORS b/docs/CONTRIBUTORS index 791205edf..aad4beb04 100644 --- a/docs/CONTRIBUTORS +++ b/docs/CONTRIBUTORS @@ -14,6 +14,7 @@ Ameya Vikram Singh Andreas Kuster Andrew Nolte Arkadiusz Kozdra +Cameron Kirk Chris Randall Chuxuan Wang Conor McCullough diff --git a/docs/guide/warnings.rst b/docs/guide/warnings.rst index b0fee4695..ccfb0e763 100644 --- a/docs/guide/warnings.rst +++ b/docs/guide/warnings.rst @@ -850,14 +850,14 @@ List Of Warnings .. TODO better example - Warns that a packed vector is declared with little endian bit numbering - (i.e. [0:7]). Big endian bit numbering is now the overwhelming - standard, and little numbering is now thus often due to simple oversight + Warns that a packed vector is declared with big endian bit numbering + (i.e. [0:7]). Little endian bit numbering is now the overwhelming + standard, and big numbering is now thus often due to simple oversight instead of intent. - It also warns that an instance is declared with little endian range - (i.e. [0:7] or [7]) and is connected to an N-wide signal. Based on IEEE - the bits will likely be backward from what people may expect + It also warns that an instance is declared with big endian range + (i.e. [0:7] or [7]) and is connected to an N-wide signal. + The bits will likely be backward from what people may expect (i.e., instance [0] will connect to signal bit [N-1] not bit [0]). Ignoring this warning will only suppress the lint check; it will diff --git a/src/V3Inst.cpp b/src/V3Inst.cpp index 533fccd0e..78ea53c8f 100644 --- a/src/V3Inst.cpp +++ b/src/V3Inst.cpp @@ -343,7 +343,7 @@ private: // Arrayed instants: one bit for each of the instants (each // assign is 1 modwidth wide) if (m_cellRangep->littleEndian()) { - nodep->exprp()->v3warn(LITENDIAN, "Little endian instance range connecting to " + nodep->exprp()->v3warn(LITENDIAN, "Big endian instance range connecting to " "vector: left < right of instance range: [" << m_cellRangep->leftConst() << ":" << m_cellRangep->rightConst() << "]"); diff --git a/src/V3Width.cpp b/src/V3Width.cpp index 62b5ed5cf..2b582278a 100644 --- a/src/V3Width.cpp +++ b/src/V3Width.cpp @@ -860,7 +860,7 @@ private: // Note width() not set on range; use elementsConst() if (nodep->littleEndian() && !VN_IS(nodep->backp(), UnpackArrayDType) && !VN_IS(nodep->backp(), Cell)) { // For cells we warn in V3Inst - nodep->v3warn(LITENDIAN, "Little bit endian vector: left < right of bit range: [" + nodep->v3warn(LITENDIAN, "Big bit endian vector: left < right of bit range: [" << nodep->leftConst() << ":" << nodep->rightConst() << "]"); } diff --git a/test_regress/t/t_dist_warn_coverage.pl b/test_regress/t/t_dist_warn_coverage.pl index b7eb7e1d7..7fb44afc5 100755 --- a/test_regress/t/t_dist_warn_coverage.pl +++ b/test_regress/t/t_dist_warn_coverage.pl @@ -31,6 +31,7 @@ foreach my $s ( 'dynamic new() not expected in this context (expected under an assign)', # Instead get syntax error # Not yet analyzed ' is not an in/out/inout/param/interface: ', + 'Big endian instance range connecting to ', ' loading non-variable', '--pipe-filter protocol error, unexpected: ', '/*verilator sformat*/ can only be applied to last argument of ', diff --git a/test_regress/t/t_interface_array_nocolon_bad.out b/test_regress/t/t_interface_array_nocolon_bad.out index f741b3b24..b189edec7 100644 --- a/test_regress/t/t_interface_array_nocolon_bad.out +++ b/test_regress/t/t_interface_array_nocolon_bad.out @@ -1,18 +1,18 @@ -%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:26:26: Little endian instance range connecting to vector: left < right of instance range: [0:2] +%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:26:26: Big endian instance range connecting to vector: left < right of instance range: [0:2] : ... In instance t 26 | foo_intf foos [N] (.x(X)); | ^ ... For warning description see https://verilator.org/warn/LITENDIAN?v=latest ... Use "/* verilator lint_off LITENDIAN */" and lint_on around source to disable this message. -%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:27:28: Little endian instance range connecting to vector: left < right of instance range: [1:3] +%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:27:28: Big endian instance range connecting to vector: left < right of instance range: [1:3] : ... In instance t 27 | foo_intf fool [1:3] (.x(X)); | ^ -%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:30:26: Little endian instance range connecting to vector: left < right of instance range: [0:2] +%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:30:26: Big endian instance range connecting to vector: left < right of instance range: [0:2] : ... In instance t 30 | foo_subm subs [N] (.x(X)); | ^ -%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:31:28: Little endian instance range connecting to vector: left < right of instance range: [1:3] +%Warning-LITENDIAN: t/t_interface_array_nocolon_bad.v:31:28: Big endian instance range connecting to vector: left < right of instance range: [1:3] : ... In instance t 31 | foo_subm subl [1:3] (.x(X)); | ^ diff --git a/test_regress/t/t_metacmt_onoff.out b/test_regress/t/t_metacmt_onoff.out index f57aee5e4..4c6ca3bf2 100644 --- a/test_regress/t/t_metacmt_onoff.out +++ b/test_regress/t/t_metacmt_onoff.out @@ -1,10 +1,10 @@ -%Warning-LITENDIAN: t/t_metacmt_onoff.v:8:8: Little bit endian vector: left < right of bit range: [0:1] +%Warning-LITENDIAN: t/t_metacmt_onoff.v:8:8: Big bit endian vector: left < right of bit range: [0:1] : ... In instance t 8 | reg [0:1] show1; /*verilator lint_off LITENDIAN*/ reg [0:2] ign2; /*verilator lint_on LITENDIAN*/ reg [0:3] show3; | ^ ... For warning description see https://verilator.org/warn/LITENDIAN?v=latest ... Use "/* verilator lint_off LITENDIAN */" and lint_on around source to disable this message. -%Warning-LITENDIAN: t/t_metacmt_onoff.v:8:109: Little bit endian vector: left < right of bit range: [0:3] +%Warning-LITENDIAN: t/t_metacmt_onoff.v:8:109: Big bit endian vector: left < right of bit range: [0:3] : ... In instance t 8 | reg [0:1] show1; /*verilator lint_off LITENDIAN*/ reg [0:2] ign2; /*verilator lint_on LITENDIAN*/ reg [0:3] show3; | ^ diff --git a/test_regress/t/t_param_module.v b/test_regress/t/t_param_module.v index 89d8e77bc..18369db2c 100644 --- a/test_regress/t/t_param_module.v +++ b/test_regress/t/t_param_module.v @@ -7,7 +7,7 @@ // used in the test module to set the value of MSB. A number of warnings and // errors follow, starting with: // -// %Warning-LITENDIAN: t/t_param_module.v:42: Little bit endian vector: MSB +// %Warning-LITENDIAN: t/t_param_module.v:42: Big bit endian vector: MSB // < LSB of bit range: -17:0 // // This file ONLY is placed into the Public Domain, for any use, without diff --git a/test_regress/t/t_select_bad_msb.out b/test_regress/t/t_select_bad_msb.out index 6c52f62b3..1ec1c350e 100644 --- a/test_regress/t/t_select_bad_msb.out +++ b/test_regress/t/t_select_bad_msb.out @@ -1,4 +1,4 @@ -%Warning-LITENDIAN: t/t_select_bad_msb.v:12:8: Little bit endian vector: left < right of bit range: [0:22] +%Warning-LITENDIAN: t/t_select_bad_msb.v:12:8: Big bit endian vector: left < right of bit range: [0:22] : ... In instance t 12 | reg [0:22] backwd; | ^