5-2
Optimizing DSP56300/DSP56600 Applications
MOTOROLA
Instruction Cache and Memory Features
The Instruction Cache
Activating the cache requires only setting the CE bit in the SR. The
following instruction activates the cache:
bset
#19,SR
Because of pipelining, allow four instructions to execute before
assuming the cache is active. Disabling the cache is done by clearing
that bit.
Note:
For obvious reasons, the user should not enable the cache
while running from the cacheable memory area itself.
To demonstrate the benefit of cache use, consider the example in
, taken from a benchmark for FIR lattice filter (the
DSP56300 Family Manual
,
Appendix C
).
In the example, each external fetch inserts 3 wait states. Therefore,
the execute time needed for each instruction in the loop is 4 cycles: 1
cycle for execution, and 3 wait states for the instruction that is being
fetched in parallel. In other words, due to the pipelining, the wait
states of an instruction stalls the execution of the instruction
Table 5-1
Example for Cycle Count with Cache Enabled Versus
Disabled
Program Code
Program
Words
Hit
Cycles
External
Miss
Cycles
movep x:IN,b
1
1
4
move
x:(r0)+,x0
y:(r4)+,y0
1
1
4
move
b,a
1
1
4
do
#N,_END
2
5
11
macr x0,y0,b
b,y1
1
1
4
tfr x0,a
x:(r0)+
1
1
4
macr y1,y0,a
x:(r0),x0
y:(r4)+,y0
1
1
4
_END
movep b,x:OUT
1
1
4
move
a,x:(r0)+
y:(r4)-,y0
1
1
4
Total:
3N+10
12N+31
Содержание DSP56300
Страница 49: ...3 20 Optimizing DSP56300 DSP56600 Applications MOTOROLA Program Control Using Fast Interrupts ...
Страница 95: ...7 10 Optimizing DSP56300 DSP56600 Applications MOTOROLA Compact Opcode Use Special Instructions ...
Страница 99: ...A 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Saving Power Disabling Functional Blocks ...
Страница 103: ...B 4 Optimizing DSP56300 DSP56600 Applications MOTOROLA Debug and Test Support Address Tracing ...