Forum Discussion
Altera_Forum
Honored Contributor
18 years agoInstead of declaring arrays, declare pointers, and initialize them with an address (which might be defined in system.h, or you might add offsets to the values from system.h).
If one memory is already where your .rodata and .rwdata are being placed, then you only need a pointer for the other one. Example - if you are running code from sdram, your compiler setting are probably also placing .rwdata in the sdram as well, so just set a pointer to the SRAM like so: alt_u32 * my_sram = ONCHIP_MEMORY_0_BASE ; Now you can use my_sram[i] as an array of 32 bit values. (Assuming ONCHIP_MEMORY_0_BASE is defined in your system.h). Or if your code and .rwdata are in the onchip SRAM, then instead setup a pointer to the base address of the SDRAM. \chuck