test.v
2.94 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
89
90
91
92
93
94
95
96
97
98
99
100
// test.v v1 Frank Berndt
// frame for verilog tests;
// :set tabstop=4
// include various tasks;
`include "tests/ri_tests.v"
`include "tests/mi_tests.v"
`include "tests/si_tests.v"
`include "tests/pi_tests.v"
`include "tests/sp_tests.v"
`include "tests/vi_tests.v"
/*XXX
`include "io_tasks.v"
`include "audio_tasks.v"
`include "video_tasks.v"
`include "rdp_tasks.v"
`include "sp_tasks.v"
XXX*/
// print list of tests;
initial
begin
if ($test$plusargs("help")) begin
$display("cpu test +options:");
//XXX $display(" +test_cpu_dp_counters");
//XXX $display(" +test_cpu_dmem");
//XXX $display(" +test_cpu_imem");
//XXX $display(" +test_cpu_rsp_dma");
//XXX $display(" +test_cpu_sp_reg");
//XXX $display(" +test_cpu_sp_dma_copy");
//XXX $display(" +test_cpu_sp_dual");
//XXX $display(" +test_cpu_cbuf_dma");
//XXX $display(" +test_cpu_cbuf_dmem");
//XXX $display(" +test_cpu_byte_write");
//XXX $display(" +test_cpu_data_file");
//XXX $display(" +test_cpu_vi_test");
//XXX $display(" +test_cpu_ai_test");
//XXX $display(" +test_cpu_span_buf_test");
$display(" +test_ri");
$display(" +test_mi_all");
$display(" +test_mi_mem_random");
$display(" +test_si");
$display(" +test_pi");
$display(" +test_sp");
$display(" +test_vi");
$display("");
#1 $finish;
end
end
// wait for deassertion of reset;
// run all the +option tests;
// give some extra clocks before finishing;
reg all; // run all tests;
reg [31:0] seed; // random seed;
initial
begin
all = $test$plusargs("test_all");
//XXX test that test at all;
test_selected <= 0;
wait_out_of_reset;
if($getnum$plusarg("seed=", seed) == 1) begin
$display("test: %M: seed %0d", seed);
seed = $random(seed);
end
//XXX if($test$plusargs("test_cpu_dp_counters")) dp_counters;
//XXX if($test$plusargs("test_cpu_dmem")) sp_dmem;
//XXX if($test$plusargs("test_cpu_imem")) sp_imem;
//XXX if($test$plusargs("test_cpu_rsp_dma")) rsp_dma;
//XXX if($test$plusargs("test_cpu_sp_reg")) sp_reg;
//XXX if($test$plusargs("test_cpu_sp_dma_copy")) sp_dma_copy;
//XXX if($test$plusargs("test_cpu_sp_dual")) sp_dual;
//XXX if($test$plusargs("test_cpu_cbuf_dma")) cbuf_dma;
//XXX if($test$plusargs("test_cpu_cbuf_dmem")) cbuf_dmem;
//XXX if($test$plusargs("test_cpu_byte_write")) test_byte_write;
//XXX if($test$plusargs("test_cpu_data_file")) data_file;
//XXX if($test$plusargs("test_cpu_vi_test")) vi_test;
//XXX if($test$plusargs("test_cpu_ai_test")) ai_test;
//XXX if($test$plusargs("test_cpu_span_buf_test")) span_buf_test;
if(all | $test$plusargs("test_ri")) test_ri;
if(all | $test$plusargs("test_mi")) test_mi;
if(all | $test$plusargs("test_mem_rand")) test_mem_rand;
if(all | $test$plusargs("test_si")) test_si;
if(all | $test$plusargs("test_pi")) test_pi;
if(all | $test$plusargs("test_sp")) test_sp;
if(all | $test$plusargs("test_vi")) test_vi;
repeat(64) @(posedge sysclk);
$finish;
end