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.

Cache_wbInvAll call is not clearing cache contents in C6678

Other Parts Discussed in Thread: SYSBIOS

Hi Team,

I am using CCS5.5 and calculating worst case execution time when all cores access MSMCSRAM in C6678 controller.

Test details:
-----------------

I am using SYS/BIOS and used the following code for invalidating the cache.

============================================================

#include "stdio.h"
#include <ti/sysbios/family/C66/Cache.h>
#include <c6x.h>

int ch1,ch2;
#define core_num 0
#define MPAXL2 0x08000010
#define MPAXH2 0x08000014

void main()
{
volatile int *ptr;
volatile unsigned int * mpaxl2 = (volatile unsigned int *)MPAXL2;
volatile unsigned int * mpaxh2 = (volatile unsigned int *)MPAXH2;
unsigned int st_bef[50]={0};
unsigned int st_aft[50]={0};
unsigned int value;
int i = 0;
Cache_Size *size;
Cache_getSize(size);
printf("cache sizes are 0x%x 0x%x 0x%x\n",size->l1pSize,size->l1dSize,size->l2Size);
printf("cache Modes are 0x%x 0x%x 0x%x\n",Cache_getMode(Cache_Type_L1P),Cache_getMode(Cache_Type_L1D),Cache_getMode(Cache_Type_L2));

ptr = (volatile unsigned int *)((0x0c000002) + (0x1000 *core_num));

*(mpaxh2) = (0x0c00000b + (0x1000 * core_num));
*(mpaxl2) = (0x0c0000bf + (0x1000 * core_num));
*(mpaxh2);
*(mpaxl2);
printf("0x%x 0x%x \n",*(mpaxh2),*(mpaxl2));
*(ptr) = 100;

TSCL = 0;
while(i < 50)
{
Cache_wbInvAll();
st_bef[i] = TSCL;
(*ptr);
st_aft[i] = TSCL;
i++;
}
i = 0;
while(i < 50)
{
printf("ch1 value is 0x%x 0x%x 0x%x\n",st_bef[i],st_aft[i],*ptr);
i++;
}
}

============================================================

Configured L1P and L1D as caches only(32KB each) and L2 as SRAM(512KB).

Configured stack, program and data regions in L2.

Observations:
-------------------

1. When I check the "Memory Browser" contents regarding the values in L1D cache for the st_bef[i] value, its not getting cleared even after cache invalidation.          Can you please check why this happens?

2. As per the MSMC document(SPRUGW7A), I could see that each core has a port to access MSMCSRAM. So, when all the cores access MSMCSRAM, will
     the read operation happen parallely?

  • Hi Sreenivasan,

    Moved this thread over keystone forum for appropriate response. Thank you for your patience.
  • Hi Team,

    Please let me know if you have any updates on this.
  • Task 2.docxThe 6678 EVM comes with built-in emulator.  

    To understand what really happens you can look at the cache itself.

    Enclosed are instructions from student Lab book how to look at the cache.  If you stroll down you will see all the caches (L1P, L1D and L2) and you can see if the validate bit is changed or not

    After you do so and you verify that the invalidate does not work, get back to me

    Thanks

    Ran

  • A note for the posting above

    The instructions are part of a specific Lab. Ignore the lab and just follow the instructions how to look at the cache lines

    Ran
  • Hi Ran,

    Yes, it is working fine. But, when we look into memory browser option and type a particular address and enter it, we will get its corresponding value. There, we could see tabs named "L1D, L1P, L2 cache" like. Can you please tell more information on this(i.e., as i understand that the value shown in memory browser are not the cached one's, then why it has an option of selecting L1P/D, L2 caches)?
    Do we have any document which tells on how to debug the things and provide more information on this?

    Also, can you please answer my other question?
    - 2. As per the MSMC document(SPRUGW7A), I could see that each core has a port to access MSMCSRAM. So, when all the cores access MSMCSRAM, will the read operation happen parallely?
  • Start with question 2

    The MSMCSRAM has multiple banks.  Each bank has its own port to the MSMC block, so up to 4 DSP (6678 has 4 banks, 66AH2K12 has 8 banks) can access at teh same time

    Please for more questions open a new e2e thread.  We are encouraged to close threads, and if you add more questions we cannot.  So put a new question in a new thread

    To answer your first question

    When you invalidate memory the value does not go.  Only the validate bit is changed.  The CCS might show the value that is in the memory but you want to look at the valid bit.  If a value is invalid the system ignore this value and will read again from the memory.

    About Documentations, you can find a lot in CCS help, for example look at

    Ran