主要内容

Fix Polyspace Compilation Errors Related to Green Hills Compiler

If you choose greenhills for the option Compilation toolchain (Static analysis), you encounter this issue.

Issue

During Polyspace® analysis, you see an error related to an extension specific to the Greenhills compiler. For instance, the analysis might stop due to an error related to vector data types specific to the Green Hills target rh850, for instance, the identifier __ev64_u16__.

Solution

Define Compiler Flag for Polyspace Analysis

When compiling code using the Green Hills® compiler with target rh850, to enable single instruction multiple data (SIMD) vector instructions, you might be specifying these two flags:

  • -rh850_simd: You enable intrinsic functions that support SIMD vector instructions. The functions are defined in your compiler header files. These data types are available:

    • __ev64_u16__

    • __ev64_s16__

    • __ev64_u32__

    • __ev64_s32__

    • __ev64_u64__

    • __ev64_s64__

    • __ev64_opaque__

    • __ev128_opaque__

  • -rh850_fpsimd: You enable intrinsic functions that support floating-point SIMD vector instructions. The functions are defined in your compiler header files. These data types are available:

    • __ev128_f32__

    • __ev256_f32__

The Polyspace analysis does not enable SIMD support by default. You must identify your compiler flags to Polyspace.

In your Polyspace analysis, use the command-line option -compiler-parameter. In the Polyspace Platform user interface, you can enter the command-line option in the project configuration. To do so, navigate to the Static Analysis tab, select the Advanced node, and enter this option in the Other field.

  • -rh850_simd: For your Polyspace analysis, use

    -compiler-parameter -rh850_simd

  • -rh850_fpsimd: For your Polyspace analysis, use

    -compiler-parameter -rh850_fpsimd

    Note

    • __ev128_opaque__ is 16 bytes aligned in Polyspace.

    • __ev256_f32__ is 32 bytes aligned in Polyspace.

Emulate -os_dir With Specific Polyspace Option

If you create a Polyspace project from a build command that uses a Green Hills compiler, the compiler option -os_dir is not implemented in the project. To emulate the -os_dir option, you can explicitly add the path argument of the option as an include folder to your Polyspace project.

Contact Technical Support for Greenhills Compiler Emulation for Native Windows Development

Polyspace supports the embedded configuration for the i386 target. If your x86 Green Hills compiler is configured for native Windows® development, you can see compilation errors or incorrect analysis results with Code Prover. Contact Technical Support.

For instance, Green Hills compilers consider a size of 12 bytes for long double for embedded targets, but 8 bytes for native Windows. Polyspace considers 12 bytes by default.