Using Circular Buffers - Analog Devices VISUALDSP++ 3.5 Manual

C/c++ compiler and library for adsp-219x processors
Hide thumbs Also See for VISUALDSP++ 3.5:
Table of Contents

Advertisement

Achieving Optimal Performance from C/C++ Source Code
Examples of the two styles are:
int read_io(int iopg_val) {
int ret_val;
("IOPG=%1 ; %0=IO(0x20);" : "=e"(ret_val) : "e"(iopg_val) : "IOPG");
return ret_val;
}
Bad: uses inline
#include <sysreg.h>
#define ADDR 0x20
int read_io(int iopg_val) {
sysreg_write(sysreg_IOPG, iopg_val);
return sysreg_read(reg_CYCLES);
}
Good: uses
This example reads and returns the

Using Circular Buffers

Circular buffers are often extremely useful in DSP code. They can be used
in several ways. Consider the C code:
for (i=0; i<1000; i++) {
sum += a[i] * b[i%20];
}
Good: the compiler knows that
Clearly the access to array
enabled the compiler will produce a hardware circular buffer instruction
for this access.
Consider the slightly more complicated example:
for (i=0; i<1000; i+=n) {
sum += a[i] * b[i%20];
}
VisualDSP++ 3.5 C/C++ Compiler and Library Manual
for ADSP-219x DSPs
statement.
asm
.
sysreg.h
is a circular buffer. When optimization is
b
register.
CYCLES
is accessed as a circular buffer.
b
2-27

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VISUALDSP++ 3.5 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Related Products for Analog Devices VISUALDSP++ 3.5

Table of Contents