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

Add support for Yosys $live cell (needed for liveness proofs) #152

Open
tmeissner opened this issue Aug 3, 2021 · 2 comments
Open

Add support for Yosys $live cell (needed for liveness proofs) #152

tmeissner opened this issue Aug 3, 2021 · 2 comments

Comments

@tmeissner
Copy link
Contributor

tmeissner commented Aug 3, 2021

I've done some tests with liveness proofs using PSL properties like:

assert always (rose(a) -> eventually! b);

I noticed that such constructs are processed by GHDL (and Yosys), but Symbiyosys crashes with a Python assertion. Aside from the non-handled assertion in SymbiYosys, there seems to be no support for Yosys' $live cells. These are needed for liveness proofs. There is a function in the yosys kernel (kernel/rtlil.h) to create such cells, but the ghdl-yosys-plugin doesn't use it.

RTLIL::Cell* addLive   (RTLIL::IdString name, const RTLIL::SigSpec &sig_a, const RTLIL::SigSpec &sig_en, const std::string &src = "");

If ghdl-yosys-plugin want to support liveness properties correctly for formal verification, such a $live cell has to be created for PSL properties when liveness properties are used. AFAIK using non-negated strong operators usually results in
a liveness property. The only strong PSL operator which GHDL synthesis currently supports is the eventually! operator.

Notice that we had a similar issue some time ago in ghdl: ghdl/ghdl#1345
I assume that the non working liveness proof in that issue is caused by GHDL which doesn't create the $live cells needed for these kind of proofs.

@tgingold
Copy link
Member

tgingold commented Aug 4, 2021 via email

@tmeissner
Copy link
Contributor Author

tmeissner commented Aug 5, 2021

AFAIK liveness proofs are supported by superprove (suprove) and aiger-bmc (aigbmc). I've tested it with superprove.

I assume we would have to support like Yosys does it for the SVA unbounded s_eventually operator.

Maybe we write $assert and $live cells for such properties. I think that Yosys selects the cell types which are supported in the which mode. I've noticed that Yosys hands over only the appropriate cells when starting the solver. in mode live normal $assertcells are ignored, they aren't included in the aiger file which these solvers use.

I've looked into the yosys logs. When using mode live following transformations are done:

chformal -assume -early
chformal -assert2assume
chformal -cover -remove

In mode bmc these are done:

chformal -assume -early
chformal -live -fair -cover -remove

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

No branches or pull requests

2 participants