Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

XDM GenAlg Wizard FAQ

From Texas Instruments Wiki
Jump to: navigation, search

General Questions

What does the wizard do? What does it generate?

The GenAlg Wizard creates a XDC package with all the files necessary to build and distribute an XDM-compliant algorithm.

Genalg4.jpg

Does the generated codec require Codec Engine?

No. The generated XDC package builds with the XDC tools (using package.bld), but there are no bindings to Codec Engine. You can integrate the generated codec in any framework (including Codec Engine).

Installation

How do I install the Wizard?

The Wizard is delivered with XDAIS 6.25 or greater, and is provided with CCS Eclipse. The latest XDAIS releases are available here.

Requirements

  • XDCtools 3.16 or greater

Running the Wizard

From CCS Eclipse

GenAlg In CCS Menu

If you enable XDAIS in your CCS Eclipse environment (Window | Preferences | CCS | RTSC | Check the version of XDAIS you want to use), you will have a new "Tools | XDAIS Tools | GenAlg" menu item, as shown in the image to the right.

(Note that in CCS v5.1, the Tools menu only appears when CCS is in Debug Perspective.)

Batch File/Shell Script

There are scripts at the root of the XDAIS product that demonstrate how to start the wizard. See the ti.xdais.wizards.genalg.bat for Windows, or ti.xdais.wizards.genalg.sh on Linux. (Under the covers, they run the command "$XDC_INSTALL_DIR/xs ti.xdais.wizards.genalg" with an appropriate XDCPATH set.)

What if I need help on the command line?

See XDM GenAlg Wizard help by: xs ti.xdais.wizards.genalg --help

The Wizard GUI

What if I need help using the GUI version?

Here is a description of the wizard:

Basic Algorithm Information
Basic Algorithm Information
Module
The name of the algorithm you're creating
Vendor
Your company name
Interface
Has the form I<Vendor>. This field will be automatically filled after naming the module.
Base Interface
The ti.xdais.dm interface that is being implemented
Package Name
The algorithm's globally unique Package Name. Defaults to <Vendor>.<Module>
Targets
Build targets. The generated makefile will build a library for each target selected.
Add IRES Interface
When checked, a generic implementation of the IRES interface will be added to the algorithm in <Module>_<Vendor>_ires.c. All IRES references will be inside #ifdef ADD_IRES_RESOURCE blocks. The generated source files will have to be modified to implement a specific resource manager.
Destination Directory
The location that the algorithm package files will be output to. For example, if the output directory is c:/output, and the algorithm package name is ti.viddec_copy, the files will be output to c:/output/ti/viddec_copy
'cgtools' Directories
The location of CodeGen tools required to build for the selected targets.
Expert Mode
When left unchecked, the Interface and Package Name fields will be read-only and will be automatically generated based on Module and Vendor

What is the templates directory?

The templates directory contains subdirectories of XDC templates. Each template generates an XDM algorithm package that implements an XDM interface. The name of each subdirectory is the name of the XDM interface, and is displayed in the 'Base Interface' combo box. For more information, see: XDCScript Templates

After the Wizard

How do I build my algorithm package?

  • Run gmake all from the output directory (output directory + algorithm.package.name.with.dots.turned.into.forward.slashes).

Can I use Code Composer Studio to build my algorithm?

  • Yes. When you check the "Generate CCS Eclipse project" box, a standard eclipse project will be created that can be imported into CCS and built. See GenCodecPkg Code Composer Studio 4.x for details.

How can I check that my generated algorithm is XDAIS compliant?

After building a generated algorithm package, it can be tested for XDAIS compliance using the QualiTI compliancy tool.

How do I add a C6x-variant target to GenAlg?

It's easy to add a C6x-variant target to GenAlg as long as it is supported by XDC tools. Look at the ti.targets package in RTSC Package Documentation for supported C6x targets. The files that need to be modified are in the <xdais install dir>/packages/ti/xdais/wizards/genalg directory. They are:

wizard_constants.xs
Gui.xs
logic.xs
templates/build/config.bld.xdt
templates/build/makefile.xdt

Below are the steps required to add the ti.targets.elf.C67P target. To add your target, follow the exact same procedure, replacing 'C67P' with your target.

wizard_constants.xs

Target entries must be added to five arrays: targetList, targetDesc, targetSuffixes, ccOpts and cgTools. All of these entries must be at the same index in each array and each array must be the exact same size!

1. Add ti.targets.elf.C67P to the targetList array at index 5.

var targetList = [
    'ti.targets.C64P',
    'ti.targets.elf.C64P',
    'ti.targets.elf.C66',
    'ti.targets.C674',
    'ti.targets.elf.C674',
    'ti.targets.elf.C67P',    // Add this
    'ti.targets.arm.elf.M3',
    'gnu.targets.arm.GCArmv5T',
    'gnu.targets.arm.GCArmv6',
    'gnu.targets.arm.GCArmv7A'
];

2. Add 'C67P ELF', to the targetDesc array at index 5. This is the string that is displyed in the "Targets" list box.

var targetDesc = [
    'C64P COFF',
    'C64P ELF',
    'C66 ELF',
    'C674 COFF',
    'C674 ELF',
    'C67P ELF',    // Add this
    'M3 ELF',
    'ARM v5T GCC Linux',
    'ARM v6 GCC Linux',
    'ARM v7A GCC Linux'
];

3. Add 'e67P', to the targetSuffixes array at index 5. The target suffix can be read from the "module-wide config parameters" section in the RTSC Package Documentation for ti.targets.elf.C67P. It is declared as const C67P.suffix = String "e67P"

var targetSuffixes = [
    '64P',
    'e64P',
    'e66',
    '674',
    'e674',
    'e67P',    // Add this
    'em3',
    'v5T',
    'v6',
    'v7A'
];

4. Add , to the ccOpts array at index 5.

var ccOpts = [
    '-mi10 -mo',
    '',
    '',
    '-mi10 -mo',
    '',
    '',    // Add this
    '',
    '',
    ''
];

5. Add 'C67P', to the cgTools array at index 5.

var cgTools = [
    'C64P',
    'C64P',
    'C66',
    'C674',
    'C674',
    'C67P',    // Add this
    'M3',
    'v5T',
    'v6',
    'v7A'
];

Gui.xs

Modify the setState function to check if the selected target(s) have a matching 'C67P' cgTools.

if (!C6x && (wizard_constants.cgTools[i] == 'C64P' || wizard_constants.cgTools[i] == 'C674' || wizard_constants.cgTools[i] == 'C66'
    /* Add this: */ || wizard_constants.cgTools[i] == 'C67P')) {

logic.xs

Modify the createFiles function to check if the selected target(s) have a matching 'C67P' cgTools.

if (!C6x && (algObj.targets[i].cgTools == 'C64P' || algObj.targets[i].cgTools == 'C674' || algObj.targets[i].cgTools == 'C66'
    /* Add this: */ || algObj.targets[i].cgTools == 'C67P')) {

templates/build/config.bld.xdt

1. Add to the declarations:

% var C67P = false;

2. Add this conditional assignment to the % for (var i = 0; i < this.targets.length; i++) { loop:

%     else if (!C67P && this.targets[i].cgTools == 'C67P') {
%         C67P = true;
%     }

3. Add to the _rootdir declarations:

% if (C67P) {
var C67P_rootdir;
% }

4. Add to the _rootdir assignments:

% if (C67P) {
    if (arguments[x].match(/^CGTOOLS_C67P=/)) {
        C67P_rootdir = arguments[x].split("=")[1];
    }
% }

5. Add this conditional targ.rootDir assignment to the % for (var i = 0; i < this.targets.length; i++) { loop.

% else if (this.targets[i].cgTools == 'C67P') {
targ.rootDir = C67P_rootdir;
% }

templates/build/makefile.xdt

1. Add to the declarations:

% var C67P = false;

2. In the % for (var i = 0; i < this.targets.length; i++) { loop, add the condtional assignment:

%     else if (!C67P && this.targets[i].cgTools == 'C67P') {
%         C67P = true;
%     }

3. Add a C67P conditon to the CODEGEN_INSTALL_DIR assignment:

% if (C64P || C674 || C66 || C67P) {
CODEGEN_INSTALL_DIR=`this.cgTools`
% }

4. Add the conditional CGTOOLS_C67P assignment and xdcArgs append:

% if (C67P) {
CGTOOLS_C67P=$(CODEGEN_INSTALL_DIR)
%     xdcArgs += ' CGTOOLS_C67P=\\"$(CGTOOLS_C67P)\\"';
% }

See also

XDAIS Digital Media (XDM) Standard User's Guide

Other FAQs