ADSP-2126x SHARC Processor Hardware Reference
3-33
Program Sequencer
same empty and overflow status flags from the
STKYx
register apply to both
stacks.
The loop counter stack is six locations deep. The stack is full when all
entries are occupied, is empty when no entries are occupied, and is over-
flowed if a push occurs when the stack is already full. The following bits in
the
STKYx
register indicate the loop counter stack full and empty states.
•
Loop stacks overflowed.
Bit 25 (
LSOV
) indicates that the loop
counter stack and loop stack are overflowed (if set to 1) or not
overflowed (if set to 0)—
LSOV
is a sticky bit.
•
Loop stacks empty.
Bit 26 (
LSEM
) indicates that the loop counter
stack and loop stack are empty (if set to 1) or not empty (if set to
0)—not sticky, cleared by a
PUSH
.
Within the sequencer, the current loop counter (
CURLCNTR
) and loop
counter (
LCNTR
) registers allow access to the loop counter stack. The
CURLCNTR
register tracks iterations for a loop being executed, and the
LCNTR
register holds the count value before the loop is executed. The two count-
ers let the DSP maintain the count for an outer loop, while a program is
setting up the count for an inner loop.
The top entry in the loop counter stack (
CURLCNTR
) always contains the
current loop count. This register is readable and writable over the DM
data bus. Reading
CURLCNTR
when the loop counter stack is empty returns
the value 0xFFFF FFFF.
The sequencer decrements the value of
CURLCNTR
for each loop iteration.
Because the sequencer tests the termination condition two instruction
cycles before the end of the loop, the loop counter also decrements before
the end of the loop. If a program reads
CURLCNTR
at either of the last two
loop instructions, the value is already the count for the next iteration.
The loop counter stack pops two instructions before the end of the last
loop iteration. When the loop counter stack pops, the new top entry of the
stack becomes the
CURLCNTR
value—the count in effect for the executing
Summary of Contents for ADSP-21261 SHARC
Page 30: ...Contents xxx ADSP 2126x SHARC Processor Hardware Reference ...
Page 40: ...Register Diagram Conventions xl ADSP 2126x SHARC Processor Hardware Reference ...
Page 58: ...Differences From Previous SHARCs 1 18 ADSP 2126x SHARC Processor Hardware Reference ...
Page 112: ...Secondary Processing Element PEy 2 54 ADSP 2126x SHARC Processor Hardware Reference ...
Page 178: ...Summary 3 66 ADSP 2126x SHARC Processor Hardware Reference ...
Page 204: ...DAG Instruction Summary 4 26 ADSP 2126x SHARC Processor Hardware Reference ...
Page 322: ...Setting Up DMA 7 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 436: ...SPORT Programming Examples 9 86 ADSP 2126x SHARC Processor Hardware Reference ...
Page 521: ...ADSP 2126x SHARC Processor Hardware Reference 11 31 Input Data Port rts IDP_ISR end ...
Page 522: ...Input Data Port Programming Example 11 32 ADSP 2126x SHARC Processor Hardware Reference ...
Page 590: ...Timer Programming Examples 14 20 ADSP 2126x SHARC Processor Hardware Reference ...
Page 796: ...I O Processor Registers A 174 ADSP 2126x SHARC Processor Hardware Reference ...
Page 800: ...B 4 ADSP 2126x SHARC Processor Core Manual ...
Page 846: ...Index I 36 ADSP 2126x SHARC Processor Hardware Reference ...