Running an application on an FVP with varying vector width
This describes running a simple program that has been compiled using Arm® Compiler 6. It shows how you can increase the SVE vector width on the FVP model to reduce the total number of executed instructions.
This example uses a project,
that is provided with DS-5, which you can import. The application contains two
vectorizable loops. The first loop fills the array,
values, with floating-point values. The second loop adds all these
In the Project Explorer
view, select the project
sve_array_sum. If the project does not contain the compiled
.axffile, then right-click the project and build it using Arm Compiler 6.
provides an FVP debug configuration for this project,
sve_array_sum_FVP. To open the debug configuration, right-click the project and select Debug As > Debug Configurations and select
sve_array_sum_FVPfrom the list of DS-5 Debugger configurations.
In the Model parameters field,
specify these three options:
veclenoption defines the SVE vector width, in units of 64-bit (8-byte) blocks. The maximum value of
veclenis 32, which corresponds to the architectural maximum SVE vector width of 2048-bit (256-byte) blocks. The SVE architecture only supports vector lengths in 128-bit (16 byte) blocks, so all values of
veclenmust be even. For example, a
veclenvalue of 8 signifies 512-bit vector width SVE registers.
--statoption prints statistics about the application when the FVP model exits.
Figure 4-11 Model parameters for vector length 128 bits (veclen=2)
- Click Apply and then click Debug to load the application on the FVP model.
To see the SVE registers, open the Registers view from the main menu Windows > Show View. If the SVE registers are not visible, in Register
set, select All registers
and then expand AARCH64 > SVE > Data.
veclenis set to 2, the SVE Z registers are 128-bit registers.
Figure 4-12 SVE registers with vector length 128 bits (veclen=2)
- Using the Debug Control view, you can step through the application or run it till a breakpoint is hit. You can open the Debug Control view using Window > Show View.
- Using the Debug Control view, run the application to completion. Then right-click the connection and select Disconnect from Target to disconnect from the model.
Open the Target Console view from
the main menu Window > Show View.
Figure 4-13 Target console with vector length 128 bits (veclen=2)
NoteThe statistics output shows
Total instructions executed: 8897. This number might be different depending on the other compiler settings.
To change the vector width for the FVP model, open the debug configurations for the
project. In the Model parameters, change the
veclenparameter to 32. Then click Debug.
Figure 4-14 Model parameters for vector length 2048 bits (veclen=32)
Go to the Registers view and note
that the SVE Z registers are 2048-bit registers when
Figure 4-15 SVE registers with vector length 2048 bits (veclen=32)
Run the application to completion and then disconnect from the target. In
the Target Console view, see that the
total instructions executed is lower. The wider the SVE vector, the fewer
instructions are needed to process the array.
Figure 4-16 Target console with vector length 2048 bits (veclen=32)