prod2u_6400_front_back_top_tb.v 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. `timescale 1ns/1ps
  2. module prod2u_6400_front_back_top_tb;
  3. reg sys_clk = 1'b0;
  4. reg host_rs232_rx = 1'b1;
  5. reg bmc_rs232_rx = 1'b1;
  6. reg host_i2c_scl = 1'b1;
  7. wire host_rs232_tx;
  8. wire bmc_rs232_tx;
  9. wire [23:0] ptc_pwm_out;
  10. wire [3:0] front_fan_pwm_out;
  11. wire [3:0] rear_fan_pwm_out;
  12. tri temp_scl;
  13. tri temp_sda;
  14. tri host_i2c_sda;
  15. always #1 sys_clk = ~sys_clk;
  16. prod2u_6400_rs232_only_top dut (
  17. .sys_clk(sys_clk),
  18. .host_rs232_rx(host_rs232_rx),
  19. .host_rs232_tx(host_rs232_tx),
  20. .bmc_rs232_rx(bmc_rs232_rx),
  21. .bmc_rs232_tx(bmc_rs232_tx),
  22. .host_i2c_scl(host_i2c_scl),
  23. .host_i2c_sda(host_i2c_sda),
  24. .ptc_pwm_out(ptc_pwm_out),
  25. .front_fan_pwm_out(front_fan_pwm_out),
  26. .rear_fan_pwm_out(rear_fan_pwm_out),
  27. .temp_scl(temp_scl),
  28. .temp_sda(temp_sda)
  29. );
  30. initial begin
  31. repeat (1100) @(posedge sys_clk);
  32. if (host_rs232_tx !== 1'b1) $fatal(1, "Host RS-232 TX is not idle");
  33. // The BMC poller may already be emitting its scheduled request; only
  34. // the host-facing UART idle level is part of this POR smoke check.
  35. if (ptc_pwm_out !== 24'd0) $fatal(1, "PTC outputs are not off after POR");
  36. if (front_fan_pwm_out !== 4'h0 || rear_fan_pwm_out !== 4'hF)
  37. $fatal(1, "FAN FPGA pins do not show safe 20%% connector duty: front=%h rear=%h", front_fan_pwm_out, rear_fan_pwm_out);
  38. $display("prod2u_6400_front_back_top_tb PASS");
  39. $finish;
  40. end
  41. endmodule