Skip to content

Instantly share code, notes, and snippets.

@cr1901
Created August 9, 2017 06:57
Show Gist options
  • Save cr1901/095ce91a288e11bd6107493b1c0ecd21 to your computer and use it in GitHub Desktop.
Save cr1901/095ce91a288e11bd6107493b1c0ecd21 to your computer and use it in GitHub Desktop.
BMC/Temp Ind Mismatch?
my_hello1: my_hello1.smt2
yosys-smtbmc -s z3 --dump-smt2 my_hello1_full_bmc.smt2 --dump-vcd my_hello1_bmc.vcd my_hello1.smt2
yosys-smtbmc -s z3 -i --dump-smt2 my_hello1_full_tmp.smt2 --dump-vcd my_hello1_tmp.vcd my_hello1.smt2
my_hello1.smt2: my_hello1.v
yosys -ql my_hello1.yslog \
-p 'read_verilog -formal my_hello1.v' \
-p 'prep -top my_hello -nordff' \
-p 'clk2fflogic; opt_clean' \
-p 'write_verilog my_hello_clk2ff.v' \
-p 'write_smt2 -wires my_hello1.smt2'
clean::
rm -f my_hello1.yslog *.smt2 my_hello1*.vcd my_hello_clk2ff.v
module my_hello(input clk, input rst, output [3:0] cnt);
reg [3:0] cnt = 0;
//reg my_clk = 0;
/* always @(posedge clk) begin
my_clk <= ~my_clk;
end */
//always @(posedge my_clk) begin
always @(posedge clk) begin
if (rst)
cnt <= 0;
else
cnt <= cnt + 1;
end
`ifdef FORMAL
//initial begin
// assume(rst);
//end
assume property (cnt != 3);
assert property (cnt != 5);
endmodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment