cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
vijji148
Observer
Observer
1,534 Views
Registered: ‎07-06-2016

axi cdma with custom axi4 lite master Bram to DDR data transfer

Hi,

I am having custom axi4 lite master (tested fully). And created block design using custom axi4 lite master, axi cdma, Bram, MIG and other required peripherals (Kintex 7 FPGA is using).  Axi cdma has to read data from bram and transfer it to MIG. To transfer data from Bram to MIG I have written the following code ...

 

DWORD CDMA_BASEADDR = 0x44A00000;
DWORD data3,data4,data5,data6,data7,data8;
const int length = 4;
char * SrcAddr = (char *) 0xC0000000;  (Bram base addr)
char * DestAddr = (char *) 0x80000000; (MIG base addr)

// Single WriteDW
status = WriteDW(&board, (unsigned int)SrcAddr, 0x123);
if (status == XO_SUCCESS){
printf("Test Bram write Data : 0x%08x\n", status);
}
else{
printf("Test Bram write data failed : 0x%08x\n", status);
}
status = ReadDW(&board, (unsigned int)SrcAddr, &data3);
if(status == XO_SUCCESS){
printf("Test Sdram read Data : 0x%x\n", data3);
}
else{
printf("Test Sdram read data failed : %08x\n",status);
}

printf("Test destination address : 0x%x\n", (unsigned int)DestAddr);
// Set DMA control register Err_Irqen, IOC_Irqen and simple mode DMA
status = WriteDW(&board, CDMA_BASEADDR+0x0, 0x00005000);
status = ReadDW(&board, CDMA_BASEADDR+0x0, &data4);
printf("DMA control register :0x%08x = 0x%08x\n\r",CDMA_BASEADDR+0x0,data4);

status = ReadDW(&board, CDMA_BASEADDR+0x4, &data8);
printf("DMA status register :0x%08x = 0x%08x\n\r",CDMA_BASEADDR+0x4,data8);

// Read data from Bram
status = WriteDW(&board, CDMA_BASEADDR+0x18, (unsigned int)SrcAddr);
status = ReadDW(&board, CDMA_BASEADDR+0x18, &data5);
printf("DMA Source address register :0x%08x = 0x%08x\n\r",CDMA_BASEADDR+0x18,data5);

// Write data to MIG
status = WriteDW(&board, CDMA_BASEADDR+0x20, (unsigned int)DestAddr);
status = ReadDW(&board, CDMA_BASEADDR+0x20, &data6);
printf("DMA Destination address register :0x%08x = 0x%08x\n\r",CDMA_BASEADDR+0x20,data6);

// Set the byte length of DMA transfer
status = WriteDW(&board, CDMA_BASEADDR+0x28, length);
status = ReadDW(&board, CDMA_BASEADDR+0x28, &data7);
printf("DMA BTT register :0x%08x = 0x%08x\n\r",CDMA_BASEADDR+0x28,data7);

DWORD Data1;
// Single ReadDW
status = ReadDW(&board, (unsigned int)DestAddr, &Data1);
if(status == XO_SUCCESS){
printf("Test Sdram read Data : 0x%x\n", Data1);
}
else{
printf("Test Sdram read data failed : %08x\n",status);
}

 

Data is not transferring from Bram to MIG . Please help me to find the solution.

Any help would be appreciated.

 

Thanks & Regards,

Lakshmi

 

 

0 Kudos
Reply
0 Replies