Digital Signal Processing Reference
In-Depth Information
statements into assembly files, respectively. The -k option is used to keep the assem-
bly source files generated.
Four levels of compiler optimizations are available, with -o3 to invoke the
highest level of optimization. Level 0 allocates variables to registers. Level 1 per-
forms all level 0 optimizations, eliminates local common expressions, and removes
unused assignments. Level 2 performs all the level 1 optimizations plus loop opti-
mizations and rolling. Level 3 performs all level 2 optimizations and removes func-
tions that are not called. There are also compiler optimizations to minimize code
size (with possible degradation in execution speed).
Note that full optimization may change memory locations that can affect the
functionality of a program. In such cases, these memory locations must be declared
as volatile. The compiler does not optimize volatile variables. A volatile variable is
allocated to an uninitialized section in lieu of a register. Volatiles can be used when
memory access is to be exactly as specified in the C code.
Initially, the functionality of a program is of primary importance. One should not
invoke any (or too-high-level) optimization option initially while debugging, since
additional debugger-specific information is provided to enhance the debugging
process. Such additional information suppresses the level of performance. It is also
difficult to debug a program after optimization, since the lines of code are usually
no longer arranged in a serial fashion. Compiler options can also be set using the
environment variable with C_OPTION .
1.8.2 Assembler
An assembly-coded source file file3.asm can also be assembled using
asm6x file3.asm
to create file3.obj . The .asm extension is optional. The resulting object file is then
linked with a run-time support library to create an executable COFF file with exten-
sion .out that can be loaded directly and run on the DSp. Examples using assem-
bly-coded source files are introduced in Chapter 3.
1.8.3 Linker
The linker can be invoked using
lnk6x -c prog1.obj -o prog1.out -l rts6700.lib
The -c option tells the linker to use special conventions defined by the C environ-
ment for automatic variable initialization at run time (another linker option, -cr ,
initializes the variables at load time). The -l option invokes a library file such as
the run-time support library file rts6700.lib . These options [ -c (or -cr ) and
Search WWH ::




Custom Search