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.

C6748 internal SRAM speed : L1D compared to shared RAM.

I have a working system which uses no external memory (apart from external flash for booting).  It's working quite well so far.

We are using some of the internal 128KB shared RAM to store some uninitialized data.  We access this data through the cache.  About 20KB are used.

I have tried relocating this from shared RAM into L1D (with the cache switched off).  

It seems to work, BUT : the access time is slow compared to the cached shared RAM access time.  Roughly twice as slow.

Is this to be expected ?  I thought that L1D was the fastest.

Am I doing anything wrong ?

Thanks in advance.

  • This is not to be expected.

    Your timing measurements are probably correct, based on the strength of your words.

    My suspicion is that turning off the L1D cache has caused accesses to other data to have become slower, causing a net decrease in performance.

    Please try allocating the cache at 16KB, leaving 16KB for SRAM. Then move only 16KB of your data from Shared RAM to L1D. Is that practical in your application?

    Regards,
    RandyP

  • Thanks for the reply.

    It won't be straight forward to split up my data - but I'll certainly give it a try and let you know how it goes.   Thanks again.

    One thing I don't understand; if I don't use the cache why would switching it off make any difference ?

  • What are you using your L2 memory for?

    Are you saying that all of your uninitialized data memory is in that 20KB region of MSMCSRAM? Or are you also putting some things like stack into L2 SRAM?

    If you are not putting anything into L2 SRAM, try leaving cache on and moving all of it from MSMCSRAM to L2 SRAM and measure the performance.

    Regards,
    RandyP

  • Our system will boot from external flash memory (into L2 SRAM).  It uses about 95% of all L2 space (code and data).  The stack and heap are also in L2.

    The 22KB in shared RAM  is the total sum of some filter data buffers which are uninitialized.   The 32KB of L1D looks the obvious place for it, but I'll try and squeeze it all in to L2 and see what happens.

    We do not have any other memory (external DRAM etc) in this system.

    Thanks.

  • Processor said:
    One thing I don't understand; if I don't use the cache why would switching it off make any difference ?

    L1D cache is used to cache the L2 SRAM space, so that is why your performance went down when you turned off caching and put all the MSMCSRAM buffers into L1D SRAM.

    Moving from MSMCSRAM to L2 would likely give some improvement in performance unless the prefetch buffers are helping out a lot. My guess is that moving to L2 would give an improvement. You could try moving as much as you can move easily, and see if there is any improvement.

    Another option would be to leave it all in MSMCSRAM and use EDMA to copy portions from MSMCSRAM to L1D SRAM (using L1D as 50-50 cache and SRAM).

    Or you can set the L1D cache to 8KB which would give you plenty for your 20KB buffers in MSMCSRAM.

    Trying out all these options is the best way to find the best solution. Of course, the EDMA method would require program changes, so that would not be nearly as easy as the other ones.

    For all the options where MSMCSRAM is still being used and some L1D cache is enabled, make sure the MAR bits are set. I think that is the default, or maybe required setting.

    Regards,
    RandyP

  • Thanks for your help.

    I tried out a few of the options and the best configuration for me was when I moved everything from MSMCSRAM into L2 and the cache was enabled.  However, to do this I had to temporarily remove parts of the application to ensure it would fit.  The improvement in performance was measured at around a few percent and so I do not believe that the loss (in performance) will be too significant.   I didn't try the EDMA method and I will leave this for another day.

    Thanks again.

  • Please let us know what your results are when you use the EDMA method, when you get the chance to try it.

    If you are satisfied with the results of this thread, please mark the post that is the best answer (perhaps it is your post immediately above) with Verify Answer.

    Regards,
    RandyP