NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Run Intrinsics Code Anywhere

From Texas Instruments Wiki
Jump to: navigation, search

NO LONGER SUPPORTED[edit]

The host intrinsics package is no longer supported. There are no plans to fix any issues or perform new releases. This article remains for reference only.

Introduction[edit]

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 ...

<syntaxhighlight lang=c>

  y = _add2(a, b);

</syntaxhighlight>

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[edit]

  • Hosted, in C language, implementation of all TI DSP C6000 family intrinsics enabling customers to maintain a single (yet optimized) source-code base that runs in both the C/C++ host programming environment and the DSP.
  • Validated on cygwin with gcc, Linux with gcc, Microsoft Visual Studio and (naturally) on TI DSP (the latter being done simply to compare results). The (few) tests that require big-endian are done on a Sparc Solaris workstation.
  • Unit Test suite for each intrinsic plus a variety of "real-world" tests combining multiple intrinsics.
  • Enables use of rich host development environments such as Microsoft Visual Studio etc. Customers may then be able to take advantage of tools like purify, quantify etc.

Download[edit]

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[edit]

Older Versions[edit]

Older versions can be downloaded from here.

How to test the Host Intrinsics?[edit]

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.

Related Articles[edit]

E2e.jpg {{
  1. switchcategory:MultiCore=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Run Intrinsics Code Anywhere here.

Keystone=
  • For technical support on MultiCore devices, please post your questions in the C6000 MultiCore Forum
  • For questions related to the BIOS MultiCore SDK (MCSDK), please use the BIOS Forum

Please post only comments related to the article Run Intrinsics Code Anywhere here.

C2000=For technical support on the C2000 please post your questions on The C2000 Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. DaVinci=For technical support on DaVincoplease post your questions on The DaVinci Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. MSP430=For technical support on MSP430 please post your questions on The MSP430 Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. OMAP35x=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. OMAPL1=For technical support on OMAP please post your questions on The OMAP Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. MAVRK=For technical support on MAVRK please post your questions on The MAVRK Toolbox Forum. Please post only comments about the article Run Intrinsics Code Anywhere here. For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Run Intrinsics Code Anywhere here.

}}

Hyperlink blue.png Links

Amplifiers & Linear
Audio
Broadband RF/IF & Digital Radio
Clocks & Timers
Data Converters

DLP & MEMS
High-Reliability
Interface
Logic
Power Management

Processors

Switches & Multiplexers
Temperature Sensors & Control ICs
Wireless Connectivity