I have a cache coherency issue. If I changed variable in shared RAM in one of cores it's doesn't update it in another or it's update only one time. Currently I'm using only four cores. I have separate images per all cores and the same cfg file and memory map.
My buffers declarations:
float (*A_ES1)[6][6] = (float (*)[6][6]) 0x0C200000; //for CORE1 float (*A_ES2)[6][6] = (float (*)[6][6]) 0x0C200100; //for CORE2 float (*A_ES3)[6][6] = (float (*)[6][6]) 0x0C200200; //for CORE3 float (*B_ES1)[6] = (float (*)[6]) 0x0C200300; //for CORE1 float (*B_ES2)[6] = (float (*)[6]) 0x0C200320; //for CORE2 float (*B_ES3)[6] = (float (*)[6]) 0x0C200340; //for CORE3 float (*Vs_1)[3] = (float (*)[3]) 0x0C200360; //for CORE1 float (*Vs_2)[3] = (float (*)[3]) 0x0C200370; //for CORE2 float (*Vs_3)[3] = (float (*)[3]) 0x0C200380; //for CORE3
A_ES1...AES3 and B_ES1...B_ES3 - it's IN buffer inside the CORE0, but IN/OUT buffer inside the CORE1...3
Vs_1 - it's OUT buffer inside the CORE0, but IN buffer inside the CORE1...3
Here is code for CORE0:
CACHE_wbInvL1d (&A_ES1, 256, CACHE_FENCE_WAIT); CACHE_wbInvL1d (&A_ES2, 256, CACHE_FENCE_WAIT); CACHE_wbInvL1d (&A_ES3, 256, CACHE_FENCE_WAIT); //do something with A_ES1...3 buffers - only read operation CACHE_wbInvL1d (&B_ES1, 32, CACHE_FENCE_WAIT); CACHE_wbInvL1d (&B_ES2, 32, CACHE_FENCE_WAIT); CACHE_wbInvL1d (&B_ES3, 32, CACHE_FENCE_WAIT);
//do something with B_ES1...3 buffers - only read operatio
...
CACHE_invL1d (&Vs_1, 16, CACHE_FENCE_WAIT);
CACHE_invL1d (&Vs_2, 16, CACHE_FENCE_WAIT);
CACHE_invL1d (&Vs_3, 16, CACHE_FENCE_WAIT);
//do something with buffers - only write operation
CACHE_wbL1d (&Vs_1, 16, CACHE_FENCE_WAIT);
CACHE_wbL1d (&Vs_2, 16, CACHE_FENCE_WAIT);
CACHE_wbL1d (&Vs_3, 16, CACHE_FENCE_WAIT);
...
And similar code for other cores:
... CACHE_wbInvL1d (&A_ES1, 256, CACHE_FENCE_WAIT); CACHE_wbInvL1d (&B_ES1, 32, CACHE_FENCE_WAIT); //do something with buffers A_ES1 and A_ES2 - read and write operation CACHE_wbL1d (&A_ES1, 256, CACHE_FENCE_WAIT); CACHE_wbL1d (&B_ES1, 32, CACHE_FENCE_WAIT); ... CACHE_wbInvL1d (&Vs_1, 16, CACHE_FENCE_WAIT); //do something with buffers Vs_1 - read and write operation ...
I'm using BIOS and IPC for Notify (synchronization purposes), but cache is taken from CSL because it's probably faster than BIOS.