| 123456789101112131415161718192021222324252627282930313233 |
- `timescale 1ns/1ps
- module mrdimm_absent_bmc_tb;
- reg clk=0;always #20 clk=~clk;
- genvar n;
- generate for(n=0;n<2;n=n+1)begin:g
- tri1 scl,sda,host_sda;
- prod2u_mrdimm_top #(.HOST_I2C_ENABLED(0),.BMC_UART_ENABLED(n)) dut(
- .sys_clk(clk),.host_rs232_rx(1'b1),.host_rs232_tx(),.host_ttl_rx(1'b1),.host_ttl_tx(),
- .bmc_rs232_rx(1'b1),.bmc_rs232_tx(),.host_i2c_scl(1'b1),.host_i2c_sda(host_sda),
- .temp_scl(scl),.temp_sda(sda),.limit_lower_raw(3'b111),.limit_upper_raw(3'd0),
- .ptc_pwm_out(),.fan_pwm_out(),.motor_en_n(),.x_step(),.x_dir(),.y_step(),.y_dir(),.z_step(),.z_dir());
- end endgenerate
- reg [4:0] probe_index=0;integer i;
- task compare_idle;
- begin
- if({g[0].dut.bmc_epoch,g[0].dut.bmc_age,g[0].dut.bmc_stale,g[0].dut.bmc_active_bank,g[0].dut.bmc_valid_mask,g[0].dut.bmc_snapshot_raw}!==
- {g[1].dut.bmc_epoch,g[1].dut.bmc_age,g[1].dut.bmc_stale,g[1].dut.bmc_active_bank,g[1].dut.bmc_valid_mask,g[1].dut.bmc_snapshot_raw})
- $fatal(1,"absent BMC telemetry differs from initialized idle decoder at channel%0d",probe_index);
- if(g[0].dut.bmc_snapshot_raw!==0 || g[0].dut.bmc_valid_mask!==0 || g[0].dut.bmc_age!==16'hFFFF || g[0].dut.bmc_rs232_tx!==1)
- $fatal(1,"absent BMC defaults");
- end endtask
- initial begin
- wait(g[0].dut.rst_n && g[1].dut.rst_n);repeat(40)@(negedge clk);
- force g[0].dut.bmc_snapshot_index=probe_index;force g[1].dut.bmc_snapshot_index=probe_index;
- for(i=0;i<24;i=i+1)begin probe_index=i;repeat(3)@(negedge clk);compare_idle();end
- release g[0].dut.bmc_snapshot_index;release g[1].dut.bmc_snapshot_index;
- force g[0].dut.tick_1s=1'b1;force g[1].dut.tick_1s=1'b1;
- repeat(40)@(negedge clk);release g[0].dut.tick_1s;release g[1].dut.tick_1s;
- repeat(3)@(negedge clk);compare_idle();
- $display("mrdimm_absent_bmc_tb PASS");$finish;
- end
- initial begin #1000000;$fatal(1,"absent BMC test deadline");end
- endmodule
|