Final blocks and non-blocking assignments? #405
-
To learn the code-base, I picked (at random) a failing ivtest case to try and resolve: https://chipsalliance.github.io/sv-tests-results/#Slang|ivtest|regress-sv_program3b_iv To avoid Program related issues, (since no one cares about Programs :-), I changed the test case to be simpler:
The ivtest appears to want non-blocking assignments in final-blocks to be rejected at compile. The LRM says:
VCS accepts this code which seems LRM compliant and the ivtest appears wrong. On the other hand, a non-blocking assignment in a final-block is nonsensical since it becomes a no-op and this is almost certainly a coding error if it occurs, so flagging an error does seem appropriate. Any opinions? Note: To implement the check, I ended up splitting out FunctionOrFinal to be independent Function/Final flags, but there may have been a simpler method. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hmm yeah, I think a strict reading implies this is legal, but as you say it's a useless statement. VCS allows this, Questa disallows it, and Xcelium reports a warning. I think that latter approach is best; issue an on-by-default warning that the statement is likely a mistake. I agree that this probably means we need a separate BindFlag for Function and Final. |
Beta Was this translation helpful? Give feedback.
Hmm yeah, I think a strict reading implies this is legal, but as you say it's a useless statement. VCS allows this, Questa disallows it, and Xcelium reports a warning. I think that latter approach is best; issue an on-by-default warning that the statement is likely a mistake.
I agree that this probably means we need a separate BindFlag for Function and Final.