diff --git a/PythonWrapper/examples/example_1_5.py b/PythonWrapper/examples/example_1_5.py index 5b4edb9c..15190ae2 100644 --- a/PythonWrapper/examples/example_1_5.py +++ b/PythonWrapper/examples/example_1_5.py @@ -5,6 +5,7 @@ import numpy as np import math import colorama from colorama import init,Fore, Back, Style +from numpy.testing import assert_allclose from numpy.linalg import qr diff --git a/README.md b/README.md index d8f3a42c..e5a7c0bb 100755 --- a/README.md +++ b/README.md @@ -127,7 +127,17 @@ If you want to build the `FFT` example for the `Corstone-300` virtual hardware p `cbuild "fftbin.Release+VHT-Corstone-300.cprj"` +### How to build with Make +There is an example `Makefile` in `Source`. + +In each source folder (like `BasicMathFunctions`), you'll see files with no `_datatype` suffix (like `BasicMathFunctions.c` and `BasicMathFunctionsF16.c`). + +Those files are all you need in your makefile. They are including all other C files from the source folders. + +Then, for the includes you'll need to add the paths: `Include`, `PrivateInclude` and, since there is a dependency to CMSIS Core, `Core/Include` from `CMSIS_5/CMSIS`. + +If you are building for `Cortex-A` and want to use Neon, you'll also need to include `ComputeLibrary/Include` and the source file in `ComputeLibrary/Source`. ### How to build CMSIS-DSP with cmake diff --git a/Source/Makefile b/Source/Makefile new file mode 100644 index 00000000..9c6170e3 --- /dev/null +++ b/Source/Makefile @@ -0,0 +1,76 @@ +# This is an example Makefile to show how to build the library + +COMPILER_ROOT = +CMSIS_ROOT = + +# Compilation tools +CC := $(COMPILER_ROOT)/ARMCompiler6.18/bin/armclang +ARMAR := $(COMPILER_ROOT)/ARMCompiler6.18/bin/armar + +# Compilation flags (here for Cortex-M55) +CFLAGS := -mcpu=cortex-m55 --target=arm-arm-none-eabi \ + -Wsign-compare \ + -Wdouble-promotion \ + -Ofast -ffast-math \ + -DNDEBUG \ + -Wall -Wextra -Werror \ + -fshort-enums -fshort-wchar \ + -mfloat-abi=hard + + +# Path to CMSIS_5 +CMSIS_5 := $(CMSIS_ROOT)/CMSIS_5 + +# Path to CMSIS_DSP +CMSIS_DSP := $(CMSIS_ROOT)/CMSIS-DSP + +# Path to CMSIS Core includes for Cortex-M +# For low end Cortex-A, use Core_A +# For high end Cortex-A (aarch64), don't use CMSIS +# Core Includes (Refer to the CMSIS-DSP README to +# know how to build in that case) +CMSIS_CORE_INCLUDES := $(CMSIS_5)/CMSIS/Core/Include + +# Sources +SRCS := $(CMSIS_DSP)/Source/BasicMathFunctions/BasicMathFunctions.c \ + $(CMSIS_DSP)/Source/CommonTables/CommonTables.c \ + $(CMSIS_DSP)/Source/InterpolationFunctions/InterpolationFunctions.c \ + $(CMSIS_DSP)/Source/BayesFunctions/BayesFunctions.c \ + $(CMSIS_DSP)/Source/MatrixFunctions/MatrixFunctions.c \ + $(CMSIS_DSP)/Source/ComplexMathFunctions/ComplexMathFunctions.c \ + $(CMSIS_DSP)/Source/QuaternionMathFunctions/QuaternionMathFunctions.c \ + $(CMSIS_DSP)/Source/ControllerFunctions/ControllerFunctions.c \ + $(CMSIS_DSP)/Source/SVMFunctions/SVMFunctions.c \ + $(CMSIS_DSP)/Source/DistanceFunctions/DistanceFunctions.c \ + $(CMSIS_DSP)/Source/StatisticsFunctions/StatisticsFunctions.c \ + $(CMSIS_DSP)/Source/FastMathFunctions/FastMathFunctions.c \ + $(CMSIS_DSP)/Source/SupportFunctions/SupportFunctions.c \ + $(CMSIS_DSP)/Source/FilteringFunctions/FilteringFunctions.c \ + $(CMSIS_DSP)/Source/TransformFunctions/TransformFunctions.c + +# Includes +DSP_INCLUDES := $(CMSIS_DSP)/Include \ + $(CMSIS_DSP)/PrivateInclude + +# If Neon and Cortex-A +#DSP_INCLUDES += $(CMSIS_DSP)/ComputeLibrary/Include +#SRCS += $(CMSIS_DSP)/ComputeLibrary/Source/arm_cl_tables.c + +# Compilation flags for include folders +INC_FLAGS := $(addprefix -I,$(DSP_INCLUDES)) +INC_FLAGS += $(addprefix -I,$(CMSIS_CORE_INCLUDES)) +CFLAGS += $(INC_FLAGS) + +# Output folder for build products +BUILDDIR := ./builddir + +OBJECTS := $(SRCS:%=$(BUILDDIR)/%.o) + +# Build rules +$(BUILDDIR)/libCMSISDSP.a: $(OBJECTS) + $(ARMAR) -rc $@ $(OBJECTS) + + +$(BUILDDIR)/%.c.o: %.c + mkdir -p $(dir $@) + $(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@ diff --git a/Testing/README.md b/Testing/README.md index 3e936915..71644f55 100644 --- a/Testing/README.md +++ b/Testing/README.md @@ -316,7 +316,7 @@ We have archived lot of test patterns on github. So this step is needed only if ### Generate the cpp,h and txt files from the desc.txt file First time the project is cloned from github, you'll need to create some missing folders as done -in the script createDefaultFolder.sh +in the script `createDefaultFolder.sh` Those folders are used to contain the files generated by the scripts. @@ -326,7 +326,7 @@ Once those folders have been created. You can use following commands to create t python preprocess.py -f desc.txt -This will create a file Output.pickle which is containing a Python object representing +This will create a file `Output.pickle` which is containing a Python object representing the parsed data structure. It is done because parsing a big test description file is quite slow. So, it is needed to be done only once or if you modify the test description file. @@ -352,10 +352,23 @@ You can add a test ID to specify that you wan to run only a specific test in the python processTests.py -e BasicTests 4 -Before filtering desc.txt by using a C++ class, you should (at least once) parse the full file without filtering. +#### Important: + +The very first time you configure the test framework, you'll need to generate C files for all the tests + +The reason is that the build is not aware of the filtering and will include some source files even if they are not needed for a given test suite. So those files should at least be present to allow the compilation to proceed. They need to be generated at least once. + +To generate all of them the first time, you can do (from `Testing` folder): + +`python preprocess.py -f desc.txt` + +`python preprocess.py -f desc_f16.txt -o Output_f16.pickle` + +`python processTests.py -e` + +`python processTests.py -e -f Output_f16.pickle` + -The reason is that the cmake build is not aware of the filtering and will include some source files which -are not needed when filtered out. So those files should at least be present to allow the compilation to proceed. They need to be generated at least once. ### Building and Running @@ -592,7 +605,7 @@ It is also here that you specify what you want to dump if you're in dump mode. ### Creating and filling the databases -To add a to sqlite3 databse: +To add a to sqlite3 database: python addToDB.py AGroup @@ -660,14 +673,13 @@ In CMSIS-DSP, we want to keep the possibility of having float16_t as an argument As consequences, * the functions using float16_t in the API won't be supported by AC5 compiler. -* The correspondingfloat16_t tests are put in a different test file desc_f16.txt +* The corresponding float16_t tests are put in a different test file desc_f16.txt * Code for those float16_t test is not built when ac5.cmake toolchain is used -* BasicMath cmake has been modified to show hot to avoid including float16 code +* BasicMath cmake has been modified to show how to avoid including float16 code when building with ac5.cmake toolchain In current example, we assume all float16_t code and tests are not supported by AC5 just to show how the cmake must be modified. -When more float16_t code is added to the CMSIS-DSP, this will be refined with a better -separation. + diff --git a/cmsisdsp/__init__.py b/cmsisdsp/__init__.py index 1e4c5bc2..3ce5fe09 100755 --- a/cmsisdsp/__init__.py +++ b/cmsisdsp/__init__.py @@ -23,7 +23,7 @@ cmsis_dsp_version="1.10.2" # CMSIS-DSP Commit hash used to build the wrapper -commit_hash="d9cfca31b66fe837a603ed3520cb6a7947e86ca6" +commit_hash="91f599c052d9790d55210981526e9f607bb85cd2" # True if development version of CMSIS-DSP used # (So several CMSIS-DSP versions may have same version number hence the commit hash) diff --git a/cmsisdsp/version.py b/cmsisdsp/version.py index 5b601886..0f228f25 100755 --- a/cmsisdsp/version.py +++ b/cmsisdsp/version.py @@ -1 +1 @@ -__version__ = "1.5.0" +__version__ = "1.5.1" diff --git a/setup.py b/setup.py index 0d5ae67d..d809712c 100644 --- a/setup.py +++ b/setup.py @@ -270,7 +270,7 @@ def build(): include_package_data=True, author = 'Copyright (C) 2010-2022 ARM Limited or its affiliates. All rights reserved.', author_email = 'christophe.favergeon@arm.com', - url="https://arm-software.github.io/CMSIS_5/DSP/html/index.html", + url="https://github.com/ARM-software/CMSIS-DSP", python_requires='>=3.6', license="License :: OSI Approved :: Apache Software License", platforms=['any'],