Element
struct XYZ_Obj
XYZ_Handle
XYZ_Params
XYZ_PARAMS
XYZ_create()
XYZ_delete()
Description
Module'sobject definition; normally not defined in the module'sheader.
Handle to an instance object; synonym for struct XYZ_Obj *
Structure type of all module object creation parameters
Constant structure of all default object creation parameters
Run-time creation and initialization of a module'sobject
Run-time deletion of a module'sobject
Required
yes
yes
yes
yes
no no
3.2Algorithms
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
FIR
FIR_Config FIR;
FIR_init();
FIR_exit();
FIR_Fxcs FIR_IALG;
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 |