VERILOG2094: An open range with constant bounds should not be reversed
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| HIGH | - | - | Intentionality | Logical | 5min | synthesis, vscode, linter, simulation |
Description
Noncompliant code example
class Fly;
rand bit [4:0] a;
constraint a_c {
a dist { 16 :/ 1, [15:1] :/ 1}; // Noncompliant
}
endclass
An open range with constant bounds is reversed (i.e. has a larger left-hand side compared to its right). Such a range will behave as if it is empty and therefore never be selected.
Parameters
No parameters.