xref: /aosp_15_r20/art/test/README.arm_fvp.md (revision 795d594fd825385562da6b089ea9b2033f3abf5a)
1*795d594fSAndroid Build Coastguard Worker# Testing ART on a model (QEMU or Arm FVP)
2*795d594fSAndroid Build Coastguard Worker
3*795d594fSAndroid Build Coastguard WorkerThis document describes how to test ART on a model - QEMU or the ARM Fixed Virtual Platform.
4*795d594fSAndroid Build Coastguard Worker
5*795d594fSAndroid Build Coastguard WorkerIt covers steps on how to build and run an Android system image targeting a model
6*795d594fSAndroid Build Coastguard Workerand to use it as a target platform for running ART tests via ADB in chroot mode. The guide
7*795d594fSAndroid Build Coastguard Workercovers both QEMU and the ARM Fixed Virtual Platform; the setup is very similar.
8*795d594fSAndroid Build Coastguard Worker
9*795d594fSAndroid Build Coastguard WorkerMore information on QEMU and Arm FVP could be found in
10*795d594fSAndroid Build Coastguard Worker{AOSP}/device/generic/goldfish/fvpbase/README.md.
11*795d594fSAndroid Build Coastguard Worker
12*795d594fSAndroid Build Coastguard WorkerOne would need two AOSP trees for this setup:
13*795d594fSAndroid Build Coastguard Worker - a full stable (tagged) tree - to be used to build AOSP image for the model.
14*795d594fSAndroid Build Coastguard Worker   - android-13.0.0_r12 was tested successfully to run QEMU:
15*795d594fSAndroid Build Coastguard Worker     ```repo init  -u https://android.googlesource.com/platform/manifest -b android-13.0.0_r12```
16*795d594fSAndroid Build Coastguard Worker - a full or minimal tree - the one to be tested as part of ART test run.
17*795d594fSAndroid Build Coastguard Worker
18*795d594fSAndroid Build Coastguard Worker## Setting up the QEMU/Arm FVP
19*795d594fSAndroid Build Coastguard Worker
20*795d594fSAndroid Build Coastguard WorkerOnce a full AOSP tree is downloaded, please follow the instructions in
21*795d594fSAndroid Build Coastguard Worker${AOSP}/device/generic/goldfish/fvpbase/README.md; they should cover:
22*795d594fSAndroid Build Coastguard Worker - fetching, configuring and building the model.
23*795d594fSAndroid Build Coastguard Worker - building AOSP image for it.
24*795d594fSAndroid Build Coastguard Worker - launching the model.
25*795d594fSAndroid Build Coastguard Worker
26*795d594fSAndroid Build Coastguard WorkerOnce the model is started and reachable via adb, ART tests could be run.
27*795d594fSAndroid Build Coastguard Worker
28*795d594fSAndroid Build Coastguard WorkerNotes:
29*795d594fSAndroid Build Coastguard Worker - fvp_mini lunch target should be used as we don't need graphics to run ART tests.
30*795d594fSAndroid Build Coastguard Worker - 'Running the image in QEMU' mentions that a special commit should be checked out for QEMU
31*795d594fSAndroid Build Coastguard Worker   for GUI runs. Actually it is recommended to use it even for non-GUI runs (fvp_mini).
32*795d594fSAndroid Build Coastguard Worker
33*795d594fSAndroid Build Coastguard Worker### Running the Arm FVP with SVE enabled
34*795d594fSAndroid Build Coastguard Worker
35*795d594fSAndroid Build Coastguard WorkerTo test SVE on Arm FVP, one extra step is needed when following the instructions above;
36*795d594fSAndroid Build Coastguard Workerfor QEMU run this is not needed. When launching the model some extra cmdline options should
37*795d594fSAndroid Build Coastguard Workerbe provided for 'run_model':
38*795d594fSAndroid Build Coastguard Worker
39*795d594fSAndroid Build Coastguard Worker```
40*795d594fSAndroid Build Coastguard Workerexport SVE_PLUGIN=${MODEL_PATH}/plugins/<os_and_toolchain>/ScalableVectorExtension.so
41*795d594fSAndroid Build Coastguard Worker$ ./device/generic/goldfish/fvpbase/run_model --plugin ${SVE_PLUGIN} -C SVE.ScalableVectorExtension.veclen=2
42*795d594fSAndroid Build Coastguard Worker```
43*795d594fSAndroid Build Coastguard Worker
44*795d594fSAndroid Build Coastguard WorkerNote: SVE vector length is passed in units of 64-bit blocks. So "2" would stand
45*795d594fSAndroid Build Coastguard Workerfor 128-bit vector length.
46*795d594fSAndroid Build Coastguard Worker
47*795d594fSAndroid Build Coastguard Worker## Running ART test
48*795d594fSAndroid Build Coastguard Worker
49*795d594fSAndroid Build Coastguard WorkerQEMU/FVP behaves as a regular adb device so running ART tests is possible using
50*795d594fSAndroid Build Coastguard Workerthe standard chroot method described in test/README.chroot.md with an additional step,
51*795d594fSAndroid Build Coastguard Workerdescribed below. A separate AOSP tree (not the one used for the model itself), should
52*795d594fSAndroid Build Coastguard Workerbe used - full or minimal.
53*795d594fSAndroid Build Coastguard Worker
54*795d594fSAndroid Build Coastguard WorkerThen the regular ART testing routine should be performed; the regular "lunch"
55*795d594fSAndroid Build Coastguard Workertarget ("armv8" and other targets, not "fvp-eng").
56*795d594fSAndroid Build Coastguard Worker
57*795d594fSAndroid Build Coastguard Worker```
58*795d594fSAndroid Build Coastguard Worker# Config the test run for QEMU/FVP.
59*795d594fSAndroid Build Coastguard Workerexport ART_TEST_RUN_ON_ARM_FVP=true
60*795d594fSAndroid Build Coastguard Worker
61*795d594fSAndroid Build Coastguard Worker# Build, sync ART tests to the model and run, see test/README.chroot.md.
62*795d594fSAndroid Build Coastguard Worker```
63*795d594fSAndroid Build Coastguard Worker
64*795d594fSAndroid Build Coastguard WorkerNote: ART scripts only support one adb device at a time. If you have other adb devices
65*795d594fSAndroid Build Coastguard Workerconnected, use `export ANDROID_SERIAL=localhost:5555` to run scripts on QEMU/FVP."
66