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.

41 lines
728 B

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