Digital Signal Processing Reference
In-Depth Information
1.
.cinit
: for global and static variables
2.
.const
: for global and static constant variables
3.
.switch
: contains jump tables for large switch statements
4.
.text
: for executable code and constants
The uninitialized sections are:
1.
.bss
: for global and static variables
2.
.far
: for global and static variables declared far
3.
.stack
: allocates memory for the system stack
4.
.sysmem
: reserves space for dynamic memory allocation used by the
malloc
,
calloc
, and
realloc
functions
The linker can be used to place sections such as text in fast internal memory for
most efficient operation.
3.17.2 Data Alignment
The C6x always accesses aligned data that allow it to address bytes, half-words, and
words (32 bits). The data format consists of four byte boundaries, two half-word
boundaries, and one word boundary. For example, to assign a 32-bit load with
LDW
,
the address must be aligned with a word boundary so that the lower 2 bits of the
address are zero. Otherwise, incorrect data can be loaded. A double-word (64 bits)
also can be accessed. Both
.S1
and
.S2
can be used to execute the double-word
instruction
LDDW
to load two 64-bit double words, for a total of 128 bits per cycle.
3.17.3 Pragma Directives
The pragma directives tell the compiler to consider certain functions. Pragmas
include
DATA_ALIGN
,
DATA_SECTION
, and so on. The
DATA_ALIGN
pragma has
the syntax
#pragma DATA_ALIGN (symbol,constant);
that aligns
symbol
to a boundary. The constant is a power of 2. This pragma direc-
tive is used later in several examples (such as in FFT program examples) to align
data in memory.
The
DATA_SECTION pragma
has the following syntax:
#pragma DATA_SECTION (symbol,“my_section”);
which allocates space for
symbol
in the section named
my_section
. This
pragma
directive is useful to allocate a section in external memory. For example,
Search WWH ::
Custom Search