User guide

Nios II IDE Help System
Linker Script
These settings configure the linker script used when building the project.
Custom linker script—When selected, you create and manage your own linker script,
and specify it here.
Note: Altera strongly recommends that you use the auto-generated linker script.
Auto-generated linker script—When selected, the Nios II IDE automatically creates
and manages a linker script that is sufficient for most system compilation needs. When
using this option, you must specify the following:
o Program memory (.text) —Specifies where executable code resides in
physical memory.
o Read-only data memory (.rodata)—Specifies where read-only data resides
in physical memory.
o Read/write data memory (.rwdata)—Specifies where read/write data
resides in physical memory.
o Heap memory - Specifies where the heap resides in physical memory.
o Stack memory - Specifies where the stack resides in physical memory.
o Use a separate exception stack - When on, the exception stack resides in
separate physical memory. Placing the exception stack in a fast memory
improves the performance of exception handling.
Exception stack memory—Specifies where the exception stack
resides in physical memory, when Use a separate exception stack
is on.
Maximum exception stack size (bytes)—Specifies the maximum
size of the exception stack, when Use a separate exception stack is
on.
You can also use the __attribute__ declaration in C code to specify which memory to use for
a specific block of code. The Nios II IDE creates a corresponding memory section for each
memory device defined in the SOPC Builder system (see system.h). For example, a memory
device named "on_chip_memory" has an associated memory section named
".on_chip_memory". The follow examples demonstrate how to force a function or a variable to
reside in a specific memory.
/* data should be initialized when using the section attribute */
int foo __attribute__ ((section (".ext_ram.rwdata"))) = 0;
void bar (void) __attribute__ ((section (".sdram.txt")));
void bar (void)
{
foo++;
}
Related Nios II IDE Help Topics
Properties Dialog Box
About Profiling with the Nios II IDE
Related Topics on the Web
Nios II Processor Reference Handbook at
www.altera.com/literature/hb/nios2/n2cpu_nii5v1.pdf—Includes a complete list of
unimplemented instructions.
Nios II literature web page
124