主要内容

polyspace.project.Processor Class

R2026b

Namespace: polyspace.project

(Python) Store processor configuration for a build configuration

Since R2025a

Description

This Python® class represents the processor associated with a build configuration. A polyspace.project.Processor object stores your target processor characteristics such as data type sizes, byte ordering, and alignment. Polyspace® Test™ uses this information to generate driver code for building a project on target hardware, and other purposes. Some checkers that run during static analysis also use the processor details.

You can get a processor (polyspace.project.Processor object) in one of the following ways:

  • You can create a processor using the createFromTF or createCustom method on the Processors property of a project (polyspace.project.Project object) and then set the newly created processor in your build configuration. You set a processor by assigning it to the Processor property of a build configuration (polyspace.project.OwnedBuildConfiguration or polyspace.project.BuildConfiguration object).

  • You can get the currently used processor by reading the current Processor property of a build configuration.

  • If you set the Board property of a build configuration to the name of a previously registered hardware board (that is, a value other than "None" or "Host Computer"), the Processor property is set to the processor associated with the board.

Creation

Description

processor = buildConf.Processor returns the polyspace.project.Processor object associated with the build configuration buildConf. Here, buildConf is a polyspace.project.OwnedBuildConfiguration or polyspace.project.BuildConfiguration object.

processor = proj.Processors.createFromTF(standardProcessorName, manufacturerName) creates a polyspace.project.Processor object from a predefined target processor specification with the specified processor name and manufacturer name. The processor is added to the list of available processors for the polyspace.project.Project object proj. You can then assign the processor to the Processor property of a build configuration. For a list of supported processor names and manufacturer names, see Target processor type (-target).

processor = proj.Processors.createCustom(customProcessorName) creates a custom polyspace.project.Processor object with the specified name. You can then configure the processor properties such as data type sizes, byte ordering, and alignment. The processor is added to the list of available processors for the polyspace.project.Project object proj.

Input Arguments

expand all

Name of a predefined target processor, specified as a string. For a list of supported processor names, see Target processor type (-target).

Name of the processor manufacturer, specified as a string. For a list of supported manufacturer names, see Target processor type (-target).

Name for the custom processor, specified as a string.

Properties

expand all

Maximum alignment of integer types.

Example: buildConf.Processor.Alignment=16

Size of char data type in bits.

Example: buildConf.Processor.CharBitsSize=8

Size of double data type in bits.

Example: buildConf.Processor.DoubleBitsSize=64

Byte ordering for custom processors. The byte ordering determines how multibyte data types are arranged in memory.

Example: buildConf.Processor.Endianness=buildConf.Processor.Endianness.Big

Underlying type for enum:

  • DEFINED_BY_COMPILER — Polyspace uses signed int as the underlying type of enums for all compilers except gnu, clang, and tasking.

    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.

    For the tasking compiler, Polyspace uses the first type that can hold all of the enumerator values from this list: char, unsigned char, short, unsigned short, int, and unsigned int.

  • 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.

Example: buildConf.Processor.EnumTypeDefinition=buildConf.Processor.EnumTypeDefinition.AUTO_SIGNED_FIRST

Size of float data type in bits.

Example: buildConf.Processor.FloatBitsSize=32

Size of int data type in bits.

Example: buildConf.Processor.IntBitsSize=32

Support for long long data type.

Example: buildConf.Processor.IsLongLongSupported=True

Size of long data type in bits.

Example: buildConf.Processor.LongBitsSize=32

Size of long double data type in bits.

Example: buildConf.Processor.LongDoubleBitsSize=80

Size of long long data type in bits.

Example: buildConf.Processor.LongLongBitsSize=64

Size of pointer in bits.

Example: buildConf.Processor.PointerBitsSize=32

Underlying type of ptrdiff_t data type.

Example: buildConf.Processor.PtrDiffT=buildConf.Processor.PtrDiffT.INT

Size of short data type in bits.

Example: buildConf.Processor.ShortBitsSize=16

Specify whether plain char types are signed or not.

Example: buildConf.Processor.SignedChar=True

Underlying type of size_t data type.

Example: buildConf.Processor.SizeT=buildConf.Processor.SizeT.UNSIGNED_INT

Minimum value of alignment for struct and union data types.

Example: buildConf.Processor.StructureMinAlignment=8

Underlying type of wchar_t data type.

Example: buildConf.Processor.WCharT=buildConf.Processor.WCharT.UNSIGNED_INT

Number of bits that the processor can process at one time.

Example: buildConf.Processor.WordSize=64

Tips

The following constraints apply to your processor specifications:

  • If you specify a predefined processor by its name and manufacturer name, you cannot edit all properties of the processor. Trying to edit nonconfigurable properties leads to a ValueError with a message:

    Unable to set parameter <parameterName> in processor <processorName>

  • You cannot set negative values for processor properties that specify sizes of data types.

Version History

Introduced in R2025a

expand all