rspdma_tasks.v 1.3 KB
/************************************************************************
			   RSP IMEM/DMEM DMA TESTS
 ************************************************************************/
task rsp_dma;
    begin
	test_selected <= HIGH;
	$display("        IDMEM_DMA: configuring the RDRAM ........"); //XXX
	mem_config;

	// IMEM/DMEM/RDRAM pre-loaded.  Set SU PC and go XXX
	$display("        IDMEM_DMA: starting RSP ........");
	swrite(BUS_ADDRESS_SP_PC, 3, 32'b0);
	swrite(BUS_ADDRESS_SP_STATUS, 3, 32'b0010_1101);
	// wait for SU halt/broke
	$display("        IDMEM_DMA: running RSP DMA test ........");
	sread(BUS_ADDRESS_SP_STATUS, 3, data[0]);
	while (!(data[0] & 'b1)) begin
	    repeat(300) @(posedge sysclk);
	    sread(BUS_ADDRESS_SP_STATUS, 3, data[0]);
`ifdef RSP_DMA_REGRESSION
	    $display("        IDMEM_DMA: ... PC = 0x%h, r1 = 0x%h, Stat = 0x%h",
		     { vsim.bcp.rsp.su.suctl.pc, 2'b0 },
		     vsim.bcp.rsp.su.sudp.suRFile_i.mem[1],
		     data[0]);
`endif
	    end
	// display result
`ifdef RSP_DMA_REGRESSION
	$display("        IDMEM_DMA: done... r1 = 0x%h\n",
		 vsim.bcp.rsp.su.sudp.suRFile_i.mem[1]);
`endif
	$finish;
	end
    endtask

/************************************************************************
			  END OF RSP DMA TESTS/TASK
 ************************************************************************/