-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtb_key_ctrl.v
63 lines (50 loc) · 1.24 KB
/
tb_key_ctrl.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
`timescale 1ns / 1ps
//////////////////////////////////////////////////////////////////////////////////
// Engineer: lauchinyuan
// Email: lauchinyuan@yeah.net
// Create Date: 2023/09/30 09:36:33
// Module Name: tb_key_ctrl
// Description: testbench for key_ctrl module
//////////////////////////////////////////////////////////////////////////////////
module tb_key_ctrl(
);
reg clk ;
reg rst_n ;
reg key_in ;
wire state_out ;
initial begin
clk = 1'b1;
rst_n <= 1'b0;
key_in <= 1'b1;
#20
rst_n <= 1'b1;
#300
key_in <= 1'b0;
#500
key_in <= 1'b1;
#300
key_in <= 1'b0;
#500
key_in <= 1'b1;
#5000
key_in <= 1'b0;
#2000000
key_in <= 1'b1;
#5000
key_in <= 1'b0;
#2500000
key_in <= 1'b1;
#60000
key_in <= 1'b0;
end
always#10 clk = ~clk;
key_ctrl
#(.FREQ(28'd50_000_000)) //模块输入时钟频率
key_ctrl_inst
(
.clk (clk ),
.rst_n (rst_n ),
.key_in (key_in ),
.state_out (state_out )
);
endmodule