prod2u_6400_target_store_formal.v 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. `timescale 1ns/1ps
  2. module prod2u_6400_target_store_formal (
  3. input wire clk,
  4. input wire rst_n,
  5. input wire enable,
  6. input wire tick_500us,
  7. input wire valid_set_all_commit,
  8. input wire [7:0] duty,
  9. input wire [6:0] phase
  10. );
  11. wire watchdog_active;
  12. wire timeout_event;
  13. wire logical_on = duty > {1'b0, phase};
  14. host_watchdog #(.TIMEOUT_TICKS(8)) wd (
  15. .clk(clk), .rst_n(rst_n), .enable(enable), .tick_500us(tick_500us),
  16. .valid_set_all_commit(valid_set_all_commit),
  17. .watchdog_active(watchdog_active), .timeout_event(timeout_event)
  18. );
  19. `ifdef FORMAL
  20. reg past_valid = 1'b0;
  21. always @(posedge clk) past_valid <= 1'b1;
  22. always @* begin
  23. assume (duty <= 8'd100);
  24. assume (phase <= 7'd99);
  25. if (duty == 8'd0)
  26. assert (!logical_on);
  27. if (duty == 8'd100)
  28. assert (logical_on);
  29. end
  30. always @(posedge clk) begin
  31. if (past_valid && rst_n && $past(valid_set_all_commit))
  32. assert (!watchdog_active);
  33. end
  34. `endif
  35. endmodule