| 12345678910111213141516171819202122232425262728293031323334353637 |
- `timescale 1ns/1ps
- module prod2u_p4_normal_v3_top_tb;
- reg sys_clk = 1'b0;
- reg host_uart_rx = 1'b1;
- wire host_uart_tx;
- wire [7:0] ptc_pwm_out;
- wire [3:0] fan_pwm_out;
- wire motor_en_n;
- wire x_step;
- wire x_dir;
- wire y_step;
- wire y_dir;
- reg x_limit_raw = 1'b0;
- reg y_limit_raw = 1'b0;
- tri temp_scl;
- tri temp_sda;
- always #1 sys_clk = ~sys_clk;
- prod2u_p4_normal_v3_top dut (
- .sys_clk(sys_clk), .host_uart_rx(host_uart_rx), .host_uart_tx(host_uart_tx),
- .ptc_pwm_out(ptc_pwm_out), .fan_pwm_out(fan_pwm_out),
- .motor_en_n(motor_en_n), .x_step(x_step), .x_dir(x_dir), .y_step(y_step), .y_dir(y_dir),
- .x_limit_raw(x_limit_raw), .y_limit_raw(y_limit_raw),
- .temp_scl(temp_scl), .temp_sda(temp_sda)
- );
- initial begin
- repeat (1100) @(posedge sys_clk);
- if (host_uart_tx !== 1'b1) $fatal(1, "UART TX is not idle");
- if (ptc_pwm_out !== 8'd0) $fatal(1, "PTC outputs are not off");
- if (fan_pwm_out !== 4'hF) $fatal(1, "FAN outputs are not inactive");
- if (motor_en_n !== 1'b0) $fatal(1, "motor enable is not constant low");
- $display("prod2u_p4_normal_v3_top_tb PASS");
- $finish;
- end
- endmodule
|