Caching of external memory


We are working on a Virtex4 FX12 PowerPC system. The code below is stored in BRAM and so are the stack and heap.

Using cache on the external memory crashes the program after approx.

10000 checks. When only caching BRAM it works fine.

The program below clears the memory, then it checks half the memoryspace for zeros and writes the addresses of the zeros in the other half.

Any sugestions why caching of external memory doesn't work?

/////// CODE ////////////////////


Xuint32* CheckPtr = (Xuint32*)CHECK_BASE_ADDR; Xuint32* WritePtr = (Xuint32*)WRITE_BASE_ADDR;

int main (void) {

ClearMemory();//write zeros at all memory locations

XCache_EnableICache(0x00000001); XCache_EnableDCache(0x80000001);

while(1) { if(*CheckPtr==0) { *WritePtr = CheckPtr; if(++WritePtr > WRITE_HIGH_ADDR) WritePtr = WRITE_BASE_ADDR; } if(++CheckPtr > CHECK_HIGH_ADDR) CheckPtr = CHECK_BASE_ADDR; } }

Reply to
Rune Dahl Jorgensen
Loading thread data ...


Just an update for anybody reading this thread later.

We found a work around. After updating from EDK 8.2 SP1 to SP2, we where able to connect to the memory through the PLB instead of the OPB bus. This change made the cache function correctly.

It was a beautiful and sunny day when Rune Dahl Jorgensen wrote news:Xns988CA6BF53518runedahl23223@ in comp.arch.fpga:

Rune D. Jorgensen
Reply to
Rune D. Jørgensen

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.