-
Notifications
You must be signed in to change notification settings - Fork 306
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
[Verif] LowerContractsPass #7870
base: main
Are you sure you want to change the base?
Conversation
leonardt
commented
Nov 21, 2024
- Adds pass to convert hw modules containing contracts into verif.formal tests with contracts inlined
- ensure -> assert, require -> assume
- Adds tests for multiplier, carry save compressor, and shift left
patterns.add<HWOpRewritePattern>(patterns.getContext()); | ||
|
||
if (failed(applyPatternsAndFoldGreedily(getOperation(), std::move(patterns)))) | ||
signalPassFailure(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you are only matching on modules, you can also just have a for
loop iterating over the modules, which would be a bit more efficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file contains tests that are great as integration tests, but for regression tests we want to check the corner cases and keep the tests small (they don't have to do something that makes sense from a design implementation/logics perspective). For example, there's no test of a module with more than one contract inside, with zero contracts inside. Deleting the module also only works because you have no other module instantiating it.
Co-authored-by: Martin Erhart <[email protected]>
Really cool! 🥳 Instead of converting modules to If a contract has another contract somewhere in its fan-in cone of operands, we should be able to just assume that that other contract holds by directly inlining it. Maybe there's an interleaving of steps that would do all of this, something like:
I think that would get you the inlining of contracts everywhere, except for the one formal test that checks a contract, where we would check the actual design in the module against the contract body. |