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:
parent
ab9d4fd3cf
commit
4a07e026dd
6 changed files with 290 additions and 0 deletions
18
docs/examples/indinv/example.sv
Normal file
18
docs/examples/indinv/example.sv
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue