dsp56800e Freescale Semiconductor, Inc, dsp56800e Datasheet - Page 215

no-image

dsp56800e

Manufacturer Part Number
dsp56800e
Description
16-bit Digital Signal Controller Core
Manufacturer
Freescale Semiconductor, Inc
Datasheet
The modulo arithmetic unit in the AGU simplifies the use of a circular buffer by handling the address
pointer wrapping for you. After a buffer is established in memory, programming the M01 register enables
the R0 and R1 address pointers to wrap in the buffer area.
Modulo arithmetic is enabled through programming the M01 register with a value that is one less than the
size of the circular buffer. See Section 6.8.3, “Configuring Modulo Arithmetic,” for exact details on
programming the M01 register. Once modulo arithmetic is enabled, updates to the R0 or R1 register using
one of the post-increment or post-decrement addressing modes are performed with modulo arithmetic, and
the pointers wrap correctly in the circular buffer.
The address range within which the address pointers will wrap is determined by the value that is placed in
the M01 register and by the address that is contained within one of the pointer registers. Due to the design
of the modulo arithmetic unit, the address range is not arbitrary, but limited based on the value placed in
M01. The lower bound of the range is calculated by taking the size of the buffer, rounding it up to the next
higher power of two, and then rounding the address contained in the R0 or R1 pointer down to the nearest
multiple of that value.
For example: for a buffer size of M, the smallest value of k is calculated such that 2
buffer size rounded up to the next higher power of two. For a value M of 37, 2
boundary of the range in which the pointer registers will wrap is the value in the R0 or R1 register with the
low-order k bits all set to zero, effectively rounding the value down to the nearest multiple of 2
case). This example is shown in Figure 6-8.
Freescale Semiconductor
Address
Pointer
Figure 6-7. Circular Buffer
Address Generation Unit
Circular
Buffer
Upper Boundary: Lower Boundary + M01
M01 = Size of Modulo Region Minus One
Lower Boundary: k LSBs Are All Zeros
Address of Lower Boundary:
23
Linear and Modulo Address Arithmetic
Base Address
k
would be 64. The lower
k
> M. This value is the
k
k–1 ...
0 0 0 0 0
k
(64 in this
1
0
6-21

Related parts for dsp56800e