-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdff_tb.v
47 lines (41 loc) · 847 Bytes
/
dff_tb.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
module day15_tb ();
reg clk;
reg reset;
reg d_i; // Declare input for day2
wire q_norst_o, q_syncrst_o, q_asyncrst_o; // Outputs for day2
// Instantiate the module (connect the correct ports)
day2 DUT (
.clk(clk),
.reset(reset),
.d_i(d_i),
.q_norst_o(q_norst_o),
.q_syncrst_o(q_syncrst_o),
.q_asyncrst_o(q_asyncrst_o)
);
// Clock generation
always begin
clk = 1'b0;
#5;
clk = 1'b1;
#5;
end
// Stimulus
initial begin
reset = 1'b1;
d_i = 1'b0;
@(posedge clk);
reset = 1'b0;
@(posedge clk);
d_i = 1'b1;
@(posedge clk);
@(posedge clk);
@(negedge clk);
reset = 1'b1;
@(posedge clk);
@(posedge clk);
reset = 1'b0;
@(posedge clk);
@(posedge clk);
$finish(); // End the simulation
end
endmodule