Sometimes an intermediate SSA signal in a Combinational that generates phi signals could be undriven in other clauses (If and Case). This is functionally fine since those intermediate signals are unused in the other clauses, however synthesis tools may infer a latch on them. This also means SV linting tools will flag errors, since the synthesis tool may infer a latch.
This PR sets these unimportant intermediate signals to 0 in unused cases. It would be better if synthesis tools could be told to treat something as a dont-care instead of 0, but this is the best solution for now without that.
Also, this fixes a bug in Case where SSA could be missing a default item, which breaks the phi logic.
Also, this fixes a bug in If where an extra empty "else" clause is generated sometimes in SSA.
Related Issue(s)
N/A
Testing
Added new tests to check for inferred latches (indicated by X's in certain situations in the ROHD simulations since signals are undriven).
Backwards-compatibility
Is this a breaking change that will not be backwards-compatible? If yes, how so?
No, only if someone was depending on the bugs.
Documentation
Does the change require any updates to documentation? If so, where? Are they included?
Description & Motivation
Sometimes an intermediate SSA signal in a
Combinational
that generates phi signals could be undriven in other clauses (If
andCase
). This is functionally fine since those intermediate signals are unused in the other clauses, however synthesis tools may infer a latch on them. This also means SV linting tools will flag errors, since the synthesis tool may infer a latch.This PR sets these unimportant intermediate signals to 0 in unused cases. It would be better if synthesis tools could be told to treat something as a dont-care instead of 0, but this is the best solution for now without that.
Also, this fixes a bug in
Case
where SSA could be missing a default item, which breaks the phi logic. Also, this fixes a bug inIf
where an extra empty "else" clause is generated sometimes in SSA.Related Issue(s)
N/A
Testing
Added new tests to check for inferred latches (indicated by X's in certain situations in the ROHD simulations since signals are undriven).
Backwards-compatibility
No, only if someone was depending on the bugs.
Documentation
No