New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Wno-lint disables LITENDIAN and allows silent generation of code inconsistent with other simulators #1631
Comments
Original Redmine Comment Changing only the declaration of inc from an N-bit LE vector, to a an N element LE array, makes the output match, and avoids the LITENDIAN warning -wire [0:N-1] inc; VCS and Verilator also differ if the ONLY change made it to reverse the bit order of the inc vector to wire [N-1:0] inc; This implies to me there is a difference in the way the bits of the vector are being applies to the individual instances of the array of instances. |
Original Redmine Comment Actually, the difference between VCS and Verilator is that when connecting the elements of the +array+ 'cval' to the array of instances, Verilator ignores the direction of the range in the declaration of the 'cval' array, but VCS does not. Both VCS and Verilator however 'honour' the order of the range used to declare the array of instances. Attaching a second testcase to better illustrate this by executing with all 4 possible combinations of range order: |
Original Redmine Comment A brief scan of the LRM has left me still unsure of what the correct behaviour should be |
Original Redmine Comment LITENDIAN was intended not to change the results. Can you please run this on all of the big-3 e.g. on edaplayground to see if there's a consensus? |
Original Redmine Comment VCS and NCSIM behave the same. I do not have access to Modelsim and it does not appear to be an option on edaplayground. Aldec Riviera Pro however (which I'd never heard of) behaves the same way as Verilator. |
Original Redmine Comment Ok, seems reasonable to clean this up then. Perhaps you could try to put together a patch? The code that does this expansion is V3Inst. |
Original Redmine Comment Ok, Ill take a look |
Original Redmine Comment This fixes it:
|
Original Redmine Comment No new failures in regression |
Original Redmine Comment Patch looks good, can you please also update one of the test_regress tests to show the issue so it doesn't break in the future, then attach the diff? Note you can cross check with e.g. VCS by running "test_regress/t/testname.pl --vcs" Do you have a github user name? Thanks |
Original Redmine Comment Will do. |
Original Redmine Comment Patch and new test attached |
Original Redmine Comment Excellent, thanks. Pushed to git towards eventual 4.026 release. |
Author Name: Julien Margetts
Original Redmine Issue: 1631 from https://www.veripool.org
Original Assignee: Julien Margetts
The manual states "Ranges must be big-bit-endian" so I think LITENDIAN should not be a member of lintError() and should be a more serious error, amybe adding it to the dangerous() set?
The attached testcase (complicated by also containing a little-endian array of instances - may not be necessary but its how I discovered it) highlights the mismatch between Verilator and in this case VCS
The text was updated successfully, but these errors were encountered: