주요 콘텐츠

Processor (-custom-target)

Select the processor for the current build configuration

Description

Specify a processor name for static analysis or testing. The processor name translates to sizes of fundamental data types, definitions of types such as size_t and wchar_t, and other details. You can also modify some properties of a predefined processor, or create a custom processor and explicitly specify the processor details.

Note the following :

  • This option is automatically set if you create a project from your build command in the user interface or using the polyspace-configure system command.

  • This option value is ignored during static analysis if you select one of the specialized cross-compilers for the option Compilation toolchain for static analysis (-compiler). For this subset of compilers, you specify both the compiler name and the processor name together when you specify the compilation toolchain for static analysis. For instance, the toolchain specification renesas - rh850 specifies a Renesas compiler and the RH850 family of processors.

Set Option

Set the option using one of these methods:

  • Polyspace Platform user interface (desktop products only) — In your project configuration, on the Build tab, select Target & Compiler and then select or add a processor using this option.

  • Command line and options file — Use the option -custom-target to specify processor details. See Command-Line Information.

Why Use This Option

The processor details are used during dynamic testing to generate driver code for building the project. These details are also used to appropriately instrument your source code for code profiling.

Some of the checkers that run during static analysis also use the processor details. For instance, the checkers for overflow uses the sizes of data types to determine if the value assigned to a variable exceeds the maximum value that the variable type can accommodate.

Settings

Select a processor name in list of processors. To add to this list:

  1. Click on toothed gear button near the option to open the Manage Processors window.

  2. Select Add a processor. Select a manufacturer and processor name and then select Add to add the selected processor.

    Manage Processors window

    To add a custom processor, select Custom in the manufacturer dropdown.

  3. Click OK. The processor you added is now available for selection.

    To review the properties of the selected processor, click edit icon to open the Edit Processor window. Depending on the processor you selected, you can modify some of the processor properties while others are fixed.

Default: Host Computer

Host Computer

The dynamic testing uses your host computer as the processor.

AMD

Polyspace® supports these AMD processors:

  • Athlon 64

  • K5/K6/Athlon

  • x86-32 (Windows32)

  • x86-64 (Linux 64)

  • x86-64 (Mac OS X)

  • x86-64 (Windows 64)

ARM compatible

Polyspace supports these ARM processors:

  • ARM 7-11

  • ARM Cortex A

  • ARM Cortex M

  • ARM Cortex R

  • ARM 64-bit (LLP64)

  • ARM 64-bit (LP64)

Altera

Polyspace supports the SoC (ARM Cortex A) processor from Altera.

Analog Devices

Polyspace supports these Analog Devices processors:

  • ADSP-CM40x(ARM Cortex-M)

  • Blackfin

  • SHARC

  • TigerSHARC

Apple

Polyspace supports the ARM64 processor from Apple.

Atmel

Polyspace supports these Atmel processors:

  • AVR

  • AVR (32-bit)

  • AVR (8-bit)

Freescale

Polyspace supports these Freescale processors:

  • 32-bit PowerPC

  • 68332

  • 68HC08

  • 68HC11

  • ColdFire

  • DSP563xx (16-bit mode)

  • DSP5685x

  • HC(S)12

  • MPC52xx

  • MPC5500

  • MPC55xx

  • MPC5xx

  • MPC7xx

  • MPC82xx

  • MPC83xx

  • MPC85xx

  • MPC86xx

  • MPC8xx

  • S08

  • S12x

  • StarCore

Infineon

Polyspace supports these Infineon processors:

  • C16x, XC16x

  • PPU

  • TriCore

Intel

Polyspace supports these Intel processors:

  • x86-32 (Windows32)

  • x86-64 (Linux 64)

  • x86-64 (Mac OS X)

  • x86-64 (Windows64)

Microchip

Polyspace supports these Microchip processors:

  • PIC18

  • dsPIC

NXP

Polyspace supports these NXP processors:

  • Cortex-M0/M0+

  • Cortex-M3

  • Cortex-M4

RISC-V

Polyspace supports these RISC-V processors:

  • RV32I

  • RV64I

Renesas

Polyspace supports these Renesas processors:

  • M16C

  • M32C

  • R8C/Tiny

  • RH850

  • RL78

  • RX

  • RZ

  • SH-2/3/4

  • V850

STMicroelectronics

Polyspace supports the ST10/Super10 processor from STMicroelectronics processors

Texas Instrument

Polyspace supports these Texas Instrument processors:

  • C2000

  • C5000

  • C6000

  • MSP430

  • Stellaris Cortex-M3

  • TMS470

  • TMS570 Cortex-R4

Custom

You can define a custom processor using this option.

Custom Processor Details

If you add a custom processor or modify the properties of an existing processor, you can provide the following information:

  • Sizes of fundamental data types – Enter the numerical value of the size in bits. Example values include 8,16,32, or 64.

    In addition, if your processor defines a plain char as a signed type, select Plain char is signed. Otherwise, plain char-s are assumed to be unsigned.

  • Alignment – Enter a numerical value that represents the maximum alignment of integer types in bits. Example values include 32 or 64.

  • Minimum alignment of structures – Enter a numerical value that represents the minimum alignment of members within composite objects such as structures or unions. Unlike the previous values, the specification uses bytes instead of bits. Example values include 4, 8 or 16.

    This value is different from Alignment even though both values can be used to determine storage of members inside composite objects. For instance, a structure might need to be aligned on a 16-byte boundary for SIMD instructions or DMA transfers while individual integers inside the structure might need to be aligned on 4-byte boundaries.

  • Native word size – Enter a numerical value that represents the number of bits that the processor can process at a time. Example values include 8, 16, 32, or 64.

  • Byte ordering – Specify the endianness of the custom processor. Select one of Unspecified, Little endian, or Big endian.

  • Type of wchar_t – Select one of defined-by-compiler, signed short, unsigned short, signed int, unsigned int, signed long, or unsigned long.

  • Type of size_t – Select one of defined-by-compiler, unsigned char, unsigned short, unsigned int, unsigned long, or unsigned long long.

  • Type of ptrdiff_t – Select one of defined-by-compiler, signed char, short, signed int, int, long, or long long.

  • Underlying type of enum – Specify the underlying type for enum. Select one of the following options:

    • defined-by-compiler — Polyspace uses signed int as the underlying type of enums for all compilers except gnu and clang.

      For the gnu and clang compilers, Polyspace uses the first type that can hold all of the enumerator values from this list: unsigned int, signed int, unsigned long, signed long, unsigned long long and signed long long.

    • auto-signed-first — Polyspace uses the first type that can hold all of the enumerator values from this list: signed char, unsigned char, signed short, unsigned short, signed int, unsigned int, signed long, unsigned long, signed long long, and unsigned long long.

    • auto-unsigned-first — Polyspace uses the first type that can hold all of the enumerator values from this list:

      • For positive enumerator values: unsigned char, unsigned short, unsigned int, unsigned long, and unsigned long long.

      • For negative enumerator values: signed char, signed short, signed int, signed long, and signed long long.

Tips

Instead of specifying a processor explicitly, try creating a Polyspace Platform project from your build command first. For more information, see Configure Sources and Build Options in Project for Polyspace Analysis and Testing. If you cannot create a project from your build command, continue with the manual configuration of options.

Command-Line Information

This section applies to static analysis only.

To specify a processor for static analysis at the command-line, you can use one of the following command-line options:

  • -custom-target with a comma-separated list of processor properties.

  • -target with a named processor, or -target mcpu followed by other options to specify processor properties.

If you use the Processor option in the user interface, it translates to the option -custom-target with appropriate arguments.

If you also specify one of the specialized cross-compilers plus processor using the option Compilation toolchain for static analysis (-compiler), this specification translates to the options -compiler and -target. For instance, the specification renesas - rh850 translates to -compiler renesas -target rh850. In this case, the analysis log shows the use of both -custom-target and -target but the value of -custom-target is ignored.

-custom-target

The option -custom-target does not support named processors. Instead, you must specify all processor properties in a comma-separated list.

Parameter: -custom-target
Value:: Comma-separated list of processor properties in this order: <plainCharSignedNess>, <charSize>, <shortSize>, <intSize>, <shortLongSize>, <longSize>, <longLongSize>, <floatSize>, <doubleSize>, <longDoubleSize>, <ptrSize>, <intAlignment>, <structAlignment>, <endianness>, <sizeTType>, <ptrDiffTType>, <wcharTType>
Example (Bug Finder):: polyspace-bug-finder -custom-target false,8,2,4,-1,4,8,4,8,8,4,8,1,little,unsigned_int,int,unsigned_int
Example (Code Prover):: polyspace-code-prover -custom-target false,8,2,4,-1,4,8,4,8,8,4,8,1,little,unsigned_int,int,unsigned_int

The option argument in the above examples translates to the following processor details:

  • Whether plain char is signed (<plainCharSignedNess>) – false

  • Size of char (<charSize>) – 8 bits (only the size of char is specified in bits, all other sizes are in bytes)

  • Size of short (<shortSize>) – 2 bytes

  • Size of int (<intSize>)– 4 bytes

  • Size of short long (<shortLongSize>) – short long is not supported (indicated by -1)

  • Size of long (<longSize>) – 4 bytes

  • Size of long long (<longLongSize>) – 8 bytes

  • Size of float (<floatSize>) – 4 bytes

  • Size of double (<doubleSize>) – 8 bytes

  • Size of long double (<longDoubleSize>) – 8 bytes

  • Size of pointer (<ptrSize>) – 4 bytes

  • Maximum alignment of all integer types (<intAlignment>) – 8 bytes

  • Minimum alignment of members within type struct or union (<structAlignment>) – 1 byte

  • Endianness (<endianness>) – little (allowed values are little and big)

  • Underlying type of size_t (<sizeTType>) – unsigned_int (allowed values are unknown, unsigned_char, unsigned_short, unsigned_int, unsigned_long, and unsigned_long_long)

  • Underlying type of ptrdiff_t (<ptrDiffTType>) – int (allowed values are unknown, signed_char, short, int, long, and long_long)

  • Underlying type of wchar_t (<wcharTType>) – unsigned_int (allowed values are unknown, short, unsigned_short, int, unsigned_int, long, and unsigned_long)

-target

You can specify a named processor with the option -target. The named processors supported with -target are different from the named processors available for the option Processor in the Polyspace Platform user interface.

Parameter: -target
Value: i386 | sparc | m68k | powerpc | necv850 | hc08 | x86_64 | mcpu
Default: i386
Example (Bug Finder): polyspace-bug-finder -target m68k
Example (Code Prover): polyspace-code-prover -target m68k
Example (Bug Finder Server): polyspace-bug-finder-server -target m68k
Example (Code Prover Server): polyspace-code-prover-server -target m68k

For more information on the details for the named processors, see -target. Note that the option -target mcpu indicates a custom processor. With -target mcpu and other named processors, you can use another set of options to modify the default processor properties. This is an alternative to using the option -custom-target.

Limitations

  • The Polyspace Platform user interface does not support multiple processors with the same name. If a build configuration that you are importing or converting to internal has a processor with the same name but different values than one that is already defined in the project, you see a warning message. If you continue with the import or conversion, the conflicting processor settings defined in the incoming build configuration are discarded. The project keeps the settings for the identically named processor that was already defined in the project.

    To keep the custom processor settings from the incoming build configuration, you must first rename or delete the identically named processor that exists in the project.

    For more information on working with configuration variants and external configurations, see Share and Reuse Configuration Variants.