-
Notifications
You must be signed in to change notification settings - Fork 0
/
fsm_tb.sv
49 lines (36 loc) · 801 Bytes
/
fsm_tb.sv
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
`timescale 1ns / 1ps
module tb;
initial begin
$dumpfile("fsm.vcd");
$dumpvars(0, dut);
#10000;
$finish;
end
// --------------------------------------------------------------------------
// Clock and Reset
logic clk;
logic rstn;
initial begin
clk = 0;
forever #5 clk = ~clk;
end
initial begin
rstn = 1'b0;
#100;
rstn = 1'b1;
end
// --------------------------------------------------------------------------
// verilator lint_off WIDTHTRUNC
fsm dut (.*);
// verilator lint_on WIDTHTRUNC
// --------------------------------------------------------------------------
logic in0, in1, out;
initial begin
in0 = 0;
forever #13 in0 = ~in0;
end
initial begin
in1 = 0;
forever #17 in1 = ~in1;
end
endmodule