-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestbench_pokemon.sv
101 lines (76 loc) · 1.63 KB
/
testbench_pokemon.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
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
89
90
91
92
93
94
95
96
97
98
99
100
101
/*module testbench_pokemon();
timeunit 10ns;
timeprecision 1ns;
logic Clk = 0;
logic VGA_CLK = 0;
logic Reset;
logic VGA_VS, VGA_HS, DrawEn, VGA_BLANK_N, VGA_SYNC_N;
logic charIsMoving, charIsRunning;
logic [1:0] direction, charMoveFrame;
logic [3:0] state_num;
logic [9:0] DRAWX, DRAWY;
logic [7:0] keycode;
logic [7:0] R, G, B;
logic atTile;
logic [9:0] charxcurrpos, charycurrpos;
testmodule testint(.*);
always begin : CLOCK_GENERATION
Clk = #1 ~Clk;
end
always begin : VGA_gen
VGA_CLK = #2 ~VGA_CLK;
end
initial begin : CLOCK_INITIALIZATION
Clk = 0;
VGA_VS = 1;
VGA_CLK = 0;
charIsMoving = 0;
charIsRunning = 0;
direction = 0;
charMoveFrame = 0;
state_num = 4'd0;
end
initial begin : TEST_VECTORS
Reset = 0;
#2 Reset = 1;
#2 Reset = 0;
#1 VGA_VS = 0;
#1 VGA_VS = 1;
#5 state_num = 4'd3;
end
endmodule*/
module testbench_pokemon();
timeunit 10ns;
timeprecision 1ns;
logic Clk = 0;
logic VGA_CLK = 0;
logic Reset;
logic [9:0] xright, ybottom;
logic atTile;
logic [1:0] spin_direction;
logic [9:0] xleft_next_out, ytop_next_out;
gymTileLogic tileinstatnce(.*);
always begin : CLOCK_GENERATION
Clk = #1 ~Clk;
end
always begin : VGA_gen
VGA_CLK = #2 ~VGA_CLK;
end
initial begin : CLOCK_INITIALIZATION
Clk = 0;
VGA_CLK = 0;
end
initial begin : TEST_VECTORS
Reset = 0;
#2 Reset = 1;
#2 Reset = 0;
#1 xright = 0;
ybottom = 0;
#3 xright = 10'd463;
ybottom = 10'd383;
#100 xright = 10'd0;
ybottom = 10'd0;
#3 xright = 10'd15;
ybottom = 10'd79;
end
endmodule