VERILOG2099: Dist weight operators (“:=”, “:/”) should not be split
Summary
| Reliability | Security | Maintainability | Code attribute | Effort to fix | Tags |
|---|---|---|---|---|---|
| LOW | - | - | Consistency | Conventional | 10min | synthesis, portability, vscode, linter, simulation |
Description
Noncompliant code example
class Fly;
rand int val;
constraint cst_sum {
val dist {1 : = 10, 4 : / 20};
}
endclass
Compliant solution
class Fly;
rand int val;
constraint cst_sum {
val dist {1 := 10, 4 :/ 20}:
}
endclass
Some tools allow the dist weight operators (:=, :/) to be split instead of a single token.
To keep your code portable, stick to the standard way of writing those operators.
Parameters
No parameters.