AN2113 Freescale Semiconductor / Motorola, AN2113 Datasheet - Page 7

no-image

AN2113

Manufacturer Part Number
AN2113
Description
AN2113 Multichannel Voice Coding System on the RTXC Operating System
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
C Compilers
4
C Compilers
Embedded applications are written primarily in C, which is becoming mandatory due to time-to-market
constraints, reusability, and portability demands. In the quest for C programmability of DSPs, the key
concern is to optimize the DSP code. Every clock cycle is precious because of the real-time environments
in which DSPs operate. For example, in a wireless link the DSPs handle filtering, signal encoding, channel
encoding, chip rate processing, and the inverse of all these steps within a mandatory time delay that is not
noticeable to those involved in the conversation. Today’s C compilers are designed to tackle DSP
programmability constraints.
DSP C compilers must harness the power of the DSP architecture. Primary DSP features that must be
accessible to the programmer include MAC instructions, hardware DO loops, modular addressing,
efficient memory access, and parallel operation of computing units. Ideally, the compiler flexibly uses all
the DSP assembly instructions to maintain highly efficient code. DSP instructions are designed for
efficiency so a C compiler must strive to retain assembly efficiency while adding its own positive
attributes, such as programmability and portability.
One difficulty of DSP C compiler development is the variability of DSP instruction sets themselves. For
instance, each product line of DSPs has a unique instruction set, and even within a family of DSPs added
device functionality may need to be considered. For example, in the Motorola DSP56300 family, each
device has a different memory map due to differently sized memory. The DSP56301 has 24 KB of
memory; the DSP56311 has 512 KB. The compiler must be aware of the memory constraints when
building an application. Another difference among the DSP56300 family is the peripherals. Some devices
contain the EFCOP, which yields a substantial increase in processing power since it has its own MAC
(multiply-accumulate) unit and can handle its computational tasks independently from the core ALU. The
differences in peripherals make it necessary to have new compiler header files for each DSP within a
family. For this application note, we use the Tasking C compiler, which has a full line of support for the
DSP56300 family—in addition to the standard tool set consisting of the macro assembler, linker/locator,
libraries, Cross View Pro Debugger and Embedded Development Environment (EDE). Collectively, these
tools are called the DSP56xxx software development tools. Examining some features of the Tasking tools
can give you an idea of what today’s C compilers must provide to be usable in real-time DSP applications.
To achieve code efficiency, the compilers apply optimization techniques. Compiler extensions allow you
to program your specific applications, such as filters, in C without significant overhead. Use of the
fractional data type and memory source qualifiers helps to optimize loops and exploits the parallel
execution capability of the DSP. Bit field operations are optimized by use of the EXTRACT and
EXTRACTU operations. The compiler supports the 16- and 24-bit modes of the DSP56300. Furthermore,
the Tasking tool suite uses a calling convention that guarantees better use of registers and therefore less
function call overhead.
To further aid in optimizing DSP code, C compiler tool suites must offer other features. Tasking supports
in-line assembly functions that translate directly, without overhead, to specific DSP capabilities. Tasking
also allows for adjustable code generation with
. A pragma is a set of instructions that can be
#pragmas
written to control the individual compiler optimizations, to allocate character arrays, and to handle the
cache. Circular buffer-type modifiers give efficient memory access. Tasking also provides floating-point
libraries and memory models to support the different memory sizes across the DSP56xxx line.
Within the Tasking EDE, makefiles can be created directly from the GUI window. This is convenient for
code development.
Multichannel Voice Coding System
7
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2113