cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
7,710 Views
Registered: ‎01-13-2015

Data copy from DDR3 to BRAM through CDMA

Jump to solution

Hi all,

I'm testing CDMA to copy data from DDR3 to BRAM, and I use chipscope(ILA) on the ZC702 board.

When I read a data between 'axi_bram_ctrl' and 'blk_mem_gen', ILA shows the data looks very different from what I gave.

For CDMA, source addres is 0x3000_0000, and destination address(block memory) is 0xC000_0000,

I put a 32bit data(0xFFF8) at the address of 0x3000_0000, then CDMA copy the data(just one byte) to BRAM ,

the captured data by the chipscope(ILA) beween 'axi_bram_ctrl' and 'blk_mem_gen' is 0xFDFE_EF71 at the address of 0x0000_0000 (BRAM's view point).

The data I want to look is not 0xFDFE_EF71 but 0x0000_FFF8.

Is there something wrong? or Memory Maped data structure is different from what we look?

 

Thank you...

 

 

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Teacher
Teacher
14,054 Views
Registered: ‎03-31-2012
how do you write the data to ddr3? from the processor? if so, make sure that the data you write is not stuck in the cache but written back to memory.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos
3 Replies
Highlighted
Teacher
Teacher
14,055 Views
Registered: ‎03-31-2012
how do you write the data to ddr3? from the processor? if so, make sure that the data you write is not stuck in the cache but written back to memory.
- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.

View solution in original post

0 Kudos
Highlighted
Adventurer
Adventurer
7,613 Views
Registered: ‎01-13-2015

Hi muzaffer,

 

u32 u32tmpData[8] = {0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF};

 

const unsigned int srcDMA0 = 0x10000000;
const unsigned int dstDMA0 = 0x18000000;

 

int main(void) 

{

 

        linelength = 8;
        for(addrCnt = 0; addrCnt < linelength; addrCnt++)
        {
                tmpVal0 = (addrCnt * 4) + srcDMA0;

                Xil_Out32(tmpVal0, u32tmpData[addrCnt]);
        }

}

 

This is how I write the data to DDR3.

 

How can I make sure that the data is not stucking in the cashe?

0 Kudos
Highlighted
Adventurer
Adventurer
7,588 Views
Registered: ‎01-13-2015

void cdma2bram(void){
u16 add_inc=0;
Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_CR_OFFSET, 0x4);       /* Reset CDMA 2 */
Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_CR_OFFSET, 0x5000); /* */
        while(add_inc < 8)
        {
                while(!(Xil_In32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_SR_OFFSET) & 0x2));
                Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_SRCADDR_OFFSET, (srcDMA0 + (add_inc * 4)));        /* Src address */
                Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_DSTADDR_OFFSET, (0xC0000000 + (add_inc * 4)));  /* Dest address */
                Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_BTT_OFFSET, 0x4); /* write 4 bytes*/
                while(!(Xil_In32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_SR_OFFSET) & 0x1000));
                Xil_Out32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_SR_OFFSET, Xil_In32(XPAR_AXICDMA_0_BASEADDR + XAXICDMA_SR_OFFSET) | 0x1000);
                add_inc++;
        }
}

 

This code sends data to Block Memory in the PL section, but the data is defferent from defined data above (u32tmpData[8]).

 

Please give me any comments to sove this problem...

 

Thank you.

0 Kudos