CC27xxDriverLibrary
[apu.h] Algorithm Processing Unit (APU)
Collaboration diagram for [apu.h] Algorithm Processing Unit (APU):

Modules

 [apu.h] APU Vector Operations
 
 [apu.h] APU Matrix Operations
 
 [apu.h] APU Advanced Operations
 

Macros

#define APU_FBA_ENABLE   1
 Enable Forward/Backward Averaging. More...
 
#define APU_FBA_DISABLE   0
 Disable Forward/Backward Averaging. More...
 
#define APU_MEMORY_INTERLEAVED   1
 Set APU memory in interleaved mode. More...
 
#define APU_MEMORY_MIRRORED   0
 Set APU memory in mirrored mode. More...
 
#define APU_HEAP_ADDR   0x03CE
 50 positions for Heap, from 974->1023 More...
 
#define APU_OP_R2C   0
 C=real(A)+j*real(B) More...
 
#define APU_OP_R2CC   1
 C=real(A)-j*real(B) More...
 
#define APU_OP_R2CA   2
 C=imag(A)+j*real(A) More...
 
#define APU_OP_R2CCA   3
 C=imag(A)-j*real(A) More...
 
#define APU_OP_RA   4
 C=real(A) More...
 
#define APU_OP_IMA   5
 C=imag(A) More...
 
#define APU_OP_ABS   6
 C=abs(real(A)) + j*abs(imag(A)) More...
 
#define APU_OP_ADD   0
 Vector addition. More...
 
#define APU_OP_SUB   1
 Vector subtraction. More...
 
#define APU_OP_MIN   0
 Minimum operator. More...
 
#define APU_OP_MAX   1
 Maximum operator. More...
 
#define APU_GET_DATA_MEM_OFFSET(x)   ((uint32_t)x - (uint32_t)APURAM_DATA0_BASE) >> 3
 
#define APU_GET_DATA_MEM_ABS(x)   ((uint32_t)APURAM_DATA0_BASE + (((uint32_t)x) << 3))
 

Enumerations

enum  APUApi {
  APU_API_NOP = 0x0000, APU_API_CONFIG = 0x0001, APU_API_DOTPROD = 0x0002, APU_API_VECTMULT = 0x0003,
  APU_API_VECTSUM = 0x0004, APU_API_MATMATMULT = 0x0005, APU_API_UNITCIRC = 0x0006, APU_API_SYMMATRIXVECTPROD = 0x0007,
  APU_API_MATRIXMULT = 0x0008, APU_API_HERMATRIXMULT = 0x0009, APU_API_SYMMATRIXMULT = 0x000A, APU_API_MATRIXSUM = 0x000B,
  APU_API_SCALARMULT = 0x000C, APU_API_MATRIXSCALARSUM = 0x000D, APU_API_POLAR = 0x000E, APU_API_CARTESIAN = 0x000F,
  APU_API_COVMATRIX = 0x0010, APU_API_EIGEN = 0x0011, APU_API_R2C = 0x0012, APU_API_MATRIXNORM = 0x0013,
  APU_API_FFT = 0x0014, APU_API_DCT = 0x0015, APU_API_SORT = 0x0016, APU_API_GAUSS = 0x0017,
  APU_API_HERMLO = 0x0018, APU_API_MAXMIN = 0x0019
}
 

Functions

void APUWaitOnIrq (void)
 Wait for the APU interrupt. More...
 
bool APUOperationDone (void)
 Check if the APU has completed its operation. More...
 
void APUWaitOp (void)
 Wait for the APU to start and finish. More...
 
void APUSetConfig (uint32_t memConfig)
 Configure the APU. More...
 
void APUNop (void)
 APU NOP. More...
 

Detailed Description

Introduction

The APU - Algorithm Processing Unit - is a generic mathematical acceleration module that is able to operate with single-precision floating point numbers (IEEE 754 format) and is optimized to work with complex numbers. This module is able to deal with vector (and matrix) operations efficiently

Numerical Representation Supported by APU

In this material, a "number" is meant to represent a complex number, or two single precision IEEE 754 floating point numbers. There are two possible representations for complex numbers, cartesian or polar.

APU Data Memory

Memory Configurations

The data memory can be used by the APU in two different configurations, depending on the application. These configurations are known as "Interleaved Mode" (RAID 0) or "Mirrored Mode" (RAID 1). The APU shall be configured to either of those operation modes.

Data Memory View

The data memories is seen differently from the CPU system side and from the APU side. Essentially, the CPU will observe the normal 32-bit, byte oriented, memory map, whereas the APU will operate and observe a 64-bit wide word-oriented map. The CPU will operate with a 32-bit global address and then APU will only need a 12 bit local address. This table illustrates the differences in the two views.

|--------------------------------------------------------------------------------------------------------------|
| System Address Scheme | APU Address SchemeĀ  |
|--------------------------------------|----|----|----|---------|----|---|-------|-----------------------------|
| imag(x) | real(x) | x |
|--------------------------------------|----|----|----|---------|----|---|-------|-----------------------------|
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 0 |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 1 |
| | | | | | | | | ... |
| 8*k+7 | | | | | | | 8*k | k |
| | | | | | | | | ... |
| 8191 | | | | | | | 8194 | 1023 |
| | | | | | | | | ... |
| 16383 | | | | | | | 16376 | 2047 |
|--------------------------------------|----|----|----|---------|----|---|-------|-----------------------------|

Vector/Matrix Storage

Vector Storage

Vector X with length N is stored by N units in APU memory from address start_address to end_address = start_address

From system address scheme:

Address(real(X[i])) = start_address + i * 8;
Address(imag(X[i])) = start_address + i * 8 + 4;

Matrix Storage

Matrix A[MxN] with M rows and N columns is stored by M*N units in APU memory in the column-major order from start_address to end_address = start_address + M*N - 1. Generally, element A[i,j] (i = 0 to M-1, j = 0 to N-1) is stored at start_addres + j * M + i in APU memory

From system address scheme:

Address(real(A[i,j])) = start_address + (j * M + i) * 8;
Address(imag(A[i,j])) = start_address + (j * M + i) * 8 + 4;

Triangular Matrix Storage

Triangular matrix T[NxN] with N rows and N columns can be stored in an efficient manner by N*(N+1)/2 units in the data memory from address start_address to end_address = start_address + N*(N+1)/2 - 1. A simple way to access these matrices is to create the following LUT in the system CPU: LUT = [0,1,3,6,10,15,21,28,36,45,55,66,78,91,105,120,136,153,171,190,210,231,253,276,300,325,351,378,406,435,465] with LUT[j] (j = 0 to N-1) is basically the order of element T[0,j] in APU memory. Generally, element T[i,j] (i,j = 0 to N-1) is stored at start_address + LUT[j] + i in APU memory.

Note
This equation only holds true for values of i <=j (which is the definition of an upper triangular matrix). Symmetric matrices and hermitian matrices can also be stored in APU memory as upper triangular matrices as described.

From system address scheme:

Address(real(A[i,j])) = start_address + (LUT[j] + i)*8;
Address(imag(A[i,j])) = start_address + (LUT[j] + i)*8 + 4;

API

The API functions can be grouped like this:

APU Control Operations:

Vector Operations:

Matrix Operations:

Advanced Operations:

Macro Definition Documentation

§ APU_FBA_ENABLE

#define APU_FBA_ENABLE   1

Enable Forward/Backward Averaging.

§ APU_FBA_DISABLE

#define APU_FBA_DISABLE   0

Disable Forward/Backward Averaging.

§ APU_MEMORY_INTERLEAVED

#define APU_MEMORY_INTERLEAVED   1

Set APU memory in interleaved mode.

Referenced by APUSetConfig().

§ APU_MEMORY_MIRRORED

#define APU_MEMORY_MIRRORED   0

Set APU memory in mirrored mode.

Referenced by APUSetConfig().

§ APU_HEAP_ADDR

#define APU_HEAP_ADDR   0x03CE

50 positions for Heap, from 974->1023

Referenced by APUGaussJordanElim(), APUJacobiEVD(), and APUVectorMaxMin().

§ APU_OP_R2C

#define APU_OP_R2C   0

C=real(A)+j*real(B)

§ APU_OP_R2CC

#define APU_OP_R2CC   1

C=real(A)-j*real(B)

§ APU_OP_R2CA

#define APU_OP_R2CA   2

C=imag(A)+j*real(A)

§ APU_OP_R2CCA

#define APU_OP_R2CCA   3

C=imag(A)-j*real(A)

§ APU_OP_RA

#define APU_OP_RA   4

C=real(A)

§ APU_OP_IMA

#define APU_OP_IMA   5

C=imag(A)

§ APU_OP_ABS

#define APU_OP_ABS   6

C=abs(real(A)) + j*abs(imag(A))

§ APU_OP_ADD

#define APU_OP_ADD   0

Vector addition.

§ APU_OP_SUB

#define APU_OP_SUB   1

Vector subtraction.

§ APU_OP_MIN

#define APU_OP_MIN   0

Minimum operator.

§ APU_OP_MAX

#define APU_OP_MAX   1

Maximum operator.

§ APU_GET_DATA_MEM_OFFSET

§ APU_GET_DATA_MEM_ABS

#define APU_GET_DATA_MEM_ABS (   x)    ((uint32_t)APURAM_DATA0_BASE + (((uint32_t)x) << 3))

Enumeration Type Documentation

§ APUApi

enum APUApi
Enumerator
APU_API_NOP 
APU_API_CONFIG 
APU_API_DOTPROD 
APU_API_VECTMULT 
APU_API_VECTSUM 
APU_API_MATMATMULT 
APU_API_UNITCIRC 
APU_API_SYMMATRIXVECTPROD 
APU_API_MATRIXMULT 
APU_API_HERMATRIXMULT 
APU_API_SYMMATRIXMULT 
APU_API_MATRIXSUM 
APU_API_SCALARMULT 
APU_API_MATRIXSCALARSUM 
APU_API_POLAR 
APU_API_CARTESIAN 
APU_API_COVMATRIX 
APU_API_EIGEN 
APU_API_R2C 
APU_API_MATRIXNORM 
APU_API_FFT 
APU_API_DCT 
APU_API_SORT 
APU_API_GAUSS 
APU_API_HERMLO 
APU_API_MAXMIN 

Function Documentation

§ APUWaitOnIrq()

void APUWaitOnIrq ( void  )

Wait for the APU interrupt.

This function busy-waits until the APU API interrupt is set.

Returns
None

§ APUOperationDone()

bool APUOperationDone ( void  )

Check if the APU has completed its operation.

Checks the APU message box to see if it has completed its operation.

Returns
None

References APU_MSGBOX_CMDOK.

Referenced by APUWaitOp().

§ APUWaitOp()

void APUWaitOp ( void  )

Wait for the APU to start and finish.

Wait for the APU to both begin and complete its operation.

Returns
None

References APUOperationDone().

§ APUSetConfig()

void APUSetConfig ( uint32_t  memConfig)

Configure the APU.

Enable the APU, initialize it and configure its memory mode.

Parameters
memConfigis the memory configuration mode, either mirrored or interleaved. Must be one of the following:
Returns
None

References APU_API_CONFIG, APU_MEMORY_INTERLEAVED, and APU_MEMORY_MIRRORED.

§ APUNop()

void APUNop ( void  )

APU NOP.

Configure the APU to do nothing.

Returns
None

References APU_API_NOP.