Fix false warning on backward indexing, bug1507.

This commit is contained in:
Wilson Snyder 2019-09-17 15:17:23 -04:00
parent 3469c78153
commit 900115bb2d
3 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
**** Fix config_rev revision detection on old versions.
**** Fix false warning on backward indexing, bug1507. [Hao Shi]
* Verilator 4.018 2019-08-29

View File

@ -755,7 +755,8 @@ private:
<<" outside data type's '"<< adtypep->declRange() << "'");
}
else if ((nodep->declRange().littleEndian()
!= adtypep->declRange().littleEndian())) {
!= adtypep->declRange().littleEndian())
&& nodep->declRange().hi() != nodep->declRange().lo()) {
nodep->v3error("Slice selection '"<< nodep->declRange() << "'"
<<" has backward indexing versus data type's '"
<<adtypep->declRange() << "'");

View File

@ -15,6 +15,8 @@ module t (/*AUTOARG*/);
array_assign[4:3] = '{32'd4, 32'd3};
array_assign[1:-1] = '{32'd4, 32'd3};
array_assign[1:1] = '{32'd4}; // Ok
larray_assign[1:1] = '{32'd4}; // Ok
$write("*-* All Finished *-*\n");
$finish;