This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

the problem about C674x cache coherency

Dear,

I met some problems while developing DSP optimization on c674x.

Hope get some helps.

The question as follows:

When the fist stage of optimization,I use memcpy to complish the data transfer between L2 and DDR3,the code can get correct results.

In order to improve the algorithm speed,using EDMA_transfer() replaces every memcpy functions,but the results become incorrect.

Notes(I write EDMA3_transfer function by myself.)

At the beginning I think EDMA_transfer function maybe have some problems,but I trace the code with data set several time,I cannot find any

error for data movement(tracing code step by step).


The specific data path as follows:


DDR3(cached) --> L2(SRAM,not cached)-->DDR3(cached)

That is, data from DDR3,which is cached by MARn register,to L2(L2 part is L2 SRAM,not used as cache),

then data are processed in L2 SRAM,after processing finished,the results is sent to DDR3(cached) from L2 by EDMA3.

I know cache coherency must be kept when using EDMA transfer.

In this situation (DDR3(cached) --> L2(SRAM,not cached)-->DDR3(cached) ),how to keep data coherence on C674x dsp.

could you give me some suggestions?

if there is another factor which can cause the same problem(after using EDMA transfer,the code cannot get correct results)

In addition,I use reserved event number (EDMA_RSV00),reserved event number can cause some problem for data movement?

Thank you very much.

BRS,
Meng

  • Hi,

    Thanks for your post.

     It is a good practice to have the buffers aligned to cache line boundary but is not a necessary condition.

    However, the requirement of having buffers aligned to cache line boundary and having the byte count as multiple of cache line size is more critical when if the application has the DSP using DMA to access shared buffers. This rule is part of the XDAIS standard and is very well documented in the wiki on Cache management given below:

    processors.wiki.ti.com/.../Cache_Management

    To align any buffer to a given boundary the C6000 compiler supports the #pragma DATA_ALIGN() function. This function can be used to align buffers to the cache line boundary without allocating extra memory.

    Documentation for those Cache APIs can be found here:
    rtsc.eclipse.org/.../Cache.html

    Please check here for cache user guide:
    www.ti.com/.../spru862b.pdf

    Kindly check Table B -1, B-2 coherence matrix from the above doc.

    Thanks & regards,
    Sivaraj K

    -------------------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question
    -------------------------------------------------------------------------------------------------------