3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-21 11:52:07 +00:00

Added examples/smtbmc/demo2.v

This commit is contained in:
Clifford Wolf 2016-08-20 18:44:27 +02:00
parent f7578b0239
commit a93fcec93f
3 changed files with 45 additions and 3 deletions

29
examples/smtbmc/demo2.v Normal file
View file

@ -0,0 +1,29 @@
// Nothing to prove in this demo.
// Just an example for memories, vcd dumps and vlog testbench dumps.
`ifdef FORMAL
`define assume(_expr_) assume(_expr_)
`else
`define assume(_expr_)
`endif
module demo2(input clk, input [4:0] addr, output reg [31:0] data);
reg [31:0] mem [0:31];
always @(posedge clk)
data <= mem[addr];
reg [31:0] used_addr = 0;
reg [31:0] used_dbits = 0;
reg initstate = 1;
always @(posedge clk) begin
initstate <= 0;
`assume(!used_addr[addr]);
used_addr[addr] <= 1;
if (!initstate) begin
`assume(data != 0);
`assume((used_dbits & data) == 0);
used_dbits <= used_dbits | data;
end
end
endmodule