3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-08-05 19:00:26 +00:00

Add support for optimizing exists-forall problems.

Modifies smt2 backend to recognize `$anyconst` etc. assigned to a wire with the `maximize` or `minimize` attribute and emit `; yosys-smt2-maximize` or `; yosys-smt2-minimize` directives as appropriate.
Modifies `backends/smt2/smtbmc.py` and `smtio.py` to recognize those directives and emit a `(maximize ...)` or `(minimize ...)` command at the end of `smt_forall_assert()`, as described in the paper "νZ - An Optimizing SMT Solver" by Nikolaj Bjørner et al.
Adds an example `examples/smtbmc/demo9.v` to show how it can be used.
This commit is contained in:
Alberto Gonzalez 2020-03-08 06:34:47 +00:00
parent bfeba9ad11
commit 0fda8308bc
5 changed files with 55 additions and 3 deletions

13
examples/smtbmc/demo9.v Normal file
View file

@ -0,0 +1,13 @@
module demo9;
(* maximize *) wire[7:0] h = $anyconst;
wire [7:0] i = $allconst;
wire [7:0] t0 = ((i << 8'b00000010) + 8'b00000011);
wire trigger = (t0 > h) && (h < 8'b00000100);
always @* begin
assume(trigger == 1'b1);
cover(1);
end
endmodule