-
Notifications
You must be signed in to change notification settings - Fork 0
/
top_tb.v
88 lines (79 loc) · 1.85 KB
/
top_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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
// top_tb.v
`timescale 1 ns/10 ps // time-unit = 1 ns, precision = 10 ps
module top_tb;
reg i_CLK;
reg i_ReceivedSignal;
wire o_PRBS;
// duration for each bit = 20 * timescale = 20 * 1 ns = 20ns
localparam period = 20;
top UUT (.CLK(i_CLK), .i_ReceivedSignal(i_ReceivedSignal), .o_PRBS(o_PRBS));
always
begin
i_CLK = 1'b1;
#1
i_CLK = 1'b0;
#1
$stop;
end
always @(posedge i_CLK)
begin
i_ReceivedSignal <= 1'b0;
#(period * 50);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b1;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b1;
#(period * 100);
i_ReceivedSignal <= 1'b1;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b1;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
i_ReceivedSignal <= 1'b1;
#(period * 100);
i_ReceivedSignal <= 1'b0;
#(period * 100);
$stop;
end
// Sets up things for apio specificly
initial begin
$dumpfile("top_tb.vcd");
$dumpvars(0, top_tb);
#(period * 4096) $display("End of simulation");
$finish;
end
endmodule