Skip to content

Commit a2efa1f

Browse files
authored
Merge branch 'ArmDeveloperEcosystem:main' into main
2 parents 3e61912 + a382152 commit a2efa1f

File tree

6 files changed

+230
-48
lines changed

6 files changed

+230
-48
lines changed

content/learning-paths/laptops-and-desktops/windowsperf_wpa_plugin/windowsperf_wpa_plugin.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You can save a `.json` output from WindowsPerf by using the `--output` command f
2626
To create a file named `example.json`, run the following command:
2727

2828
```console
29-
wperf stat -e ld_spec --output example.json
29+
wperf stat -e ld_spec --timeout 5 --json --output example.json
3030
```
3131

3232
2. Open Windows Performance Analyzer, and see the following window:
@@ -54,9 +54,11 @@ You can use WPA to visualize PMU events in the recorded data.
5454
To try the timeline feature, run the command:
5555

5656
```command
57-
wperf stat -m dcache -c 0,1,2,3,4,5,6,7 -t -i 0 -n 50 --json
57+
wperf stat -m dcache -c 0,1,2,3,4,5,6,7 -t -i 0 -n 10 --timeout 2 --json --output example2.json
5858
```
5959

60+
Note: above command will run for ~20 seconds.
61+
6062
Open the generated output (`.json` file) in WPA to see the graph:
6163

6264
![timeline-by-core #center](figures/timeline-by-core.png)
@@ -72,9 +74,11 @@ To see all the generated graphs you can expand the `Counting timeline` section i
7274
Run another `wperf` command with different options:
7375

7476
```console
75-
wperf stat -t -i 0 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --json
77+
wperf stat -t -i 0 -n 10 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --timeout 2 --json --output --example3.json
7678
```
7779

80+
Note: above command will run for ~20 seconds.
81+
7882
The graph after opening the `.json` file is shown below:
7983

8084
![timeline-events-by-key #center](figures/timeline-events-by-key.png)
@@ -88,9 +92,11 @@ The WPA Plugin also provides visualization of [Arm telemetry metrics](https://de
8892
To visualize telemetry, run the following command:
8993

9094
```console
91-
wperf stat -t -i 0 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --json
95+
wperf stat -t -i 0 -n 10 -m imix,l1d_cache_miss_ratio,l1d_cache_mpki,l1d_tlb_miss_ratio,l1d_tlb_mpki -e inst_spec,vfp_spec,ld_spec,st_spec -c 1 --timeout 2 --json --output example4.json
9296
```
9397

98+
Note: above command will run for ~20 seconds.
99+
94100
You can also see the telemetry timeline graphs under the graph explorer level in WPA.
95101

96102
These graphs are generated dynamically so only the relevant metrics for the given `.json` output file are visible.
@@ -101,4 +107,4 @@ Once expanded, a more in-depth view is visible under the Analysis tab of WPA.
101107

102108
![telemetry-table #center](figures/telemetry-table.png)
103109

104-
You now have a basic understanding of how to use `wperf` generated data in the Windows Performance Analyzer.
110+
You now have a basic understanding of how to use `wperf` generated data in the Windows Performance Analyzer.

content/learning-paths/microcontrollers/mlek/_index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
title: Build and run the Arm Machine Learning Evaluation Kit examples
33

4-
minutes_to_complete: 30
4+
minutes_to_complete: 30
55

66
who_is_this_for: This is an introductory topic for embedded software developers interested in learning about machine learning.
77

8-
learning_objectives:
8+
learning_objectives:
99
- Build examples from Machine Learning Evaluation Kit (MLEK)
10-
- Run the examples on Corstone-300 FVP or Virtual Hardware
10+
- Run the examples on Corstone-320 FVP or Virtual Hardware
1111

1212
prerequisites:
1313
- Some familiarity with embedded programming

content/learning-paths/microcontrollers/mlek/build.md

Lines changed: 93 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,138 @@ weight: 2 # 1 is first, 2 is second, etc.
77
# Do not modify these elements
88
layout: "learningpathall"
99
---
10-
The [Arm ML Evaluation Kit (MLEK)](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit) provides a number of ready-to-use ML applications. These allow you to investigate the embedded software stack and evaluate performance on the Cortex-M55 and Ethos-U55 processors.
10+
The [Arm ML Evaluation Kit (MLEK)](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit) provides a number of ready-to-use ML applications. These allow you to investigate the embedded software stack and evaluate performance on the Cortex-M55 and Ethos-U85 processors.
1111

12-
You can use the MLEK source code to build sample applications and run them on the [Corstone reference systems](https://www.arm.com/products/silicon-ip-subsystems/), for example the [Corstone-300](https://developer.arm.com/Processors/Corstone-300) Fixed Virtual Platform (FVP).
12+
You can use the MLEK source code to build sample applications and run them on the [Corstone reference systems](https://www.arm.com/products/silicon-ip-subsystems/), for example the [Corstone-320](https://developer.arm.com/Processors/Corstone-320) Fixed Virtual Platform (FVP).
1313

1414
## Before you begin
1515

1616
You can use your own Ubuntu Linux host machine or use [Arm Virtual Hardware (AVH)](https://www.arm.com/products/development-tools/simulation/virtual-hardware) for this Learning Path.
1717

18-
The Ubuntu version should be 20.04 or 22.04. The `x86_64` architecture must be used because the Corstone-300 FVP is not currently available for the Arm architecture. You will need a Linux desktop to run the FVP because it opens graphical windows for input and output from the software applications.
18+
The Ubuntu version should be 20.04 or 22.04. These instructions have been tested on the `x86_64` architecture. You will need a way to interact visually with your machine to run the FVP, because it opens graphical windows for input and output from the software applications.
1919

2020
If you want to use Arm Virtual Hardware the [Arm Virtual Hardware install guide](/install-guides/avh#corstone) provides setup instructions.
2121

22-
### Compilers
22+
## Build the example application
2323

24-
The examples can be built with [Arm Compiler for Embedded](https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded) or [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain).
24+
### Install the dependencies
2525

26-
Use the install guides to install the compilers on your computer:
27-
- [Arm Compiler for Embedded](/install-guides/armclang/)
28-
- [Arm GNU Toolchain](/install-guides/gcc/arm-gnu)
26+
Run the following commands to install some necessary tools.
2927

30-
Both compilers are pre-installed in Arm Virtual Hardware.
28+
```bash
29+
sudo apt update
30+
sudo apt install unzip python3-venv python3-pip -y
31+
```
32+
### Install the compiler
3133

32-
### Corstone-300 FVP {#fvp}
34+
The examples can be built with [Arm Compiler for Embedded](https://developer.arm.com/Tools%20and%20Software/Arm%20Compiler%20for%20Embedded) or [Arm GNU Toolchain](https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain).
3335

34-
To install the Corstone-300 FVP on your computer refer to the [install guide for Arm Ecosystem FVPs](/install-guides/fm_fvp).
36+
Install the GNU toolchain (`gcc`).
3537

36-
The Corstone-300 FVP is pre-installed in Arm Virtual Hardware.
38+
```bash
39+
wget https://developer.arm.com/-/media/Files/downloads/gnu/13.3.rel1/binrel/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
3740

38-
## Clone the repository
41+
tar -xf arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi.tar.xz
3942

40-
1. Install `virtualenv` to create Python virtual environments:
43+
export PATH=~/arm-gnu-toolchain-13.3.rel1-x86_64-arm-none-eabi/bin/:$PATH
4144

42-
```console
43-
sudo apt update
44-
sudo apt install python3-venv -y
4545
```
4646

47-
2. Clone the ML Evaluation Kit repository, and navigate into the new directory:
47+
{{% notice Tip %}}
48+
You can review the installation guides for further details.
4849

49-
```console
50+
- [Arm Compiler for Embedded](/install-guides/armclang/)
51+
- [Arm GNU Toolchain](/install-guides/gcc/arm-gnu)
52+
53+
{{% /notice %}}
54+
55+
56+
Both compilers are pre-installed in Arm Virtual Hardware.
57+
58+
### Clone the repository
59+
60+
Clone the ML Evaluation Kit repository, and navigate into the new directory:
61+
62+
```bash
5063
git clone "https://review.mlplatform.org/ml/ethos-u/ml-embedded-evaluation-kit"
5164
cd ml-embedded-evaluation-kit
5265
git submodule update --init
5366
```
5467

55-
## Build the example applications
68+
### Run the build sscript
69+
70+
The default build is Ethos-U55 and Corstone-300. The default build for Ethos-U85 is Corstone-320. Use the `npu-config-name` flag to set Ethos-U85.
5671

57-
The default compiler is `gcc`, but `armclang` can also be used.
72+
The default compiler is `gcc`, but `armclang` can also be used. Number after `ethos-u85-*` is number of MACs, 128-2048 (2^n).
5873

5974
You can select either compiler to build applications. You can also try them both and compare the results.
6075

6176
- Build with Arm GNU Toolchain (`gcc`)
6277

6378
```
64-
./build_default.py
79+
./build_default.py --npu-config-name ethos-u85-256 --toolchain gnu
6580
```
6681

6782
- Build with Arm Compiler for Embedded (`armclang`)
6883

6984
```console
70-
./build_default.py --toolchain arm
85+
./build_default.py --npu-config-name ethos-u85-256 --toolchain arm
7186
```
7287

7388
The build will take a few minutes.
7489

75-
When the build is complete, you will find the example images (`.axf` files) in the `cmake-build-*/bin` directory. The `cmake-build` directory names are specific to the compiler used and Ethos-U55 configuration.
90+
When the build is complete, you will find the examples (`.axf` files) in the `cmake-build-*/bin` directory. The `cmake-build` directory names are specific to the compiler used and Ethos-U85 configuration. Verify that the files have been created by observing the output of the `ls` command
91+
92+
```bash
93+
ls cmake-build-mps4-sse-320-ethos-u85-256-gnu/bin/
94+
```
95+
96+
The next step is to install the FVP and run it with these example audio clips.
97+
98+
99+
## Corstone-320 FVP {#fvp}
100+
101+
This section describes installation of the Corstone-320 to run on your local machine. If you are using Arm Virtual Hardware, that comes with the Corstone-300 FVP pre-installed, and you can move on to the next section. You can review Arm's full FVP offer and general installation steps in the [Fast Model and Fixed Virtual Platform](/install-guides/fm_fvp) install guides.
102+
103+
{{% notice Note %}}
104+
The rest of the steps for the Corstone-320 need to be run in a new terminal window.
105+
{{% /notice %}}
106+
107+
Open a **new terminal window** and download the Corstone-320 archive.
108+
109+
```bash
110+
cd $HOME
111+
wget https://developer.arm.com/-/cdn-downloads/permalink/FVPs-Corstone-IoT/Corstone-320/FVP_Corstone_SSE-320_11.27_25_Linux64.tgz
112+
```
113+
114+
Unpack it with `tar`, run the setup script and export the binary paths to the `PATH` environment variable.
115+
116+
```bash
117+
tar -xf FVP_Corstone_SSE-320_11.27_25_Linux64.tgz
118+
./FVP_Corstone_SSE-320.sh --i-agree-to-the-contained-eula --no-interactive -q
119+
export PATH=$HOME/FVP_Corstone_SSE-320/models/Linux64_GCC-9.3:$PATH
120+
```
121+
122+
The FVP requires an additional dependency, `libpython3.9.so.1.0`, which can be installed using a script. Note that this will tinkle with the python installation for the current terminal window, so make sure to open a new one for the next step.
123+
124+
```bash
125+
source $HOME/FVP_Corstone_SSE-320/scripts/runtime.sh
126+
```
127+
128+
Verify that the FVP was successfully installed by comparing your output from below command.
129+
130+
```bash
131+
FVP_Corstone_SSE-320
132+
```
133+
134+
```output
135+
telnetterminal0: Listening for serial connection on port 5000
136+
telnetterminal1: Listening for serial connection on port 5001
137+
telnetterminal2: Listening for serial connection on port 5002
138+
telnetterminal5: Listening for serial connection on port 5003
139+
140+
```
141+
142+
143+
Now you are ready to test the application with the FVP.
144+
Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# User change
3-
title: "Run the examples on Corstone-300 FVP"
3+
title: "Run the examples on the FVP"
44

55
weight: 3 # 1 is first, 2 is second, etc.
66

@@ -9,35 +9,56 @@ layout: "learningpathall"
99
---
1010
## Run an example
1111

12-
To run an example on the Corstone-300 FVP target, launch the FVP executable with `-a` to specify the software application.
12+
Now you are ready to combine the FVP installation and the example application. Navigate to the evaluation kit repository.
1313

14-
To run the key word spotting example `ethos-u-kws.axf` compiled with `gcc` use:
14+
```bash
15+
cd ml-embedded-evaluation-kit/
16+
```
17+
18+
To run an example on the Corstone-320 FVP target, launch the FVP executable with `-a` to specify the software application.
19+
20+
To run the key word spotting example `ethos-u-kws.axf` compiled with `gcc` use one of the two options below.
1521

16-
- on your computer with the FVP installed
22+
## Option 1: On your computer with the FVP installed
23+
24+
Run the FVP.
1725

1826
```console
19-
FVP_Corstone_SSE-300_Ethos-U55 -a cmake-build-mps3-sse-300-ethos-u55-128-gnu/bin/ethos-u-kws.axf
27+
FVP_Corstone_SSE-320 \
28+
-C mps4_board.subsystem.ethosu.num_macs=256 \
29+
-C mps4_board.visualisation.disable-visualisation=1 \
30+
-C vis_hdlcd.disable_visualisation=1 \
31+
-a cmake-build-mps4-sse-320-ethos-u85-256-gnu/bin/ethos-u-kws.axf
2032
```
2133

22-
- on Arm Virtual Hardware
34+
{{% notice Note %}}
35+
The number of NPU MACs specified in the build MUST match the number specified in the FVP. Else an error similar to the below will be emitted.
36+
37+
```
38+
E: NPU config mismatch. npu.macs_per_cc=E: NPU config mismatch..
39+
```
40+
{{% /notice %}}
41+
42+
## Option 2: On Arm Virtual Hardware
2343

2444
```console
2545
VHT_Corstone_SSE-300_Ethos-U55 -a cmake-build-mps3-sse-300-ethos-u55-128-gnu/bin/ethos-u-kws.axf
2646
```
2747
When the example is running, a telnet instance will open allowing you to interact with the example.
2848

2949
{{% notice Note %}}
30-
It may take some time to initialize the terminal, please be patient.
50+
It may take some time to initialize the terminal, please be patient.
3151

3252
If you see warnings regarding loading the image, these can likely be ignored.
3353
{{% /notice %}}
3454

55+
## Interact with the application
3556

3657
Use the menu to control the application. For the key word spotting application enter 1 to classify the next audio clip.
3758

3859
![terminal #center](term.png)
3960

40-
The results of the classification will appear in the visualization window of the FVP.
61+
The results of the classification will appear in the visualization window of the FVP.
4162

4263
The display shows a 98% chance of the audio clips sound was down.
4364

@@ -56,23 +77,23 @@ You can specify additional parameters to configure certain aspects of the simula
5677
List the available parameters by running the FVP executable with the `--list-params` option, for example:
5778

5879
```console
59-
FVP_Corstone_SSE-300_Ethos-U55 --list-params > parameters.txt
80+
FVP_Corstone_SSE-320 --list-params > parameters.txt
6081
```
6182

6283
{{% notice Note %}}
6384
If you are running with Arm Virtual Hardware substitute `VHT_Corstone_SSE-300_Ethos-U55` as the executable name.
6485
{{% /notice %}}
6586

66-
Open the file `parameters.txt` to see all of the possible parameters and the default values.
87+
Open the file `parameters.txt` to see all of the possible parameters and the default values.
6788

6889
### Set parameters
6990

70-
Individual parameters can be set with the `-C` command option.
91+
Individual parameters can be set with the `-C` command option.
7192

7293
For example, to put the Ethos-U component into fast execution mode:
7394

7495
```console
75-
FVP_Corstone_SSE-300_Ethos-U55 -a cmake-build-mps3-sse-300-ethos-u55-128-gnu/bin/ethos-u-kws.axf -C ethosu.extra_args="--fast"
96+
FVP_Corstone_SSE-320 -a cmake-build-mps4-sse-320-ethos-u85-256-gnu/bin/ethos-u-kws.axf -C mps4_board.subsystem.ethosu.extra_args="--fast"
7697
```
7798
{{% notice Note %}}
7899
Do not use fast execution mode whilst benchmarking performance.
@@ -83,14 +104,16 @@ To set multiple parameters it may be easier to list them in a text file (without
83104
For example, use a text editor to create a file named `options.txt` with the contents:
84105

85106
```console
86-
mps3_board.visualisation.disable-visualisation=1
87-
ethosu.extra_args="--fast"
107+
mps4_board.visualisation.disable-visualisation=1
108+
mps4_board.subsystem.ethosu.extra_args="--fast"
88109
```
89110

90111
Run the FVP with the `-f` option and the `options.txt` file:
91112

92113
```console
93-
FVP_Corstone_SSE-300_Ethos-U55 -a cmake-build-mps3-sse-300-ethos-u55-128-gnu/bin/ethos-u-kws.axf -f options.txt
114+
FVP_Corstone_SSE-320 -a cmake-build-mps4-sse-320-ethos-u85-256-gnu/bin/ethos-u-kws.axf -f options.txt
94115
```
95116

96117
Full instructions are provided in the evaluation kit [documentation](https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ml-embedded-evaluation-kit/+/HEAD/docs/quick_start.md).
118+
119+
You have now run an example application on an Arm Fixed Virtual Platform.

data/stats_current_test_info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
summary:
2-
content_total: 303
2+
content_total: 305
33
content_with_all_tests_passing: 32
44
content_with_tests_enabled: 34
55
sw_categories:

0 commit comments

Comments
 (0)