-
Notifications
You must be signed in to change notification settings - Fork 0
/
test20.v
58 lines (44 loc) · 865 Bytes
/
test20.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
module test20;
reg clock, reset, in;
wire out;
my_fsm U0 (
.clock (clock),
.reset (reset),
.in (in),
.out (out)
);
initial begin
clock = 1;
reset = 1;
in = 0;
$display("Starting simulation...");
#2;
reset = 0;
#2;
if (out !== 1'b0) $display("Failed 1");
in = 1;
#2;
if (out !== 1'b0) $display("Failed 2");
in = 1;
#2;
if(out !== 1'b0) $display("Failed 3");
in = 1;
#2;
if (out !== 1'b1) $display("Failed 4");
in = 1;
#2;
if (out !== 1'b0) $display("Failed 5");
in = 1;
#2;
if (out !== 1'b1) $display("Failed 6");
in = 1;
#2;
if (out !== 1'b0) $display("Failed 7");
#2;
if (out !== 1'b1) $display("Failed 8");
$display("Done...");
end
always begin
#1 clock = !clock;
end
endmodule