2 algorithms, Interface, Algorithms – Texas Instruments TMS320 DSP User Manual
Page 33
![background image](/manuals/207758/33/background.png)
www.ti.com
3.2
Algorithms
IALG
IALG_Fxns
FIR_Config FIR;
FIR_init();
FIR_exit();
FIR_Fxcs FIR_IALG;
FIR
Implements
Algorithms
Element
Description
Required
Module's object definition; normally not
struct XYZ_Obj
yes
defined in the module's header.
Handle to an instance object; synonym for
XYZ_Handle
yes
struct XYZ_Obj *
Structure type of all module object creation
XYZ_Params
yes
parameters
Constant structure of all default object
XYZ_PARAMS
yes
creation parameters
Run-time creation and initialization of a
XYZ_create()
no
module's object
XYZ_delete()
Run-time deletion of a module's object
no
eXpressDSP-compliant algorithms are modules that implement the abstract interface IALG. By this, we
mean that the module must declare and initialize a structure of type IALG_Fxns, the structure must have
global scope, and its name must be XYZ_IALG, where XYZ is the unique module-vendor prefix described
above. The IALG interface allows algorithms to define their memory resource requirements and thereby
enable the efficient use of on-chip data memories by client applications. The IALG interface is described in
detail in Chapter 1 of the TMS320 DSP Algorithm Standard API Reference (SPRU360).
Not every mathematical function should be cast as an eXpressDSP-compliant algorithm. In particular,
many "traditional" math library operations such as FFT or dot product, which do not maintain state
between consecutive operations and do not require internal workspaces to perform their computation, are
not good eXpressDSP-compliant candidates. These algorithms encapsulate larger computations that
require internal working memory and typically operate on (conceptually) infinite data streams.
Figure 3-4. Example Implementation of IALG Interface
The IALG interface defines a "protocol" between the client and the algorithm used to create an algorithm
instance object at run-time. The IALG interface is designed to enable clients to use the algorithm in
virtually any execution environment; i.e., preemptive and non-preemptive, static and dynamic systems.
Thus, it is important that eXpressDSP-compliant algorithms never use any memory allocation routines
(including those provided in the standard C run-time support libraries). All memory allocation must be
performed by the client.
Rule 12
All algorithms must implement the IALG interface.
Since all eXpressDSP-compliant algorithm implementations are modules that support object creation and
all such modules should support design-time object creation, all eXpressDSP-compliant algorithms
support both run-time and design-time creation of algorithm objects. In order to ensure support for
design-time object creation, it is important that all methods defined by the IALG interface be independently
relocatable.
SPRU352G – June 2005 – Revised February 2007
Algorithm Component Model
33