Technical information
Dependencies with Hardware Looping
Converting Applications for Increased Data and Program Memory 23
Code Example 33. Code Without AGU Pipeline Dependencies on DSP56800
n1: move y1,x:>tx_quad ; Store tx_quad
n2: add b,a ; Get the actual address of variable
n3: move a,r1 ; in r1
n4: nop ; Necessary to avoid dependency on DSP56800
n5: move x:(r1)+,a1 ; Get the variable
On DSP56800 the NOP introduced in instruction n4, avoids the pipeline dependency. On DSP56800E,
there are 2 cycles needed to avoid the pipeline dependency, therefore the dependency remains even though
a NOP was introduced and the core will stall 1 cycle. Seven cycles are needed to execute this sequence on
DSP56800E. Removing the NOP does not influence the execution time. Moving instruction n1, which is
performed in 2 cycles, instead of n4, reduces the number of cycles to five. The code sequence is presented
in Code Example 34.
Code Example 34. AGU Pipeline Dependency Avoided in DSP56800E Optimized Code
n2: add b,a ; Get the actual address of variable
n3: moveu.w a,r1 ; in r1
n4’:move.w y1,x:>tx_quad ; Store tx_quad
n5: move.w x:(r1)+,a1 ; Get the variable
Avoiding the AGU pipeline dependencies provides an opportunity to improve the speed of the ported
application and to improve the size of code. Because the DSP56800 applications usually contain inserted
NOPs to avoid the dependencies, NOPs can be removed from the DSP56800E code.
5.3 Dependencies with Hardware Looping
Other dependencies, which did not appear on DSP56800, are those regarding the hardware looping. They
occur when the LC register is loaded prior to executing one of the hardware looping instructions (DO,
DOSLC, or REP). Because of the architecture of the instruction pipeline, none of the hardware looping
instructions can be executed immediately after a value is placed in the LC register.
In V.22 bis there were no dependencies of this type, but on occasion they could appear in ported code.
6 Converting Applications for Increased Data and
Program Memory
DSP56800E provides extended data memory space (24-bit data addresses instead of 16-bit) and extended
memory space (21-bit program addresses instead of 16-bit). However, for a program that was written for
the DSP56800 family to use DSP56800E extended memory, it is necessary to perform certain changes in
the source code. These modifications are not always “automatic” and require a careful inspection of all
source code.
This section describes these modifications, which are performed on a DSP56800E application (obtained by
porting DSP56800 code), to make use of the extended data and program memory.
The examples are from a small application which uses the state machine from the original modem and
performs scrambling and descrambling over a number of nibbles.
Note that the application does not require such a large amount of data and program memory. So both
program and data memory must be forced to use extended memory by two “ORG” directives placed before
all the code and all the data declarations.
Fr
eescale S
emiconduct
or
, I
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
nc...