Run Intrinsics Code Anywhere

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   

Contents

Introduction

Wouldn't it be cool to have one version of your code that runs on the C6000 embedded DSP and your host development system? Think of what you could do with that. Why, you could debug on the host system! Then, to run on the DSP, just re-build.

But, wait a second. What about those intrinsics? Those weird looking function calls like this ...

y = _add2(a, b);

Code running on the DSP needs these intrinsics so it will run fast. How could that code work on my host system?

Code supplied in the host intrinsics package implements intrinsics like _add2(). Details are in this presentation.

Key Features

Download

All of these downloads are free. A my.ti.com login is required. Newer releases also require you to go through a simple and automated export screening process.

Version 0.91.00

Older Versions

Older versions can be downloaded from here.

How to test the Host Intrinsics?

To check the actual DSP-side results as a baseline you can use Loadti, a command line loader based on Debug Server Scripting that works on Simulation or Hardware platforms. For example: -

loadti -o=.\K_filt_long\Debug\K_filt_long.out -x=.\K_filt_long\Debug\K_filt_long.xml

We use the generated XML file to compare / diff for regression purposes. CCS project files are supplied for the DSP environment.

The same test can then be run under e.g. cygwin with gcc via: -

make
./dbg/K_filt_long

The result is pretty straightforward. It should yield e.g.

K_FILT_LONG: Result pass

The <testname>_d.c file is the main test harness. It executes 2 versions of a test routine - 1 in natural C (<testname>_c.c), the other loaded up with TI DSP intrinsics (<testname>_i.c). Results from both are compared. If they differ the test reports a failure, else TESTNAME: Result pass is printed to STDOUT.

The unit test harness is simpler - it simply compares the C intrinsics result with a known correct value. It does however try to catch corner cases by using values that impact sign-extension, saturation etc.

Leave a Comment
Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox