Trying to verify Verilog/VHDL designs with formal methods and tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
716 B

  1. module counter_t (
  2. inout Reset_n_i,
  3. input Clk_i,
  4. input [31:0] Data_i,
  5. output [31:0] Data_o
  6. );
  7. counter counter_i (
  8. .Reset_n_i(Reset_n_i),
  9. .Clk_i(Clk_i),
  10. .Data_o(Data_o)
  11. );
  12. reg init_state;
  13. initial init_state = 1;
  14. always @(posedge Clk_i)
  15. init_state = 0;
  16. always @(*)
  17. assume (Reset_n_i == ~init_state);
  18. /*
  19. // Don't works with Verific at the moment
  20. initial begin
  21. assume (!Reset_n_i);
  22. end
  23. */
  24. // Proves fail, counterexample hasn't initial reset active
  25. assert property (@(posedge Clk_i) Data_o >= 8 && Data_o <= 64);
  26. assert property (@(posedge Clk_i) disable iff (!Reset_n_i) Data_o < 64 |=> Data_o == $past(Data_o) + 1);
  27. endmodule