3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-06-22 16:23:42 +00:00

Add inductive invariants example

Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
This commit is contained in:
Claire Xenia Wolf 2021-12-17 15:42:04 +01:00
parent ab9d4fd3cf
commit 4a07e026dd
6 changed files with 290 additions and 0 deletions

View file

@ -0,0 +1,18 @@
module example(clk, state);
input logic clk;
output logic [4:0] state = 27;
always_ff @(posedge clk) state <= (5'd 2 * state - 5'd 1) ^ (state & 5'd 7);
let p0 = (state != 0);
let p1 = (state inside {28, 19, 6, 13});
let p2 = (state inside {28, 19, 6, 13, 22, 27});
let p3 = (state[0] & state[1]) ^ state[2];
`ifdef ASSERT_PX
always_comb assert (`ASSERT_PX);
`endif
`ifdef ASSUME_PX
always_comb assume (`ASSUME_PX);
`endif
endmodule