Andes Workshop
https://forum.andestech.com/

How to lock cache in demo-cache-lock project
https://forum.andestech.com/viewtopic.php?f=25&t=975
Page 1 of 1

Author:  jimmy [ Wed Apr 12, 2017 4:15 pm ]
Post subject:  How to lock cache in demo-cache-lock project

The cache lock Scanario in demo-cache-lock are:
For example,
1. set g_selfmodify = 7777777.
2. lock cache. If g_selfmodify = 7777777, it means cache lock successfully.
Note:Keep the set value same.
3. unlock cache. if g_selfmodify = 8888888, it means cache unlock successfully.



Implement cache lock by following function:
void ICacheLock(unsigned int* va)
{
//uart_puts("Calling ICacheLock()\n");

__nds32__cctlva_lck(NDS32_CCTL_L1I_VA_FILLCK, va);

//uart_puts("End of Calling ICacheLock()\n");
}


Argument "va" of above function is the start address of code. above function only lock one cache line 32 bytes.
For example, if you want to lock 40 bytes code, you have to run ICacheLock() 2 times to cover 40 bytes code.

Page 1 of 1 All times are UTC + 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/