prod2u_6400_front_back_top_tb.v 976 B

123456789101112131415161718192021222324252627282930313233
  1. `timescale 1ns/1ps
  2. module prod2u_6400_front_back_top_tb;
  3. reg sys_clk = 1'b0;
  4. reg host_uart_rx = 1'b1;
  5. wire host_uart_tx;
  6. wire [23:0] ptc_pwm_out;
  7. wire [7:0] fan_pwm_out;
  8. tri temp_scl;
  9. tri temp_sda;
  10. always #1 sys_clk = ~sys_clk;
  11. prod2u_6400_front_back_top dut (
  12. .sys_clk(sys_clk),
  13. .host_uart_rx(host_uart_rx),
  14. .host_uart_tx(host_uart_tx),
  15. .ptc_pwm_out(ptc_pwm_out),
  16. .fan_pwm_out(fan_pwm_out),
  17. .temp_scl(temp_scl),
  18. .temp_sda(temp_sda)
  19. );
  20. initial begin
  21. repeat (1100) @(posedge sys_clk);
  22. if (host_uart_tx !== 1'b1) $fatal(1, "UART TX is not idle");
  23. if (ptc_pwm_out !== 24'd0) $fatal(1, "PTC outputs are not off after POR");
  24. if (fan_pwm_out !== 8'h00)
  25. $fatal(1, "FAN FPGA pins should be low (logical 10%% on, inverted) got %h", fan_pwm_out);
  26. $display("prod2u_6400_front_back_top_tb PASS");
  27. $finish;
  28. end
  29. endmodule