10.3 CPI file syntax

CPI files are plain text files that contain a series of statements, one per line. Any lines that begin with a # character are ignored.

In the following syntax definitions, square brackets [] enclose optional attributes. Attributes that can be repeated are followed by an ellipsis .

The valid statements in a CPI file are:

DefineCpi

Defines the CPI value to use for an instruction class or group. The syntax is:

DefineCpi class_or_group ISet=iset [CpuType=cputype] Cpi=cpi

where:

class_or_group

The name of an instruction class or group. This name can contain wildcards.

A decoded instruction is matched against all DefineCpi statements in the order they appear in the CPI file from top to bottom. The first instruction class match is used and all following statements are ignored.

ISet=iset

Specifies which ARM instruction set this CPI value refers to. This parameter is one of A32, A64, Thumb, or T2EE, or use the * character to specify all instruction sets.

CpuType=cputype
Specifies which ARM processor type this CPI value refers to. This parameter can be a user-defined type, or one of the following pre-defined types:
  • ARM_Cortex-A12
  • ARM_Cortex-A17
  • ARM_Cortex-A15
  • ARM_Cortex-A7
  • ARM_Cortex-A5MP
  • ARM_Cortex-M4
  • ARM_Cortex-M7
  • ARM_Cortex-A57
  • ARM_Cortex-A72
  • ARM_Cortex-A53
  • ARM_Cortex-R7
  • ARM_Cortex-R5
  • ARM_Cortex-A9MP
  • ARM_Cortex-A9UP
  • ARM_Cortex-A8
  • ARM_Cortex-R4
  • ARM_Cortex-M3
  • ARM_Cortex-M0+
  • ARM_Cortex-M0
Use the * character to specify any processor type. Specifying no CpuType is equivalent to specifying CpuType=*.
Cpi=cpi
The CPI value to assign to this instruction class or group.

For example:

DefineCpi Load_instructions ISet=A64 CpuType=ARM_Cortex-A53 Cpi=2.15
DefineClass

Defines an instruction class. The syntax is:

DefineClass class Mask=mask Value=value [ProhibitedMask=pmask ProhibitedValue=pvalue …] ISet=iset [CpuType=cputype]

where:
class
The name of the instruction class to define. It must be unique in the CPI file. It can be used in a subsequent DefineCpi statement.
Mask=mask

A bitmask to apply to an instruction encoding before comparing the result with the Value attribute. This parameter identifies which bits in the encoding are relevant for comparing with Value.

For example, the value 0000xxxx1xxx100x is represented as Mask=0xF08E Value=0x0088.

Value=value

The binary value to compare with the instruction encodings. A match indicates that the instruction belongs to this class, unless the encoding also matches the ProhibitedValue.

ProhibitedMask=pmask

A bitmask to apply to an instruction encoding before comparing the result with the ProhibitedValue attribute. It identifies which bits in the encoding are relevant for comparing with ProhibitedValue.

ProhibitedValue=pvalue

The binary value to compare with the instruction encodings. A match indicates that the instruction does not belong to this class.

ISet=iset

Specifies which ARM instruction set this class refers to. See DefineCpi for the possible values.

CpuType=cputype

Specifies which ARM processor type this class refers to. See DefineCpi for the possible values.

Note:

A DefineClass statement must include a single Mask and Value attribute pair, but can include any number of ProhibitedMask and ProhibitedValue attribute pairs.

For example:

DefineClass Media_instructions Mask=0x0E000010 Value=0x06000010 ProhibitedMask=0xF0000000 ProhibitedValue=0xF0000000 ISet=A32
DefineGroup

Defines a group of instruction classes. The syntax is:

DefineGroup group Classes=class[,class,…] ISet=iset [CpuType=cputype] [Mix=mix[,mix,…]]

where:

group
The name of the group to define. It must be unique in the CPI file. It can be used in a subsequent DefineCpi statement.
Classes=class[,class,…]

A comma-separated list of instruction classes that belong to this group.

ISet=iset

Specifies which ARM instruction set this group refers to. See DefineCpi for the possible values.

CpuType=cputype

Specifies which ARM processor type this group refers to. See DefineCpi for the possible values.

Mix=mix[,mix,…]
A comma-separated list of mixin names that cause additional instruction groups and classes to be automatically defined.

For example:

DefineGroup Divide_instructions Classes=SDIV,UDIV CpuType=ARM_Cortex-A73 ISet=A32
DefineMixIn

Defines a single mask/value pair and suffix that can optionally be used in DefineGroup statements to automatically define new instruction groups and classes. Applying a mixin to a group causes a new instruction group or class to be defined for every instruction group or class that is included in the group, and also for the group itself. The names of these newly-defined groups and classes is the original group or class name followed by an underscore character, then the mixin suffix.

The syntax is:

DefineMixIn mix Mask=mask Value=value Suffix=suffix

where:

mix
The name of the mixin to define. It must be unique in the CPI file. It can be used in subsequent DefineGroup statements.
Mask=mask

A bitmask to apply to an instruction encoding before comparing the result with the Value attribute.

Value=value

The binary value to compare with the instruction encodings. A match indicates that the instruction belongs to this group or class.

Suffix=suffix

After applying a mixin to a group, this suffix is appended to the names of the automatically-defined groups and classes.

In the following example, the DefineGroup statement defines my_group, but also automatically defines my_group_AL and my_class_AL:

DefineMixIn my_mixin Mask=0xF0000000 Value=0xE0000000 Suffix=AL
…
DefineClass my_class Mask=0x0FF00000 Value=0x03000000 ISet=A32
DefineGroup my_group Classes=my_class ISet=A32 Mix=my_mixin
DefineCpuType

Defines a processor type. The syntax is:

DefineCpuType cputype ISets=iset[,iset,…]

where:

cputype
The name of the processor type to define. It must be unique in the CPI file. It can be used in subsequent DefineCpi, DefineClass, DefineGroup, and MapCpu statements.
ISets=iset[,iset,…]

A comma-separated list of ARM instruction sets that this processor type supports. See DefineCpi for the possible values.

For example:

DefineCpuType ARM_Cortex-A73 ISets=*
MapCpu

Maps a CPU instance by name to a CPU type. The syntax is:

MapCpu cpuinstance ToCpuType=cputype

where:

cpuinstance

The name of the CPU instance to map to a processor type. It can contain wildcards.

ToCpuType=cputype

The processor type to map the CPU instance onto. See the list of CpuTypes in DefineCpi for the possible values.

For example:

MapCpu SVP_Base_AEMv8A-AEMv8A.AEMv8A_Primary.cluster.cpu0 ToCpuType ARM_Cortex-A73
Defaults

Defines the default CPI value to be used for instructions that do not match any class or group. This statement is optional and can occur more than once in the CPI file. The syntax is:

Defaults ISet=iset [CpuType=cputype] Cpi=cpi

where:

ISet=iset

Specifies which ARM instruction set this value refers to. See DefineCpi for the possible values.

CpuType=cputype
Specifies which ARM processor type this value refers to. See DefineCpi for the possible values.
Cpi=cpi
The default CPI value for the specified instruction set and processor type.

For example:

Defaults ISet=* CpuType=* Cpi=0.82
Include

Includes a supplementary CPI file at this point in the file. This is equivalent to the #include preprocessor directive in C. The evaluation of the FilePath attribute is to first treat it as an absolute path, then as a relative path, and finally as relative to the PVLIB_HOME environment variable. The syntax is:

Include FilePath=path

For example:

Include FilePath=etc/CPIPredefines/ARMv8A_A32_Predefines.txt
Non-ConfidentialPDF file icon PDF versionARM 100965_1101_00_en
Copyright © 2014–2017 ARM Limited or its affiliates. All rights reserved.