Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs where SSA could potentially generate inferred latches #391

Merged
merged 4 commits into from
Jul 14, 2023

Conversation

mkorbel1
Copy link
Contributor

Description & Motivation

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?

No

@mkorbel1 mkorbel1 merged commit 160eb5c into intel:main Jul 14, 2023
@mkorbel1 mkorbel1 deleted the ssa_nolatch branch July 14, 2023 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant