SPRUIG6J January   2018  – December 2023

 

  1.   1
  2.   C7000 Host Emulation
  3. About This Document
    1. 1.1 Related Documentation
    2. 1.2 Disclaimer
    3. 1.3 Trademarks
  4. Getting Started with Host Emulation
    1. 2.1 System Requirements
    2. 2.2 Installation Instructions
    3. 2.3 Summary of Differences: Host Emulation Coding vs. Native C7000 Coding
  5. General Coding Requirements
    1. 3.1 Required Header Files
    2. 3.2 Package Dependencies
    3. 3.3 Example Program
  6. Intrinsics
    1. 4.1 OpenCL-Like Intrinsics
    2. 4.2 Streaming Address Generator Intrinsics
    3. 4.3 C6000 Legacy Intrinsics
    4. 4.4 Memory System Intrinsics
  7. TI Vector Types
    1. 5.1 Constructors
    2. 5.2 Accessors
    3. 5.3 Vector Operators
    4. 5.4 Print Debug Function
  8. Streaming Engine and Streaming Address Generator
  9. Lookup Table and Histogram Interface
    1. 7.1 Lookup Table and Histogram Data
  10. C6000 Migration
    1. 8.1 __float2_t Legacy Data Type
  11. Matrix Multiply Accelerator (MMA) Interface
  12. 10Compiler Errors and Warnings
    1. 10.1 Key Terms Found in Compiler Errors and Warnings
    2. 10.2 Host Emulation Specific Syntax
  13. 11Revision History
  14.   35

Example Program

The following is a sample program that can be compiled using both Host Emulation and the C7000 compiler interchangeably without modification to the source. A sample compiler command is provided for each case.

The C7000 compiler (cl7x) command-line options are not compatible with the Host Emulation compilers.

/* Example Program test.cpp */
#include "c7x.h"
extern void test(int8 v);
int main()
{
    int8 vec1 = int8(1,2,3,4,5,6,7,8);
    int8 vec2 = (int8)5;
    test(vec1 + vec2);
}

C7100 Host Emulation compiler command (Linux):

g++ -c --std=c++14 -fno-strict-aliasing -I<cgt_install_path>/host_emulation/include/C7100 
test.cpp -L<cgt_install_path>/host_emulation -lC7100-host-emulation

The -fno-strict-aliasing command-line option should always be used with g++ when using Host Emulation. This option ensures the g++ compiler does not use type differences to make aliasing decisions. The Host Emulation implementation uses differing types in order to implement TI vector types. Therefore if this option isn't used, g++ may incorrectly optimize TI vector code utilizing the Host Emulation feature, which may lead to unexpected and incorrect results.

C7000 compiler command:

cl7x test.cpp