video_tasks.v
3.75 KB
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
task vi_test;
// test debug socket
begin
test_selected <= HIGH;
repeat (10) @(posedge clock);
config_rdram;
// put some data in the dram first
// write_word(BUS_ADDRESS_DRAM, 3, 32'h0ad00da0);
// write_word(BUS_ADDRESS_DRAM+4, 3, 32'h1ad11da1);
// write_word(BUS_ADDRESS_DRAM+8, 3, 32'h2ad22da2);
// write_word(BUS_ADDRESS_DRAM+12, 3, 32'h3ad33da3);
// write_word(BUS_ADDRESS_DRAM+16, 3, 32'h4ad44da4);
// write registers in video controller
read_word(BUS_ADDRESS_VI_CTRL, 3);
if (data[0] !== 32'h00000000)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_ORIGIN, 3, 32'h00001000);
read_word(BUS_ADDRESS_VI_ORIGIN, 3);
if (data[0] !== 32'h00001000)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_WIDTH, 3, 32'h00000400);
read_word(BUS_ADDRESS_VI_WIDTH, 3);
if (data[0] !== 32'h00000400)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_V_INT, 3, 32'h000003FF);
read_word(BUS_ADDRESS_VI_V_INT, 3);
if (data[0] !== 32'h000003FF)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_BURST, 3, 32'h00820404);
read_word(BUS_ADDRESS_VI_BURST, 3);
if (data[0] !== 32'h00820404)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_V_SYNC, 3, 32'h00000010);
read_word(BUS_ADDRESS_VI_V_SYNC, 3);
if (data[0] !== 32'h00000010)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_H_SYNC, 3, 32'h00000100);
read_word(BUS_ADDRESS_VI_H_SYNC, 3);
if (data[0] !== 32'h00000100)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_LEAP, 3, 32'h01000100);
read_word(BUS_ADDRESS_VI_LEAP, 3);
if (data[0] !== 32'h01000100)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_H_START, 3, 32'h00200040);
read_word(BUS_ADDRESS_VI_H_START, 3);
if (data[0] !== 32'h00200040)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_V_START, 3, 32'h0005000D);
read_word(BUS_ADDRESS_VI_V_START, 3);
if (data[0] !== 32'h0005000D)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_V_BURST, 3, 32'h0005000D);
read_word(BUS_ADDRESS_VI_V_BURST, 3);
if (data[0] !== 32'h0005000D)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_X_SCALE, 3, 32'h00000400);
read_word(BUS_ADDRESS_VI_X_SCALE, 3);
if (data[0] !== 32'h00000400)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_Y_SCALE, 3, 32'h00000200);
read_word(BUS_ADDRESS_VI_Y_SCALE, 3);
if (data[0] !== 32'h00000200)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_CTRL, 3, 32'h0000015E);
read_word(BUS_ADDRESS_VI_CTRL, 3);
if (data[0] !== 32'h0000015E)
$display ("ERROR task vi_test read data is %h ",data[0]);
write_word(BUS_ADDRESS_VI_V_CURRENT, 3, 32'h00000000); // clr int
read_word(BUS_ADDRESS_VI_V_CURRENT, 3); // need some read
// wait for a while and watch dma
repeat (6000) @(posedge clock);
read_word(BUS_ADDRESS_VI_V_CURRENT, 3);
// while (data[0]) begin
// read_word(BUS_ADDRESS_SI_STATUS, 3);
// end
// dma status (data[0]) is done, so read data from dram
$finish;
end
endtask