IP-NIOS Altera, IP-NIOS Datasheet - Page 168

no-image

IP-NIOS

Manufacturer Part Number
IP-NIOS
Description
IP NIOS II MEGACORE
Manufacturer
Altera
Type
Licenser
Datasheets

Specifications of IP-NIOS

Processor Type
RISC 32-Bit
Lead Free Status / RoHS Status
Not applicable / Not applicable
Features
-
Package / Case
-
Mounting Type
-
Voltage
-
Speed
-
7–4
Figure 7–1. Stack Pointer, Frame Pointer and the Current Frame
Nios II Processor Reference Handbook
Frame Pointer Elimination
Call Saved Registers
Further Examples of Stacks
Stack pointer
Higher addresses
Lower addresses
Figure 7–1
a() calls function b(), and the stack is shown before the call and after the prologue in
the called function has completed.
Each section of the current frame is aligned to a 32-bit boundary. The ABI requires the
stack pointer be 32-bit aligned at all times.
The frame pointer is provided for debugger support. If you are not using a debugger,
you can optimize your code by eliminating the frame pointer, using the
-fomit-frame-pointer compiler option. When the frame pointer is eliminated,
register fp is available as a temporary register.
The compiler is responsible for saving registers that need to be saved in a function. If
there are any such registers, they are saved on the stack, from high to low addresses,
in the following order: ra, fp, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15,
r16, r17, r18, r19, r20, r21, r22, r23, r24, r25, gp, and sp. Stack space is not allocated
for registers that are not saved.
There are a number of special cases for stack layout, which are described in this
section.
Just prior to calling b()
In function a()
arguments
shows an example of the structure of a current frame. In this case, function
Outgoing
stack
Frame pointer
Stack pointer
Just after executing prologue
In function b()
Return address
Saved frame
Other saved
temporaries
arguments
arguments
Space for
Space for
Incoming
registers
outgoing
pointer
stack
stack
stack
Allocated and freed by a()
Allocated and freed by b()
(i.e. the calling function)
(i.e. the current function)
Chapter 7: Application Binary Interface
December 2010 Altera Corporation
Stacks

Related parts for IP-NIOS