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.

C6RunApp Documentation

From Texas Instruments Wiki
Jump to: navigation, search

END OF LIFE

C6Run is still available for download, but is no longer being actively developed or maintained. Please consider other alternatives such as, Codec Engine IUNIVERSAL support, OpenCL or RCM.

^ Up to main C6EZRun Main Page ^

This article is part of a collection of articles describing the C6EZRun Software Development Project. Select the link above to return to the main project page.

Overview

In it's simplest form, this tool acts as a cross-compiler for the DSP, allowing portable C applications to be rebuilt for the C6000 DSP core of various Texas Instruments heterogeneous (ARM+DSP) processors. The C6RunApp front-end consists of a single script, called c6runapp-cc. This use of this script matches, as much as possible, the use of GCC. It can compile C code to C6000 object files and link the C6000 object files into an application. When performing linking operations, the tool makes use of a number of steps (including linking using the C6000 code generation tools) to create an ARM-side executable from the DSP object files.

Once built, the application can be run from the ARM/Linux command-line as if it were a native ARM application. Underneath the covers, however, the DSP is initiated, loaded with the program code, and runs the application to completion. All C I/O operations (printf, scanf, fopen, etc.) are routed to the ARM environment and console. This makes the application appear as another ARM process, but all of the C code compiled using this tool runs on the DSP core of the SoC.


Examples: Building Code on the Host

In general, the C6RunApp cross-compiler script can be used as GCC would be used for compiling for the ARM.

Here are some examples usages.

  • Compile a single C source file to an object file:
    [host]$ c6runapp-cc -c hello_world.c
    The output is a file called hello_world.o.
  • Compile a single C source file to an executable of default name:
    [host]$ c6runapp-cc hello_world.c
    The output is a file called a.out.
  • Compile a single C source file to an executable of specified name:
    [host]$ c6runapp-cc -o hello_world.out hello_world.c
    The output is a file called hello_world.out.
  • Compile a multiple C source files to object files:
    [host]$ c6runapp-cc -c bench.c distance.c
    The output is two files, called bench.o and distance.o.
  • Compile multiple C source files to an executable of default name:
    [host]$ c6runapp-cc bench.c distance.c
    The output is a file called a.out.
  • Compile multiple C source files to an executable of specified name:
    [host]$ c6runapp-cc -o test.out bench.c distance.c
    The output is a file called test.out.
  • Compile multiple C source files to an executable using optimization level 3:
    [host]$ c6runapp-cc -O3 -o test.out bench.c distance.c
    The output is a file called test.out.


C6RunApp Front-end Tool Usage

c6runapp-cc

The c6runapp-cc tool is a Bash shell script, intended to be run on a host Linux PC. The tool is used to compile C code and generate C6000 object files. It does this by calling the TI C6000 compiler, cl6x, with appropriate command-line options. It can also be used to link C6000 object files together to create an ARM/Linux application. In linking mode, the c6runapp-cc tool makes appropriate use of the cl6x compiler and the ARM GCC compiler. The command-line syntax of the c6runapp-cc tool matches (to the extent possible) the syntax used by the open source GCC compiler.

The c6runapp-cc tool currently only supports C source files.

For reference, a list of GCC options can be found here

Usage summary

c6runapp-cc [options] files ...

Common Command-line Options

Option Meaning
-c Compile or assemble the source files, but do not link
-o file Place output in file file
-S Stop after the stage of compilation proper; do not assemble.
-E Stop after the preprocessing stage.
--help Print (on the standard output) a description of the command line options understood by c6runlib-cc
-O0 Reduce compilation time and make debugging produce the expected results (default).
-O1 Optimize
-O2 Optimize even more
-O3 Optimize yet more
-Idir Add the directory dir to the head of the list of directories to be searched for header files.
-iquotedir Same as -I.
-D name Predefine name as a macro, with definition 1.
-D name=definition The contents of definition are tokenized and processed as if they appeared during translation phase three in a `#define' directive. In particular, the definition will be truncated by embedded newline characters.
-U name Cancel any previous definition of name, either built in or provided with a -D option.
-include file Process file as if #include "file" appeared as the first line of the primary source file.
-Wall Enable common warning messages with verbose output
-w Inhibit all warning messages.

Ignored Command-line Options

All GCC options not specified above are ignored.

C6RunApp Specific Command-line Options

All C6EZRun specific options (i.e., ones not GCC-like and ones not intended to be passed to the TI compiler) are of the form "--C6Run:<option>". The following table gives all supported options of this form and what they are used for.

Option Meaning
--C6Run:replace_malloc Replace all standard C malloc APIs with versions that allocate from the shared CMEM heap
--C6Run:no_replace_malloc Do not replace malloc APIs (default)
--C6Run:debug Use debug mode libraries
--C6Run:release Use release mode libraries (default)
--C6Run:save_dsp_image Save the embedded DSP executable image and memory map file (to use for debugging).

TI cl6x Command-line Options

Any option not interpreted as a GCC-like option (specified in the previous sections) or a C6EZRun-specific option is passed directly to the TI cl6x compiler. In most cases you should use the long form of the cl6x options to avoid any possible conflict with the GCC-like options that the script would interpret instead.

Refer to the "Optimizing Compiler User's Guide" that comes with your particular code generation tools release for all supported options (see here for an example).


Return to C6EZRun Main page

^ Up to main C6EZRun Main Page ^

This article is part of a collection of articles describing the C6EZRun Software Development Project. Select the link above to return to the main project page.