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

chformal: Add -coverenable option #2995

Merged
merged 4 commits into from
Feb 14, 2023
Merged

Conversation

georgerennie
Copy link
Collaborator

@georgerennie georgerennie commented Sep 4, 2021

This inserts $cover cells to cover the enable signal (precondition/antecedent) for the selected formal cells. This allows you to check that your properties are not vacuous.

This will not cover preconditions that you write as part of the statement (e.g. this will cover a for if (a) assert(b), but not for assert(!a || b)). This should also work with preconditions arising from SVA in the verific front end (if the preconditions are converted to the enable signal as I believe they are?) but I do not have a copy to check (it does not as sequential properties are more complex).

@georgerennie georgerennie force-pushed the cover_precond branch 3 times, most recently from 4426777 to 7d223eb Compare October 14, 2021 13:17
@jix
Copy link
Member

jix commented May 31, 2022

This seems like a very useful addition. While this is similar to select */t:$assert %ci:+$assert[EN]; supercover, supercover adds $cover cells for both the signal and the inverted signal and it ignores constant signals. I think adding an option to supercover to only cover one polarity and one to not ignore constant signals might be useful in general, but the required select statement is complicated enough that a dedicated option for chformal like this still seems warranted.

I added a test and changed it so it keeps the src attribute without prepending anything. That attribute is supposed to only contain source locations. Current versions of sby with smtbmc will display both the source location as well as the cell name. By using NEW_ID_SUFFIX("coverprecond") we still get a cell name that does point to the coverprecond feature specifically.

As you merged the yosys master back into your PR branch, I'm not sure if things go well if I merge this back again. I decided to cherry pick your commit, which also keeps my changes on top next to your commit. If you force push my https://github.com/jix/yosys/tree/chformal_coverprecond to your branch I can merge this PR (GitHub might also allow me to push to your PR branch, but I saw you're actively using this branch outside of this PR).

@georgerennie
Copy link
Collaborator Author

Sure, I can force push your branch. I had a thought about this feature the other day. Although I originally said I thought this might work with SVA implications from the verific frontend, I think it won't actually because you can have sequences on the right hand side of the implication (and I'm not certain the precondition is used as the enable for an assertion anyway).

Thus I think it might be worth renaming this feature to something like -coverenable, to make it clear that this just covers the enable signal of a direct assertion/assumption/etc.

The final remarks section in the yosyshq precondition cover app note also mentions potentially being able to automatically cover SVA preconditions in the future so it would be best not to confuse this feature with that one.

georgerennie and others added 3 commits June 18, 2022 18:19
@georgerennie georgerennie changed the title chformal: Add -coverprecond option chformal: Add -coverenable option Jun 18, 2022
@georgerennie
Copy link
Collaborator Author

Any chance of this (and #3126) getting merged any time soon @jix?

@jix jix self-assigned this Feb 9, 2023
@jix
Copy link
Member

jix commented Feb 9, 2023

Yeah, I just needed a reminder 😅️ For this one I still want to review any differences in generated enable signals between the open source and the verific frontend, just so we can document any differences in the resulting behavior when using this. I should be able to do that before the next release.

@jix jix merged commit ec94703 into YosysHQ:master Feb 14, 2023
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.

2 participants