Saving And Resuming Loops - Analog Devices ADSP-BF53x Blackfin Reference

Table of Contents

Advertisement

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
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/BF56x Blackfin Processor Programming Reference
instruction that invokes an unknown
CALL
Program Sequencer
4-27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Adsp-bf56x blackfin

Table of Contents