Forum Discussion
Altera_Forum
Honored Contributor
9 years agoThis should be a valuable reference - Altera's memory test example:
https://www.altera.com/support/support-resources/design-examples/intellectual-property/embedded/exm-c-memory.html It helped me when I had the same questions. As far as what you use to write directly to memory (ocram, sdram, ddr, etc), the function "IOWR_32DIRECT" is what you need to use. Explore the memtest example code and it will be much more clear. Also, don't forget "system.h" in the BSP so that you know the# define base addresses of the memories. Do remember, if you are writing to the same RAM as NIOS, you can have issues. To keep things simple at first, ensure you setup your BSP so that NIOS isn't executing in the same memory that you are directly writing to. Altera has a similar warning in their demo. Hope that helps. If anyone sees any errors please add your 2 cents!