ADSP-BF53x/BF56x Blackfin Processor Programming Reference
4-27
Program Sequencer
Saving and Resuming Loops
Normally, loops can process and terminate without regard to system-level
concepts. Even if interrupted by interrupts or exceptions, no special care is
needed. There are, however, a few situations that require special atten-
tion—whenever a loop is interrupted by events that require the loop
resources themselves, that is:
• If the loop is interrupted by an interrupt service routine that also
contains a hardware loop and requires the same loop unit
• If the loop is interrupted by a preemptive task switch
• If the loop contains a
CALL
instruction that invokes an unknown
subroutine that may have local loops
In scenarios like these, the loop environment can be saved and restored by
pushing and popping the loop registers. For example, to save Loop Unit 0
onto the system stack, use this code:
[--SP] = LC0;
[--SP] = LB0;
[--SP] = LT0;
To restore Loop Unit 0 from system stack, use:
LT0 = [SP++];
LB0 = [SP++];
LC0 = [SP++];
It is obvious that writes or pops to the loop registers cause some internal
side effects to re-initialize the loop hardware properly. The hardware does
not force the user to save and restore all three loop registers, as there might
be cases where saving one or two of them is sufficient. Consequently,
every pop instruction in the example above may require the loop hardware
to re-initialize again. This takes multiple cycles, as the loop buffers must
also be prefilled again.
Содержание ADSP-BF53x Blackfin
Страница 38: ...Conventions xxxviii ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 134: ...System Reset and Powerup 3 18 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 324: ...Instruction Overview 7 20 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 486: ...Instruction Overview 13 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 512: ...Instruction Overview 14 26 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 604: ...Instruction Overview 15 92 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 688: ...Instruction Overview 18 48 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 742: ...Instruction Overview 19 54 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 752: ...Examples 20 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 780: ...Product Identification Register 21 28 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 790: ...ADSP BF535 Flags A 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 800: ...Performance Monitor Registers B 10 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 994: ...Instructions Listed By Operation Code C 194 ADSP BF53x BF56x Blackfin Processor Programming Reference...
Страница 1042: ...Index I 40 ADSP BF53x BF56x Blackfin Processor Programming Reference...