VERILOG2023: Implicit conversions that truncate a type should be avoided
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 15min | synthesis, vscode, simulation, linter |
Description
An implicit conversion in an expression truncating a type, potentially loses data.
Carefully review this implicit conversion and add an explicit cast if it is intentional to silence the issue.
Noncompliant code example
int a; logic [1:0] b = a;
Compliant solution
int a; logic [1:0] b = logic [1:0]'(a);
Parameters
No parameters.