You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add new scripts to build and run unit tests and check version changes in git commits (ARM-software#137)
* Adds requirements.txt file
* Creates a new bash script to download dependencies and build/run unit
tests
* Creates a new bash script to check Date and Revision changes in git
commits
Change-Id: I163f98516778bf2bec58dbd0614e91d348437acc
Signed-off-by: Ryan O'Shea <[email protected]>
Copy file name to clipboardExpand all lines: Tests/UnitTest/README.md
+25-20Lines changed: 25 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,17 @@ Unit test CMSIS-NN functions on any [Arm Mbed OS](https://os.mbed.com/mbed-os/)
4
4
5
5
The [Unity test framework](http://www.throwtheswitch.org/unity) is used for running the actual unit tests.
6
6
7
+
For a quick setup, it is reccomended to the helper script targetting the Arm Corstone-300 softwware. See the section " Using FVP based on Arm Corstone-300 software ".
8
+
7
9
## Requirements
8
10
11
+
The following apt packages are required. Replace python venv version with your python version.
Python packages mbed-cli and and mbed-ls are command line tools so it should not matter if those are installed under Python2 or Python3. These packages have been tested for Python2, with the following versions: mbed-ls(1.7.9) and mbed-cli(1.10.1). They have also been tested for Python3, with the following versions: mbed-ls(1.7.12) and mbed-cli(1.10.5). Package mercurial is needed for package mbed-cli.
30
-
31
-
### Generating new test data
32
-
33
-
For generating new test data, the following packages are needed.
26
+
After upgrading pip, the requirements file found in Tests/UnitTests can be installed. This contains all
27
+
python modules required to run all of the scripts. This will install tensorflow and keras to allow the use of
28
+
the generate_test_data.py script. If you have version specific requirements, it is reccomended to install this
For generating new data, the python3 packages tensorflow, numpy and packaging are required. Most unit tests use a Keras generated model for reference. The SVDF unit test use a json template as input for generating a model. To do so flatc compiler is needed and it requires a schema file.
41
-
42
35
#### Get flatc and schema
43
36
44
37
Note this is only needed for generating SVDF unit tests.
@@ -77,6 +70,18 @@ Use the -h flag to get more info.
77
70
78
71
### Using FVP based on Arm Corstone-300 software
79
72
73
+
The easiest way to run the unit tests on Corstone-300 is to use the build_and_run_tests.sh script. This script will install required packages, build unit tests and run unit tests. This script has been designed for Linux hosts with both aarch64 and x86_64 architectures. For more help use the '-h' flag on the script.
By default the script will download and target gcc. To use arm compiler ensure that arm compilers folder is located in path, export CC and use the -a option on the script.
80
+
81
+
Downloaded dependencies including python venv can be found in Tests/UnitTests/downloads. Test elfs can be found in Tests/UnitTests/build-($cpu) directories.
82
+
83
+
Otherwise, you can build it manually:
84
+
80
85
The build for unit tests differs from the build of CMSIS-NN as a [standalone library](https://github.com/ARM-software/CMSIS-NN/blob/main/README.md#building-cmsis-nn-as-a-library) in that, there is a dependency to [CMSIS](https://github.com/ARM-software/CMSIS_5) project for the startup files from CMSIS-Core. This is specified by the mandatory CMSIS_PATH CMake argument.
0 commit comments