VERILOG2056: Implicit conversion from a floating point value to an integer value should be reviewed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 10min | synthesis, vscode, simulation, linter |
Description
A floating point value (real or shortreal) is implicitly converted to an integer.
This is not necessarily wrong but make sure that it is really what was supposed to be implemented. If so, add an explicit cast.
Noncompliant code example
function automatic f(real r); int i = r; endfunction
Compliant solution
function automatic f(real r); int i = int'(r); endfunction
Parameters
No parameters.