Skip to content
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

Numeric literals may overflow without a warning #1156

Closed
veripoolbot opened this issue Apr 13, 2017 · 2 comments
Closed

Numeric literals may overflow without a warning #1156

veripoolbot opened this issue Apr 13, 2017 · 2 comments
Assignees
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed

Comments

@veripoolbot
Copy link
Contributor


Author Name: Todd Strader (@toddstrader)
Original Redmine Issue: 1156 from https://www.veripool.org

Original Assignee: Todd Strader (@toddstrader)


Here is a test and a patch:
https://github.com/toddstrader/verilator-dev/tree/literal_range_check

The problem exists when there is enough storage for the literal value in the array of 32-bit chunks but the bit width is too small to contain the number (e.g. 8'd256).

I am aware that the LRM says (section 5.7.1):

If the size of the unsigned number is larger than the
size specified for the literal constant, the unsigned number shall be truncated from the left.

However, I believe this change is in line with the rest of Verilator's WIDTH class of checks.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-04-26T22:34:51Z


Thanks again!

Pushed to git towards 3.903.

@veripoolbot
Copy link
Contributor Author


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2017-05-31T02:07:02Z


In 3.904.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: lint Issue involves SystemVerilog lint checking resolution: fixed Closed; fixed
Projects
None yet
Development

No branches or pull requests

2 participants