• No results found

AXD Facilities

4.7 Data formatting

4.7.7 Floating point

Most floating point formats allow you to display or enter very small and very large numerical values without having to use long strings of zeros.

You can enter very precise values by using sufficient significant digits, but the precision that can be stored depends on the number of bits allocated. Generally, if you enter too many significant digits the value is rounded to the nearest value that can be stored.

Four kinds of floating point format are supported:

Floating point

The first character can be a minus sign (-) or a plus sign (+). Remaining characters are decimal digits (0-9) and one decimal point that can be placed at any position among the digits.

A precision of up to about 6 significant figures can be stored. A value stored in this format occupies 32 bits.

Scientific (single precision)

A dialog helps you enter or edit data in this format. You are prompted for the sign and value of the mantissa and the exponent.

A value displayed in this format always has its decimal point after the first significant figure.

This format offers a precision of up to about 6 significant figures. The exponent value must be in the range -38 to +38. This format occupies 32 bits of storage.

Scientific (double precision)

A dialog helps you enter or edit data in this format. You are prompted for the sign and value of the mantissa and the exponent.

A value displayed in this format always has its decimal point after the first significant figure.

This format offers a precision of up to about 15 significant figures. The exponent value must be in the range -308 to +308. This format occupies 64 bits of storage.

Raw floating point

This format enables you to view values in the 80-bit format used in a Floating Point Accelerator (FPA) coprocessor.

4.7.8 Registers

Certain registers contain collections of settings that can be represented by very few bits, often a single bit. Formats appropriate to these registers display the contents in meaningful ways. For example, a flag that might be on or off is displayed as a letter. The letter indicates which flag, uppercase meaning set and lowercase meaning cleared.

A dialog helps you to change the contents of this kind of register.

When you display the contents of a register, the required register format is used automatically. The following register formats are supported:

PSR (Program Status Register)

A typical display of a Program Status Register might show nZCvIFtSVC, giving information about:

• 4 condition code flags (NZCV)

• 2 interrupt enable flags (IF)

• 1 state indicator (T)

• 1 processor mode name (SVC).

E-PSR (Enhanced Program Status Register)

This format applies to processors, such as the ARM 9E, that support the enhanced DSP instructions in E variants of ARM Architecture version 5 and above. See Registers processor view on page 5-19 for more information.

A typical display of an Enhanced Program Status Register might show nZCvqIFtSVC, giving information about:

• 5 condition code flags (NZCVQ)

• 2 interrupt enable flags (IF)

• 1 state indicator (T)

• 1 processor mode name (SVC).

JPSR (Jazelle Program Status Register)

This format applies to processors, such as the ARM926EJ-S, that support ARM’s Jazelle technology for Java applications. See Registers processor view on page 5-19 for more information.

A typical display of a Jazelle Program Status Register might show nZCvqIFtJSVC, giving information about:

• 5 condition code flags (NZCVQ)

• 2 interrupt enable flags (IF)

• 2 state indicators (TJ)

• 1 processor mode name (SVC).

FPSR (Floating Point Status Register)

This format applies if you are using a Floating Point Accelerator (FPA) coprocessor, or the Floating Point Emulator (FPE). A typical display of a Floating Point Status Register might show xuOZI_xuozi.

Five letters are displayed twice. Each letter represents a floating point exception, as follows:

The first set of letters represent the current settings of the five Exception Trap Enables, also known as the Exception Mask. These settings define which of the exceptions, if they occur, are intercepted by the debugger.

The second set of letters represent the Cumulative Exception Flags and show the exceptions that have occurred.

Bits 20:16 of the 32-bit FPSR are the Exception Trap Enables, and bits 4:0 are the Cumulative Exception Flags.

FPSCR (Floating Point Status and Control Register)

This format applies to 32-bit registers containing bits that have the following meanings:

31:28 Condition Flags. These bits represent the condition flags that contain the results of the most recent floating point

comparison, as follows:

N the comparison produced a less than result Z the comparison produced an equal result

C the comparison produced an equal, greater than or unordered result

V the comparison produced an unordered result.

27:25 Reserved. Do not use.

24 Mode. This bit represents the flush-to-zero mode. If the bit is unset (=0) flush-to-zero is disabled.

21:20 Stride part of the current vector length/stride control. The allowed combinations are given in the drop-down list.

19 Reserved. Do not use.

18:16 Length part of the current vector length/stride control. The allowed combinations are given in the drop-down list.

15:13 Reserved. Do not use.

12:8 Exception Mask. Each bit corresponds to one type of floating point exception, as defined for Cumulative Flags.

7:5 Reserved. Do not use.

4:0 Cumulative Flags. Each bit corresponds to one type of floating point exception. If a bit is set (=1), the exception flag has been set as a result of executing a floating point instruction.

The flags are defined as follows:

X Inexact result, that is, non-zero rounding U Underflow has occurred

O Overflow has occurred

Z Divide by zero has been attempted I Invalid operation.

In views, set bits are represented by uppercase identifiers, unset bits are represented by lowercase identifiers.

Other register formats

Other register formats might be available, depending on your target system.

4.7.9 Q-format

Q-formats are bit-level formats for storing numeric values. A Q-format enables you to specify:

• the number of bits used to represent values

• the numeric range within which all values fall.

Precision

The total number of bits you allow for storing a value determines the maximum precision with which a value can be defined. You can also regard it as determining the resolution, or smallest difference that can be distinguished between values.

Numeric range

In a Q-format you specify how many bits represent an integer value, and how many further bits represent subdivisions within each integer value. You can in effect specify ranges. For example:

• -1024 to (almost) +1024, where the most significant 11 bits represent a signed integer value

• 0 to (almost) +64, where the most significant 6 bits represent an unsigned integer value

• -1 to (almost) +1, where the most significant bit represents the sign.

In each case, all the remaining bits represent fractions between each integer value, and (almost) means a value one least-significant-bit less than the value given.

Notation

The form of a Q-format is Qn.m, where n is the number of bits before a notional binary point, and m is the number of bits that follow it. You can choose signed Q-format for ranges of values divided equally either side of zero, or unsigned Q-format for values that range upwards from zero.

For example, a 16-bit halfword can hold values in a signed Q4.12 format. This covers the range -8 to (almost) +8, with 65,536 unique values available in that range.

U Q15 is shorthand for unsigned Q1.15. This is a format for 16-bit values that gives 65,536 unique values in the range 0 to (almost) +2.

Q31 is shorthand for signed Q1.31. This is a format for 32-bit values that gives 4,294,967,296 unique values in the range -1 to (almost) +1.

4.7.10 Other

This submenu includes all the remaining available formats that do not appear on other submenus. It also enables you to specify the number of bits of storage space you want allocated to a data item. The items on this submenu are:

U Decimal See Decimal on page 4-18.

String This format treats the value as an array of characters.

If you attempt to edit a character array formatted as a string, a String dialog is displayed, as shown in Figure 4-2.

Figure 4-2 String dialog You can choose whether to edit the string as ASCII or ASCIIZ. If you select ASCII, all characters up to the size of the array are replaced by the input characters. If you select ASCIIZ, a trailing character zero is always added as the final character of the array.

The dialog always opens with ASCIIZ set by default.

Type your character string in the edit box. If you enclose the string in quotes, AXD interprets it as a C++ escape string and the read-only box below the edit box shows how the string would be displayed. For example, if your input contains a null character, only the characters before the null are displayed. If you omit the quotes, all characters are treated as part of the string and it is passed directly to the display.

The current value of the string is displayed, together with its hexadecimal representation.

Hex - no prefix

Select this format to display a value in hexadecimal format without the usual leading 0x characters. If you replace the displayed value your entry must still begin with 0x to avoid being mistaken for a decimal value.

Octal - no prefix

Select this format to display a value in an octal format without the usual leading o character. If you replace the displayed value your entry must still begin with o to avoid being mistaken for a decimal value.

In addition there are size menus for other sized values. These menus do not indicate the current size of the data item. This part of the submenu shows:

Size 8 Select this to display a further submenu containing all the formats that you can use with 8-bit data items.

Size 16 Select this to display a further submenu containing all the formats that you can use with 16-bit data items.

Size 32 Select this to display a further submenu containing all the formats that you can use with 32-bit data items.

Size 40 Select this to display a further submenu containing all the formats that you can use with 40-bit data items.

Size 64 Select this to display a further submenu containing all the formats that you can use with 64-bit data items.

Size 80 Select this to display a further submenu containing all the formats that you can use with 80-bit data items.

4.8 Profiling

Profiling involves sampling the program counter at specific time intervals. The resulting information is used to build up a picture of the percentage of time spent in each procedure. By using the armprof command-line tool on the data generated by AXD, you can see how to make the program more efficient.

Note

Profiling is supported by RealView ARMulator ISS, RealMonitor, and Angel, but not by EmbeddedICE or Multi-ICE.

To collect profiling information when executing an image, you must specify profiling settings when you first load the image (see Load Image... on page 5-7) or before reloading the image (see Image pop-up menu on page 5-51):

Flat profiling

Flat profiling accumulates limited information without altering the image.

Call graph profiling

Call graph profiling accumulates more detailed information but has to add extra code to the image.

To collect profiling information:

1. Load your image file, having made the appropriate profiling settings.

2. Select Options→ Profiling → Toggle Profiling if necessary to ensure that Toggle