Browse Source

Make the unbounded prove work

* Fixed bug in check for end value in counter unit ;)
* Use abc engine with pdr solver
* Add asserts for reset
verific_problem
T. Meissner 6 years ago
parent
commit
9d03113704
3 changed files with 17 additions and 4 deletions
  1. +1
    -1
      counter/counter.vhd
  2. +2
    -1
      counter/counter_f.sby
  3. +14
    -2
      counter/counter_t.sv

+ 1
- 1
counter/counter.vhd View File

@ -28,7 +28,7 @@ begin
if (Reset_n_i = '0') then if (Reset_n_i = '0') then
Data_o <= std_logic_vector(to_unsigned(Init, Data_o'length)); Data_o <= std_logic_vector(to_unsigned(Init, Data_o'length));
elsif (rising_edge(Clk_i)) then elsif (rising_edge(Clk_i)) then
if (unsigned(Data_o) <= 64) then
if (unsigned(Data_o) < 64) then
Data_o <= std_logic_vector(unsigned(Data_o) + 1); Data_o <= std_logic_vector(unsigned(Data_o) + 1);
end if; end if;
end if; end if;


+ 2
- 1
counter/counter_f.sby View File

@ -3,7 +3,8 @@ mode prove
multiclock on multiclock on
[engines] [engines]
smtbmc
#smtbmc
abc pdr
[script] [script]
verific -vhdl counter.vhd verific -vhdl counter.vhd


+ 14
- 2
counter/counter_t.sv View File

@ -17,8 +17,11 @@ module counter_t (
reg init_state = 1; reg init_state = 1;
always @(*)
// Initial reset
always @(*) begin
if (init_state) assume (!Reset_n_i); if (init_state) assume (!Reset_n_i);
if (!init_state) assume (Reset_n_i);
end
always @(posedge Clk_i) always @(posedge Clk_i)
init_state = 0; init_state = 0;
@ -32,9 +35,18 @@ module counter_t (
*/ */
// Proves fail, counterexample hasn't initial reset active
// Intermediate assertions
always @(*)
if (!Reset_n_i) assert (Data_o == `INIT_VALUE);
// Fail with unbounded prove using SMTBMC, maybe the assertions have to be more strict
// there have to be more restrictions.
// With abc pdr is can be successfully proved
assert property (@(posedge Clk_i) Data_o >= `INIT_VALUE && Data_o <= 64); assert property (@(posedge Clk_i) Data_o >= `INIT_VALUE && Data_o <= 64);
assert property (@(posedge Clk_i) disable iff (!Reset_n_i) Data_o < 64 |=> Data_o == $past(Data_o) + 1); assert property (@(posedge Clk_i) disable iff (!Reset_n_i) Data_o < 64 |=> Data_o == $past(Data_o) + 1);
assert property (@(posedge Clk_i) disable iff (!Reset_n_i) Data_o == 64 |=> $stable(Data_o));
endmodule endmodule


Loading…
Cancel
Save