Loops and Sequencing
3-26
ADSP-2126x SHARC Processor Hardware Reference
When executing a
DO
/
UNTIL
instruction, the program sequencer pushes the
address of the loop’s last instruction and its termination condition onto
the loop address stack. The sequencer also pushes the top-of-loop
address—the address of the instruction following the
DO/UNTIL
instruc-
tion—onto the PC stack.
The sequencer’s instruction pipeline architecture influences loop termina-
tion. Because instructions are pipelined, the sequencer must test the
termination condition and, if the loop is counter-based, decrement the
counter before the end of the loop. Based on the test’s outcome, the next
fetch either exits the loop or returns to the top-of-loop.
The termination condition test occurs when the DSP is executing the
instruction that is two locations before the last instruction in the loop (at
location
e – 2
, where
e
is the end-of-loop address). If the condition tests
false, the sequencer repeats the loop and fetches the instruction from the
top-of-loop address, which is stored on the top of the PC stack. If the con-
dition tests true, the sequencer terminates the loop and fetches the next
instruction after the end of the loop, popping the loop and PC stacks.
A special case of loop termination is the loop abort instruction,
JUMP (LA)
.
This instruction causes an automatic loop abort when it occurs inside a
loop. When the loop aborts, the sequencer pops the PC and loop address
stacks once. If the aborted loop was nested, the single pop of the stacks
leaves the correct values in place for the outer loop.
and
show the pipeline states for loop iteration and
termination.
Содержание 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 ...