Main Content

polyspace.GenericTargetOptions Class

Namespace: polyspace

Create a generic target configuration

Description

Create a custom target for a Polyspace® analysis if your target processor does not match one of the predefined targets,.

Note

Before you run Polyspace from MATLAB®, you must link your Polyspace and MATLAB installations. See Integrate Polyspace with MATLAB and Simulink or Integrate Polyspace Server Products with MATLAB.

Construction

genericTarget = polyspace.GenericTargetOptions creates a generic target that you can customize. To specify the sizes and alignment of data types, change the properties of the object. For instance:

target = polyspace.GenericTargetOptions;
target.CharNumBits = 16;

Properties

expand all

For more details about any of the properties below, see Generic target options.

Largest alignment of struct or array objects, specified as 32, 16, or 8. Comparable with the DOS/UNIX command-line option -align.

Example: target.Alignment = 8

Define the number of bits for a char, specified as 8 or 16. Comparable with the DOS/UNIX command-line option -char-is-16bits.

Example: target.CharNumBits = 16

Define the number of bits for a double, specified as 32 or 64. Comparable with the DOS/UNIX command-line option -double-is-64bits.

Example: target.DoubleNumBits = 64

Endianness of target architecture, specified as little or big. Comparable with the DOS/UNIX command-line options -little-endian or -big-endian.

Example: target.Endianess = 'big'

Define the number of bits for an int, specified as 16 or 32. Comparable with the DOS/UNIX command-line option -int-is-32bits.

Example: target.IntNumBits = 32

Define the number of bits for a long long, specified as 32 or 64. Comparable with the DOS/UNIX command-line option -long-long-is-64bits.

Example: target.LongNumBits = 64

Define the number of bits for a long, specified as 32. Comparable with the DOS/UNIX command-line option -long-is-32bits.

Example: target.LongNumBits = 32

Define the number of bits for a pointer, specified as 16, 24, or 32. Comparable with the DOS/UNIX command-line options -pointer-is-24bits and -pointer-is-32bits.

Example: target.PointerNumBits = 32

Define the number of bits for an int, specified as 16 or 8. Comparable with the DOS/UNIX command-line option -short-is-8bits.

Example: target.ShortNumBits = 8

Default sign of plain char, specified as signed or unsigned. Comparable with the DOS/UNIX command-line option -default-sign-of-char.

Example: target.SignOfChar = 'unsigned'

Copy Semantics

Value. To learn how value classes affect copy operations, see Copying Objects.

Examples

Customize Generic Target Settings

Use a custom target for the Polyspace analysis.

Create two objects: a polyspace.GenericTargetOptions object for creating a custom target and a polyspace.Project object for running the Polyspace analysis.

target = polyspace.GenericTargetOptions;
proj = polyspace.Project;

Customize the generic target.

target.Endianess = 'big';
target.LongLongNumBits = 64;
target.ShortNumBits = 8;

Add the custom target to the Configuration property of the polyspace.Project object.

proj.Configuration.TargetCompiler.Target = target;

You can now use the polyspace.Project object to run the analysis.

| | | |

Version History

Introduced in R2016b