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.
Dear Sir,
I am a beginner to DSP. I am working with TMS320DM6437 DSP using CCSv5.3.0.
My objective is access to L2 cache memory and store data.
I referred a few TI pdf on configuring cache and tried these instructions in my sample code.
CACHE_L2Size oldSize;
CACHE_L2Mode oldMode;
CACHE_enableCaching(CACHE_EMIFB_CE00);
oldMode = CACHE_setL2Mode(CACHE_L2_NORMAL);
oldSize = CACHE_setL2Size(CACHE_128KCACHE);
But my data is getting saved in DDR2 memory ( seen in Memory Browser) :(
My cmd file is:
L2RAM: o = 0x00800000 l = 0x00020000 /* 128kB L2 RAM/Cache */
DDR2: o = 0x80000000 l = 0x04000000 /* 256MB External DDR2 */
.data > L2RAM
I am encountering questions like,
Can you guide me with the same !!!!!
Thanking you,
Regards,
S Sandeep
Sandeep,
Welcome to the TI E2E forum. I hope you will find many good answers here.
In addition you can find some details through the TI.com documents and the TI Wiki Pages.
Be sure to search those for helpful information and to browse for the questions others may have asked on similar topics.
Configuring L2 Cache:
L2 is configured as SRAM (addressable internal memory).
L2 cache can be enabled in the program code by issuing the appropriate chip support library(CSL).
Additionally, in the linker command file the memory to be used as SRAM has to be specified.
Since cache cannot be used for code or data placement by the linker, all sections must be linked into SRAM or external
memory.
The linker command file for a configuration of 1792K SRAM and 256K-bytes cache is shown.
If DSP/BIOS is used, L2 cache is enabled automatically.
Refer this wiki page for configuring the cache using DSP/BIOS,
http://processors.wiki.ti.com/index.php/Enabling_64x%2B_Cache
Dear Sir,
Thank you for your assistance.
I am not using DSP BIOS.
I used the same linker cmd file you sent and CSL commands written below -
CACHE_L2Size oldSize;
CACHE_L2Mode oldMode;
CACHE_enableCaching(CACHE_EMIFB_CE00);
oldMode = CACHE_setL2Mode(CACHE_L2_NORMAL);
oldSize = CACHE_setL2Size(CACHE_128KCACHE);
Is something wrong with my CSL instructions ?
If my instruction is wrong, then can you suggest me with more specific instruction/procedure to configure SRAM(0x00800000) as L2 cache and save data in the same.
Still the data is getting saved in DDR2 memory ( 0x8000 0000).
http://processors.wiki.ti.com/index.php/Enabling_64x%2B_Cache - in this document they have given details about configuring external memory as cache using MAR registers. But not how to use L2 SRAM cache.
If you could help me ? :)
Thanking you,
Regards,
S Sandeep
Sandeep,
Your small pieces of code seems ok.
Note:
Data or code must be linked into L2 SRAM or External memory and then copied to L1 at run-time.
/* L1 and L2 Caching Memory area */
#define CACHE_MEM (0xE0000000)
CACHE_L2Size localSize[4];
/* make sure that L2 is turned off */
CACHE_setL2Size(CACHE_0KCACHE);
/* Array used for setting L2 cache size */
localSize[0] = CACHE_32KCACHE;
localSize[1] = CACHE_64KCACHE;
localSize[2] = CACHE_128KCACHE;
localSize[3] = CACHE_256KCACHE;
/* Set L2 cache in normal mode */
CACHE_setL2Mode(CACHE_L2_NORMAL);
/* set Mar bit for CACHE_MEM */
CACHE_enableCaching(CACHE_EMIFB_CE00);
Dear Pubesh,
Sorry for replying late.
Thank you so much for your timely help.
I also used accessing the L2 configuration register directly since it is memory mapped.
ptr = (int *)0x01840000;
*ptr = 0x00000000;
Is this way of configuring correct ?
Thanking you,
Regards,
S Sandeep