Altera_Forum
Honored Contributor
11 years agoNios f / Custom MM Slave
Hi all,
I know this has been asked several times on the forum but I must be missing the point as I'm still at encountering the issue. I have tested my SoPC fine with the nios e. The problems occur when using the nios f. I have the data and instruction caches set to 4kb's, and after a bit of reading(and testing) I know I need to bypass my data cache to successfully test my system with my custom MM slave. The address of my MM slave in Qsys is 00081_1100 - 0x0081_117f. In my header file avs.h, the base address matches that of system.h(and Qsys of course)#define avs_base 0x811_1100 As I'm using HAL, I know there are 3 methods to bypass the cache: 1. Bypass by using IORD and IOWR. 2. Set bit 31 3. Use alt_remap_uncached() As I have my program written, I was hoping to implement# 3 in my avs.c file by the following method: # include "aes.h"# include <stdio.h># include <sys/alt_cache.h>
........................# define avsrange 177
int main{
// insert alt_remap_uncached
.......
}
Would I be correct so far, and in saying this would be the most straightforward method to implement? I have reviewed the documentation but it's not becoming any clearer in my mind. Going by this document (http://www.altera.com/literature/hb/nios2/n2sw_nii52010.pdf) the function is defined as volatile void* alt_remap_uncached (void* ptr,
alt_u32 len);
where 'ptr' is starting address and 'len' is the memory range. So, would this translate, in my example, to: alt_remap_uncached((void*)AVS_BASE, avsrange); Edit: I know the last piece of code does not work. Also, I am not using the nios MMU so perhaps option 2 is workable.