Circular Buffers - Analog Devices adsp-2100 Manual

Adsp-2100 family programmable single-chip microprocessors
Table of Contents

Advertisement

4 Data Transfer
It is also possible to initialize a complete array/buffer from a data file,
using the .INIT directive:
.INIT coefficients: <filename.dat>;
This assembler directive reads the values from the file filename.dat into the
array at link time. This feature is supported only in the simulator — data
cannot be loaded directly into on-chip data memory by the hardware
booting sequence.
An array or data buffer with a length of one is a simple single-word
variable, and is declared in this way:
.VAR/DM coefficient;
4.3.2

Circular Buffers

A common requirement in DSP is the circular buffer. This is directly
implemented by the processors' data address generators (DAGs), using
the L (length) registers. First, you must declare the buffer as circular:
.VAR/DM/CIRC coefficients[128];
This identifies it to the linker for placement on the proper address
boundary. Next, you must initialize the L register, typically using the
assemblers's % operator (or a constant) and, in the example below, the I
register and M register:
L0=%coefficients;
I0=^coefficients;
M0=1;
Now a statement like
MX0=DM(I0,M0);
placed in a loop, cycles continuously through coefficients and wraps
around automatically.
4 – 8
{length of circular buffer}
{point to first address of buffer}
{increment by 1 location each time}
{load MX0 from buffer}

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents