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
Contents
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]
- Introduces support for C6600 and C6700 intrinsics
- The readme contains more details
- Windows Install Package. Download and execute it.
- Linux Install Package. Download, gunzip, then execute it.
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.