我在做多核的同步的时候,定义了一个int型的flag,并且把它放到了MSMC中。在core0中将其值改写为1,但在其他核中该值依然是0,并没有随着core0改变。
怀疑是cache一致性的问题,于是加入了CACHE_invL1d((void *)(&flag),sizeof(int),CACHE_WAIT);但结果依旧。
麻烦帮我看一下。
非常感谢TI的工作人员和各位网友!
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 operations on Core 0 are:
Write Flag at shared memory
If(Cache is enabled for access shared memory)
{
If(L2 Cache Size>0)
{
CACHE_wbL2(flag address, size of flag);
}
Else if(L1D Cache Size>0)
{
CACHE_wbL1D(flag address, size of flag);
}
}
The operations on Core 1 are:
If(Cache is enabled for access shared memory)
{
If(L2 Cache Size>0)
{
CACHE_invL2(flag address, size of flag);
}
Else if(L1D Cache Size>0)
{
CACHE_invL1D(flag address, size of flag);
}
}
If(Prefetch buffer is enabled for access Core X’s L2 RAM)
{
Invalidate Prefetch Buffer;
}
Read Flag at shared memory
请问:CACHE_invL2(flag address, size of flag);CACHE_wbL2(flag address, size of flag);这两个函数中第二个变量是否有长度限制?
如果我L2开了256KB的cache空间,0核写大于256KB的数据时,1核去访问是否有问题?