Altera_Forum
Honored Contributor
20 years agoAccessing on chip memory
I recently added 1KB of on chip memory and am trying to write to this location without success. There is still external SRAM in our design; however, I'd like to utilize the on chip memory to minimize trips out on the bus. I know it's easy to turn on cache, but I'd still like to figure this out.
Essentially I'm trying to someting like the following: char *on_chip_memory = ((char *)ONCHIP_MEMORY_0_BASE); *on_chip_memory = 0; .. do something else with application // now set on_chip_memory value *on_chip_memory = 1; It appears that no matter what value I try to set in the on chip memory space, it always has the contents of the original .hex file. I have chosen RAM (read/write) option from SOPC Builder, but still nothing. I can see there's an option in the system library properties that allow me to change .rodata and .rwdata (currently set to external sram); however I don't want to alter my current system. What I'm looking/hoping to do is add this 1KB of on chip memory with read and write abilities in addition to the external sram. I'm somewhat confused since I've been able to do this in the past with Nios I designs. Am I missing something or doing something wrong? Thanks, -Mark