You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes one might want to create a Const which requires passing an integer, but the integer doesn't "fit" in the specified width of the constant signal. The current behavior is just truncation, meaning the constant value doesn't match the value of the original int.
Desired solution
A warning, error, exception, or something along those lines making it more difficult to accidentally truncate the desired constant value.
The text was updated successfully, but these errors were encountered:
Const should have a flag like allowTruncation or something to override
negative numbers shouldn't flag this (e.g. -1 has sign extension). One possible way to check is to make sure the int/bigint value after conversion is the same if input is negative int/bigint
Motivation
Sometimes one might want to create a
Const
which requires passing an integer, but the integer doesn't "fit" in the specified width of the constant signal. The current behavior is just truncation, meaning the constant value doesn't match the value of the originalint
.Desired solution
A warning, error, exception, or something along those lines making it more difficult to accidentally truncate the desired constant value.
The text was updated successfully, but these errors were encountered: