Andes Workshop

It is currently Fri Jun 23, 2017 7:15 pm

All times are UTC + 8 hours [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: How to lock cache in demo-cache-lock project
PostPosted: Wed Apr 12, 2017 4:15 pm 
Offline

Joined: Thu Apr 14, 2011 11:27 am
Posts: 13
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group