
6-4
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
Memory Configuration and Management
DSP56KCC provides three different memory models to minimize these differences. They
are the x memory model, y memory model and l memory model. Selection of the
appropriate memory model is made using the -m option of the control program, G56k (see
Section 3.2.2, "Compile Phase Options," on page 3-20). The memory configuration for
each memory model is discussed later in this section. The
crt0
file can be modified to
configure memory for any hardware design.
There are four data segments in the C programming environment. These are the program
segment, global-static data segment, stack data segment and heap data segment. The
program segment is located in program memory. The three data segments can be located
in x memory, y memory or l memory space (which is a concatenation of x and y memory)
depending on the memory model used.
Figure 6-1. Environment Memory Configuration
As indicated in Section 5.1, "Overview," on page 5-1, global and static data reside at the
bottom of the available data memory and the top address of the global and static data area,
which is called DSIZE, is set by the linker. The constant TOP_OF_MEMORY is defined
to indicate the top of the entire available memory.
The two data segments, heap and stack, are located as shown Section 5.1, "Overview," on
page 5-1. The stack is located so that it can grow up and the heap is located so that it can
grow down. There are two locations used to indicate the initial values for the heap pointer
and stack pointer. These locations are
_ _y_size
and
_ _break
and are initialized in the
crt0
file as DSIZE and TOP_OF_MEMORY, respectively.
X MEMORY MODEL
Global / Static
Stack
Heap
_ _y_size
_ _break
X:
TOP_OF_MEMORY
DSIZE
Y MEMORY MODEL
Global / Static
Stack
Heap
Y:
L MEMORY MODEL
Global / Static
Stack
Heap
L:
Stack Pointer
F
Freescale Semiconductor, Inc.
n
.