
Instruction Cache
3-10
ADSP-2126x SHARC Processor Hardware Reference
An example of inefficient cache code appears in
. The PM bus
data access at address 0x101 in the loop,
Outer
, causes a bus conflict and
also causes the cache to load the instruction being fetched at 0x103 (into
set 3). Each time the program calls the subroutine,
Inner
, the program
memory data accesses at 0x201 and 0x211 displace the instruction at
0x103 by loading the instructions at 0x203 and 0x213 (also into set 3). If
the program rarely calls the
Inner
subroutine during the
Outer loop
exe-
cution, the repeated cache loads do not greatly influence performance. If
the program frequently calls the subroutine while in the loop, cache ineffi-
ciency has a noticeable effect on performance. To improve cache efficiency
on this code (if for instance, execution of the
Outer
loop
is time critical),
rearrange the order of some instructions. Moving the subroutine call up
one location (starting at 0x201) also works. By using that order, the two
cached instructions end up in cache set 4, instead of set 3.
Table 3-1. Cache Inefficient Code
Address
Instruction
0x0100
lcntr = 1024, do Outer until LCE;
0x0101
r0 = dm(i0,m0), pm(i8,m8) = f3;
0x0102
r1 = r0 – r15;
0x0103
if eq call (Inner);
0x0104
f2 = float r1;
0x0105
f3 = f2 * f2;
0x0106
Outer: f3 = f3 + f4;
0x0107
pm(i8,m8) = f3;
...
0x0200
Inner: r1 = R13;
0x0201
r14 = pm(i9,m9);
...
0x0211
pm(i9,m9) = r12;
Содержание ADSP-21261 SHARC
Страница 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Страница 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Страница 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Страница 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Страница 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Страница 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...