test.v 2.94 KB
// 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