Forum Discussion
Altera_Forum
Honored Contributor
16 years agotest sram in nios ok,but sram can not be program memory
Hi everyone! I have a test program for sram like as follows: alt_u16 *temp=SRAM_16BIT_512K_BASE; alt_u16 i=0; alt_u16 data[100]; int main(void) { for(i=100;i<200;i++) { *(te...
Altera_Forum
Honored Contributor
16 years agoJust for your information, your code may not actually test your sram. The Nios CPU has a data cache, and with only 100 16-bit accesses, it is probably all kept in the cache.
In order to actually test the SRAM, you would need to either use the alt_remap_uncached() function to define your temp pointer, or use the IORD/WR macros to read/write the memory.