Technical information

RXDEMOD
Writing DSP56800E Code from Scratch 17
The main project contains only one place where two imbricated DO loops are used, in the function RXBPF
from the file rx_bpf.asm. The function performs band pass filtering and contains an outer loop that
executes 12 times.
This optimization method saves 60 (5 × 12) cycles per symbol out of an initial average of 4278.5 cycles per
symbol. This single method produces an improvement of 1.4 percent.
4 Writing DSP56800E Code from Scratch
The methods described in Section 3, Optimizing the Ported Code, preserve the original design of the
functions. However, this design was influenced by DSP56800 limitations. This section compares the
results of optimizing the ported code to those of writing entirely new DSP56800E code from scratch.
The functions RXDEMOD, a DSP function, and RXEQERR, a control function, illustrate the comparison.
Both of them were written from scratch, tested, and benchmarked. Then they were compared to the
optimized ported versions.
Writing DSP56800E code from scratch obtained better use of the following features (compared to the
process of optimizing the ported code):
Increased register set
. When a function is being designed, the additional accumulators, address
registers, and index registers provide more flexibility in arranging variables in registers and in
deciding which variables to store in memory.
More flexible instruction set
. The new register combinations and addressing modes that the
DSP56800E allows for many instructions provide more freedom to place variables in registers and
to design the data flow.
AGU arithmetic
. When DSP56800E code is written from scratch, AGU arithmetic is naturally used
whenever pointer manipulation is required. This capability eliminates some transfers from data
registers to address registers and also enables the application to use the extended memory space.
New data types
. Instead of being used to modify existing code and data structures, 32-bit and 8-bit
instructions and memory access can be used more simply from the start.
The main reason why writing from scratch is better is that it enables programmers to reconsider the code in
its entirety. When optimizing ported code, one usually inspects small groups of instructions that can be
replaced with other groups of instructions and usually avoids considering larger portions of code.
The optimized ported versions and the written from scratch versions of the two functions are presented in
Appendix A. Section 4.1, RXDEMOD, and Section 4.2, RXEQERR, present specific issues about
these functions. The code examples presented in these subsections were obtained after the functions were
rewritten and parts of equivalent code were identified.
4.1 RXDEMOD
Comparative results for the initial code, optimized ported code, and written from scratch code are
presented in Table 7.
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...