`timescale 10ns/1ns
module digital_test_TB(); //进行整体测试
reg clk_TB, key_start_TB, key_modify_TB, key_add_TB;
wire [5:0] bits_TB;
wire [5:0] minute_TB, second_TB;
wire [4:0] hour_TB;
initial
begin
#0 clk_TB = 0; key_start_TB = 1; key_modify_TB = 1; key_add_TB = 1;
#50 key_start_TB = 0; //一个key_start下降沿,启动时钟信号
#50 key_add_TB = 0; //一个key_add的下降沿将产生一个对小时的加一
#50 key_add_TB = 1;
#50 key_add_TB = 0; //一个key_add的下降沿,将对分钟进行加一
#50 key_add_TB = 1;
#500000 $stop;
end
always
#10.416 clk_TB = ~clk_TB;
digital_clock U1(.clk(clk_TB), .bit(bits_TB), .key_add(key_add_TB), .key_modify(key_modify_TB),
.minute(minute_TB), .second(second_TB), .hour(hour_TB), .key_start(key_start_TB));
endmodule