So I've implemented a NIOS II board using the SOPC builder. I ran out of on-chip memory so I went off-chip to the DE2's SRAM. Suddenly my programs stopped working and the for loops has an unusual behavior.
It'll go outside of the for loop..
for instance:
----------------- //assume variables defined
For (i = 0; i < 3999999; i++) { IOWR_8DIRECT(memory_base, i, 0xff); //Writes all 1's to SDRAM }
printf("Finished...\n");
... more code...
------------------
What ends up happening is that the loop will run with the printf("Finished...") statement and repeat for the duration of the loop.
Output: Finished... Finished... Finished... . . You get the idea... I didn't let it loop 4 million times you see what happened.
This ONLY happens when I use the SRAM. If I use the SDRAM or the on- chip memory it works fine.
Any one run into this problem?
Thanks, el