How to Create DSP Algorithm Package with RidgeRun SDK

From RidgeRun Developer Connection

(Difference between revisions)
Jump to:navigation, search
(References)
(Making a DSP algorithm callable from a Gstreamer Plugin)
Line 29: Line 29:
*XDCtools 3.16 or later
*XDCtools 3.16 or later
-
=Making a DSP algorithm callable from a Gstreamer Plugin=
+
=Making a basic package  xDAIS & xDM compliant =
Those steps shown below has to be followed to complete a memcpy DSP algorithm.
Those steps shown below has to be followed to complete a memcpy DSP algorithm.
Line 74: Line 74:
===At the first Screen===
===At the first Screen===
 +
 +
[[File:CodecEngineGenCodecPkgWizard-moc01.png]]
#Choose the 3rd option, '''I want to create an algorithm from scratch'''
#Choose the 3rd option, '''I want to create an algorithm from scratch'''
Line 79: Line 81:
#Point to the root of the compiler installation: '''CGTOOLS'''
#Point to the root of the compiler installation: '''CGTOOLS'''
#Click on next
#Click on next
-
[[File:CodecEngineGenCodecPkgWizard-moc01.png]]
+
 
===At the Second Screen===
===At the Second Screen===
 +
 +
[[File:CodecEngineGenCodecPkgWizard-moc02.png]]
#Fill the spaces according with the name of your new package.
#Fill the spaces according with the name of your new package.
-
#Keep the capital letters on the names. as it's shown on the table placed below
+
*Keep the capital letters on the names. as it's shown on the table placed below
{|border="1"
{|border="1"
Line 108: Line 112:
|eg: $(DVSDK)/csomapl138/packages
|eg: $(DVSDK)/csomapl138/packages
|}
|}
-
 
-
[[File:CodecEngineGenCodecPkgWizard-moc02.png]]
 
#Click Finish to generate the starter files.
#Click Finish to generate the starter files.
 +
 +
 +
=Create the CE-Consumable Codec Package=
 +
 +
After creating the xDM algorithm and Codec Package Structure, we then made an extra package called ti.sdo.codecs.codecs.*.ce ('''where * is the codec eg: mycodec''') that declares static properties relevant to the Codec Engine.
 +
 +
*The file '''MYCODEX.xdc''' declares the xDM class we are trying to implement and the algorithm function table.
 +
*The file '''MYCODEC.xs''' provides the getStackSize() function, which is used when building an application for the Codec Engine to declare the combined amount of stack usage for the algorithm.
 +
 +
=CE DIRECTORY=
 +
 +
Go to the codec path and create the ce directory
 +
 +
<pre>
 +
$ cd (...) cs1omap/packages/ti/sdo/codecs/mycodec
 +
$ mkdir ce
 +
</pre>
 +
 +
 +
Move the '''MODULE.xdc''' and the '''MODULE.xs''' to ce directory
 +
 +
<pre>
 +
$ mv MYCODEC.xdc ce/
 +
$ mv MYCODEC.xs ce/
 +
</pre>
 +
 +
==Modifing the files==
 +
===MODULE.xdc===
 +
Modify the file MODULE.xdc and add the code highlighted on red as shown below:
 +
 +
<pre>
 +
metaonly module MYCODEX
 +
 +
inherits ti.sdo.ce.universal.IUNIVERSAL
 +
{
 +
readonly config ti.sdo.codecs.mycodec.MYCODEC.Module alg = ti.sdo.codecs.mycodec.MYCODEC;
 +
override readonly config String ialgFxns = "MYCODEC_TI_MYCODEC";
 +
}
 +
</pre>
 +
 +
===package.xdc===
 +
 +
It declares the name of the package and the module it contains. Furthermore, it uses the “requires” statement to specify its dependency on the algorithm and adapter package. Hence when the server package is configured to use this CE-consumable package, it picks up the correct libraries from the packages it requires. The package.xdc file is the package definition file, which defines your Codec Server’s name and its dependencies.
 +
 +
The package name must reflect the directory structure under the ti codecs
 +
 +
Inside the ti.sdo.codecs.codecs.mycodec.ce directory create the files package.xdc and package.bld
 +
 +
Modify each file following the explanation shown below:
 +
<pre>
 +
requires ti.sdo.ce.universal;
 +
requires ti.sdo.codecs.mycodec;
 +
 +
/* ======== package.xdc ========
 +
* Provides MYCODEC interface adapter for
 +
* ti.sdo.codecs.mycodec codec.
 +
*/
 +
 +
package ti.sdo.codecs.mycodec.ce [1, 0, 0]
 +
  {
 +
      module MYCODEC;
 +
  }
 +
</pre>
 +
 +
===MODULE.xdc===
 +
Modify the file MODULE.xdc and add the code highlighted on red follow the structure shown below:
 +
<pre>
 +
metaonly module MYCODEX
 +
inherits ti.sdo.ce.universal.IUNIVERSAL
 +
  {
 +
      readonly config ti.sdo.codecs.mycodec.MYCODEC.Module alg = ti.sdo.codecs.mycodec.MYCODEC
 +
      override readonly config String ialgFxns = "MYCODEC_TI_MYCODEC";
 +
  }
 +
</pre>
 +
 +
===package.xdc===
 +
 +
Inside the ti.sdo.codecs.codecs.mycodec.ce directory create the files package.xdc and package.bld
 +
 +
It declares the name of the package and the module it contains. Furthermore, it uses the “requires” statement to specify its dependency on the algorithm and adapter package. Hence when the server package is configured to use this CE-consumable package, it picks up the correct libraries from the packages it requires. The package.xdc file is the package definition file, which defines your Codec Server’s name and its dependencies.
 +
 +
The package name must reflect the directory structure under the ti codecs
 +
 +
Modify each file following the explanation shown below:
 +
 +
<pre>
 +
requires ti.sdo.ce.universal;
 +
requires ti.sdo.codecs.mycodec;
 +
 +
/* ======== package.xdc ========
 +
 +
* Provides MYCODEC interface adapter for
 +
* ti.sdo.codecs.mycodec codec.
 +
*/
 +
 +
package ti.sdo.codecs.mycodec.ce [1, 0, 0]
 +
  {
 +
      module MYCODEC;
 +
  }
 +
</pre>
 +
===package.bld===
 +
<pre>
 +
/* ======== package.bld ======== */
 +
 +
Pkg.attrs.exportAll = true;
 +
</pre>
 +
 +
 +
Usually the codec should be integrated with the codec server that comes with the dvsdk out-of-the-box.

Revision as of 10:36, 7 June 2010

Contents

Introduction

This document will be an easy way to create a new DSP algorithm based on TMS320 DSP processor. It will target these algorithms and assists the reader with making the algorithms compliant with the TMS320 DSP algorithm standard which is part of TI's eXpressDSP technology initiative. The document proposes a simple approach to running xDAIS or iUniversal algorithms with a Codec Engine (CE) application based on TI's technology and RidgeRun SDK. The wizard is responsible for creating an xDAIS algorithm (iUniversal), and providing the necessary packaging to enable these algorithms to be consumed and configured by Codec Engine.

We assume readers have a basic understanding of the elements in a Codec Engine application, including VISA APIs, xDM, servers, and codecs

References

For details, see the following documents:

Requirements for the GencodecPkg Wizard

Making a basic package xDAIS & xDM compliant

Those steps shown below has to be followed to complete a memcpy DSP algorithm. If you desire to add new features , new funtions, and others refer to previous section links for more details.

Adding the wizard support to DVSDK makefile

The GenCodecPkg wizard generates the files and packaging required for integrating an algorithm into Codec Engine. Assuming your using a RR SDK you have a complete integration with a TI DVSDK release, then you likely have already defined paths to all your tools in the Rules.make.

Those generated Codec Packages can be integrated into a Server and the document will explain the way to append the new codec into TI's Codec Server.

Checking your DVSKD Makefile Support

$ cd $(DEVDIR)/propietary/dvsdk*
$ gedit Makefile

On the Makefile check if the gencodecpkg macro is activated if it's already added, please ignore next step.


Inside the Makefile from the DVSDK

 
$ cd $(DEVDIR)/propietary/dvsdk*
$ gedit Makefile

Append the following rule:

gencodecpkg: 
    $(XDC)/xs --xdcpath="$(CE_INSTALL_DIR)/packages; \
    $(XDAIS_INSTALL_DIR)/packages" ti.sdo.ce.wizards.gencodecpkg

Make sure you use a tab instead spaces.

Running the wizard

From your DVSDK directory you can invoke gencodecpkg with the following command:

 
 $ cd $(DEVDIR)/proprietary/dvsdk_* 
 $ make gencodecpkg

At the first Screen

CodecEngineGenCodecPkgWizard-moc01.png

  1. Choose the 3rd option, I want to create an algorithm from scratch
  2. Point to the xDAIS directory
  3. Point to the root of the compiler installation: CGTOOLS
  4. Click on next

At the Second Screen

CodecEngineGenCodecPkgWizard-moc02.png

  1. Fill the spaces according with the name of your new package.
Module eg: MYCODEC
Vendor eg: RIDGERUN
Interface eg: IMYCODEC
Package_name eg: ti.sdo.codecs.mycodec
BaseInterface eg: IUNIVERSAL.
Target eg: ti.targets.C64P
OutputDir eg: $(DVSDK)/csomapl138/packages
  1. Click Finish to generate the starter files.


Create the CE-Consumable Codec Package

After creating the xDM algorithm and Codec Package Structure, we then made an extra package called ti.sdo.codecs.codecs.*.ce (where * is the codec eg: mycodec) that declares static properties relevant to the Codec Engine.

CE DIRECTORY

Go to the codec path and create the ce directory

$ cd (...) cs1omap/packages/ti/sdo/codecs/mycodec
$ mkdir ce


Move the MODULE.xdc and the MODULE.xs to ce directory

$ mv MYCODEC.xdc ce/ 
$ mv MYCODEC.xs ce/

Modifing the files

MODULE.xdc

Modify the file MODULE.xdc and add the code highlighted on red as shown below:

metaonly module MYCODEX

inherits ti.sdo.ce.universal.IUNIVERSAL 
{
 readonly config ti.sdo.codecs.mycodec.MYCODEC.Module alg = ti.sdo.codecs.mycodec.MYCODEC;
 override readonly config String ialgFxns = "MYCODEC_TI_MYCODEC";
} 

package.xdc

It declares the name of the package and the module it contains. Furthermore, it uses the “requires” statement to specify its dependency on the algorithm and adapter package. Hence when the server package is configured to use this CE-consumable package, it picks up the correct libraries from the packages it requires. The package.xdc file is the package definition file, which defines your Codec Server’s name and its dependencies.

The package name must reflect the directory structure under the ti codecs

Inside the ti.sdo.codecs.codecs.mycodec.ce directory create the files package.xdc and package.bld

Modify each file following the explanation shown below:

requires ti.sdo.ce.universal; 
requires ti.sdo.codecs.mycodec;

/* ======== package.xdc ======== 
* Provides MYCODEC interface adapter for 
* ti.sdo.codecs.mycodec codec.
*/

package ti.sdo.codecs.mycodec.ce [1, 0, 0] 
   { 
       module MYCODEC; 
   }

MODULE.xdc

Modify the file MODULE.xdc and add the code highlighted on red follow the structure shown below:

metaonly module MYCODEX
inherits ti.sdo.ce.universal.IUNIVERSAL 
   {
       readonly config ti.sdo.codecs.mycodec.MYCODEC.Module alg = ti.sdo.codecs.mycodec.MYCODEC
       override readonly config String ialgFxns = "MYCODEC_TI_MYCODEC";
   } 

package.xdc

Inside the ti.sdo.codecs.codecs.mycodec.ce directory create the files package.xdc and package.bld

It declares the name of the package and the module it contains. Furthermore, it uses the “requires” statement to specify its dependency on the algorithm and adapter package. Hence when the server package is configured to use this CE-consumable package, it picks up the correct libraries from the packages it requires. The package.xdc file is the package definition file, which defines your Codec Server’s name and its dependencies.

The package name must reflect the directory structure under the ti codecs

Modify each file following the explanation shown below:

requires ti.sdo.ce.universal; 
requires ti.sdo.codecs.mycodec;

/* ======== package.xdc ======== 

* Provides MYCODEC interface adapter for 
* ti.sdo.codecs.mycodec codec.
*/

package ti.sdo.codecs.mycodec.ce [1, 0, 0] 
   { 
      module MYCODEC; 
   }

package.bld

/* ======== package.bld ======== */

Pkg.attrs.exportAll = true; 


Usually the codec should be integrated with the codec server that comes with the dvsdk out-of-the-box.

Navigation
Toolbox