-
Notifications
You must be signed in to change notification settings - Fork 1
/
vga_dc_tb.v
86 lines (74 loc) · 1.21 KB
/
vga_dc_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
`timescale 1ns / 1ps
module vga_dc_TB;
// Inputs
reg ptick;
reg clk;
reg rst;
reg [7:0] pico_addr;
reg [7:0] pico_data_in;
reg [5:0] x_div;
reg [5:0] y_div;
// Outputs
wire [7:0] pico_data_out;
wire [7:0] vga_out;
// Instantiate the Unit Under Test (UUT)
vga_data_controller uut (
.ptick(ptick),
.clk(clk),
.rst(rst),
.pico_addr(pico_addr),
.pico_data_in(pico_data_in),
.x_div(x_div),
.y_div(y_div),
.pico_data_out(pico_data_out),
.vga_out(vga_out)
);
initial begin
// Initialize Inputs
ptick = 0;
clk = 0;
rst = 0;
pico_addr = 0;
pico_data_in = 0;
x_div = 0;
y_div = 0;
// Wait 100 ns for global reset to finish
#100;
rst = 1;
// Add stimulus here
#50
rst = 0;
x_div = 20;
y_div = 15;
#50
x_div = 18;
y_div = 16;
#50
x_div = 19;
y_div = 15;
#50
x_div = 20;
y_div = 19;
#50
x_div = 21;
y_div = 15;
#50
x_div = 22;
y_div = 15;
#50
x_div = 23;
y_div = 21;
#50
x_div = 24;
y_div = 15;
#50
x_div = 100;
y_div = 17;
#50
x_div = 0;
y_div = 0;
end
always begin clk = ~clk; #50; end
always begin ptick = ~ptick; #50; end
//always begin ptick = ~ptick; #100; end
endmodule