Forum Discussion
Altera_Forum
Honored Contributor
15 years agowhere does code resides
one small querry.. when i use external SRAM in my design using nios2 for DE1 board my code wil be placed there in sram .. i want my code to be in onchip memory.. not sram.. how to do this..please he...
Altera_Forum
Honored Contributor
15 years agoYou can find which sections are actually in a program by running 'objdump -h prog.o'.
You might also see .sdata, .sbss (ie normal data sections with an extra 's' (for small) in their names). The compiler generated code to access these will use offsets from the 'gp' (global pointer) register to save code space and increase execution speed. These sections must be linked together and must not exceed 64k bytes, the 'gp' register is set to the symbol _gp which is (IIRC) 32k bytes above the base of the small data areas.