Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on Neon tests for future github action #185

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 96 additions & 0 deletions .github/workflows/runneontest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: Neon Compile and Run
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]

permissions:
actions: read
security-events: write

jobs:
CI_test_run:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install system packages
run: |
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install libpython3.9 libtinfo5
sudo apt install build-essential
sudo apt install gcc-11-aarch64-linux-gnu

- name: Activate vcpkg
uses: ARM-software/cmsis-actions/vcpkg@v1
with:
config: "./vcpkg-neon-configuration.json"

- name: Prepare framework
run: |
cd Testing
echo "Create missing folders"
mkdir FullBenchmark
mkdir Output
mkdir GeneratedInclude
mkdir GeneratedSource
mkdir GeneratedIncludeBench
mkdir GeneratedSourceBench
mkdir build

echo "Install missing python packages"
pip install -r requirements.txt

echo "Preprocess test description"
python preprocess.py -f desc.txt -o Output.pickle
python preprocess.py -f desc_f16.txt -o Output_f16.pickle

echo "Generate missing CPP headers"
python processTests.py -gen . -p Patterns -d Parameters -f Output.pickle -e
python processTests.py -gen . -p Patterns -d Parameters -f Output_f16.pickle -e


- name: Execute
run: |
cd Testing/build
echo "Running tests"

cmake ..

python ../processTests.py -p ../Patterns -d ../Parameters -gen .. -e -f ../Output.pickle
make
./test > result.txt
python ../processResult.py -e -f ../Output.pickle -r result.txt -html > result.html

python ../processTests.py -p ../Patterns -d ../Parameters -gen .. -e -f ../Output_f16.pickle
make
./test > result_f16.txt
python ../processResult.py -e -f ../Output_f16.pickle -r result_f16.txt -html > result_f16.html


- name: Upload test report
uses: actions/upload-artifact@v4
with:
name: neon-test-report
path: |
Testing/build/result.html
Testing/build/result_f16.html


- name: Check error
run: |
cd Testing/build

echo "Checking output..."
test "$(grep "FAILED" result.html | wc -l)" -eq 0
test "$(grep "FAILED" result_f16.html | wc -l)" -eq 0

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ This repository contains the CMSIS-DSP library and several other projects:

* Test framework for bare metal Cortex-M or Cortex-A
* Examples for bare metal Cortex-M
* ComputeGraph
* PythonWrapper

You don't need any of the other projects to build and use CMSIS-DSP library. Building the other projects may require installation of other libraries (CMSIS), other tools (Arm Virtual Hardware) or CMSIS build tools.
Expand Down
2 changes: 2 additions & 0 deletions Source/FilteringFunctions/Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_correlate_opt_q7.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_correlate_q15.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_correlate_q31.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_correlate_q7.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_f64.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_f32.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_fast_q15.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_fast_q31.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_init_f64.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_init_f32.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_init_q15.c)
target_sources(CMSISDSP PRIVATE FilteringFunctions/arm_fir_decimate_init_q31.c)
Expand Down
4 changes: 3 additions & 1 deletion Source/FilteringFunctions/arm_biquad_cascade_df2T_f32.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ ARM_DSP_ATTRIBUTE void arm_biquad_cascade_df2T_f32(
while (stage > 0U);
}
#else
#if defined(ARM_MATH_NEON)
/* The Neon version is not passing the test so is disabled
until the problem is corrected. Issue #186 */
#if 0 //defined(ARM_MATH_NEON)

ARM_DSP_ATTRIBUTE void arm_biquad_cascade_df2T_f32(
const arm_biquad_cascade_df2T_instance_f32 * S,
Expand Down
165 changes: 165 additions & 0 deletions Testing/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
cmake_minimum_required(VERSION 3.23)

include(CMakePrintHelpers)

set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED True)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

project(Tests)

option(HOST "" ON)
option(NEON "" ON)
option(NEONEXPERIMENTAL "" ON)
#option(DISABLEFLOAT16 "" ON)
add_subdirectory(../Source bin_dsp)


add_executable(test main.cpp
patterndata.c
testmain.cpp
FrameworkSource/ArrayMemory.cpp
FrameworkSource/Calibrate.cpp
FrameworkSource/Error.cpp
FrameworkSource/FPGA.cpp
FrameworkSource/Generators.cpp
FrameworkSource/IORunner.cpp
FrameworkSource/Pattern.cpp
FrameworkSource/PatternMgr.cpp
FrameworkSource/Test.cpp
FrameworkSource/Timing.cpp
GeneratedSource/TestDesc.cpp
Source/Tests/BasicTestsF16.cpp
Source/Tests/BasicTestsF32.cpp
Source/Tests/BasicTestsF64.cpp
Source/Tests/BasicTestsQ7.cpp
Source/Tests/BasicTestsQ15.cpp
Source/Tests/BasicTestsQ31.cpp
Source/Tests/BayesF16.cpp
Source/Tests/BayesF32.cpp
Source/Tests/BinaryTestsF16.cpp
Source/Tests/BinaryTestsF32.cpp
Source/Tests/BinaryTestsF64.cpp
Source/Tests/BinaryTestsQ7.cpp
Source/Tests/BinaryTestsQ15.cpp
Source/Tests/BinaryTestsQ31.cpp
Source/Tests/BIQUADF16.cpp
Source/Tests/BIQUADF32.cpp
Source/Tests/BIQUADF64.cpp
Source/Tests/BIQUADQ15.cpp
Source/Tests/BIQUADQ31.cpp
Source/Tests/ComplexTestsF16.cpp
Source/Tests/ComplexTestsF32.cpp
Source/Tests/ComplexTestsF64.cpp
Source/Tests/ComplexTestsQ15.cpp
Source/Tests/ComplexTestsQ31.cpp
Source/Tests/DECIMF64.cpp
Source/Tests/DECIMF32.cpp
Source/Tests/DECIMQ15.cpp
Source/Tests/DECIMQ31.cpp
Source/Tests/DistanceTestsF16.cpp
Source/Tests/DistanceTestsF32.cpp
Source/Tests/DistanceTestsF64.cpp
Source/Tests/DistanceTestsU32.cpp
Source/Tests/ExampleCategoryF32.cpp
Source/Tests/ExampleCategoryQ7.cpp
Source/Tests/ExampleCategoryQ15.cpp
Source/Tests/ExampleCategoryQ31.cpp
Source/Tests/FastMathF16.cpp
Source/Tests/FastMathF32.cpp
Source/Tests/FastMathF64.cpp
Source/Tests/FastMathQ15.cpp
Source/Tests/FastMathQ31.cpp
Source/Tests/FastMathQ63.cpp
Source/Tests/FIRF16.cpp
Source/Tests/FIRF32.cpp
Source/Tests/FIRF64.cpp
Source/Tests/FIRQ7.cpp
Source/Tests/FIRQ15.cpp
Source/Tests/FIRQ31.cpp
Source/Tests/InterpolationTestsF16.cpp
Source/Tests/InterpolationTestsF32.cpp
Source/Tests/InterpolationTestsQ7.cpp
Source/Tests/InterpolationTestsQ15.cpp
Source/Tests/InterpolationTestsQ31.cpp
Source/Tests/mfccdata.c
Source/Tests/mfccdata_f16.c
Source/Tests/MFCCF16.cpp
Source/Tests/MFCCF32.cpp
Source/Tests/MFCCQ15.cpp
Source/Tests/MFCCQ31.cpp
Source/Tests/MISCF16.cpp
Source/Tests/MISCF32.cpp
Source/Tests/MISCF64.cpp
Source/Tests/MISCQ7.cpp
Source/Tests/MISCQ15.cpp
Source/Tests/MISCQ31.cpp
Source/Tests/QuaternionTestsF32.cpp
Source/Tests/StatsTestsF16.cpp
Source/Tests/StatsTestsF32.cpp
Source/Tests/StatsTestsF64.cpp
Source/Tests/StatsTestsQ7.cpp
Source/Tests/StatsTestsQ15.cpp
Source/Tests/StatsTestsQ31.cpp
Source/Tests/SupportBarTestsF16.cpp
Source/Tests/SupportBarTestsF32.cpp
Source/Tests/SupportTestsF16.cpp
Source/Tests/SupportTestsF32.cpp
Source/Tests/SupportTestsF64.cpp
Source/Tests/SupportTestsQ7.cpp
Source/Tests/SupportTestsQ15.cpp
Source/Tests/SupportTestsQ31.cpp
Source/Tests/SVMF16.cpp
Source/Tests/SVMF32.cpp
Source/Tests/TransformCF16.cpp
Source/Tests/TransformCF32.cpp
Source/Tests/TransformCF64.cpp
Source/Tests/TransformCQ15.cpp
Source/Tests/TransformCQ31.cpp
Source/Tests/TransformRF16.cpp
Source/Tests/TransformRF32.cpp
Source/Tests/TransformRF64.cpp
Source/Tests/TransformRQ15.cpp
Source/Tests/TransformRQ31.cpp
Source/Tests/UnaryTestsF16.cpp
Source/Tests/UnaryTestsF32.cpp
Source/Tests/UnaryTestsF64.cpp
Source/Tests/UnaryTestsQ7.cpp
Source/Tests/UnaryTestsQ15.cpp
Source/Tests/UnaryTestsQ31.cpp
Source/Tests/WindowTestsF32.cpp
Source/Tests/WindowTestsF64.cpp
)

target_include_directories(test PUBLIC FrameworkInclude
GeneratedInclude
PrivateInclude
Include/Tests)

target_compile_definitions(test PUBLIC EMBEDDED NOTIMING)

target_compile_options(test PUBLIC -Wsign-compare
-Wdouble-promotion
-DNDEBUG
-Wall
-Wextra
-Werror
-Ofast
-ffast-math
-Wno-packed
-Wno-missing-variable-declarations
-Wno-missing-prototypes
-Wno-missing-noreturn
-Wno-sign-conversion
-Wno-nonportable-include-path
-Wno-reserved-id-macro
-Wno-unused-macros
-Wno-documentation-unknown-command
-Wno-documentation
-Wno-parentheses-equality
-Wno-reserved-identifier
-ffunction-sections)

target_link_libraries(test PUBLIC CMSISDSP)
21 changes: 18 additions & 3 deletions Testing/FrameworkInclude/Error.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ namespace Client {

using namespace std;



template <typename T>
void assert_equal(unsigned long nb,T pa, T pb)
{
Expand All @@ -179,6 +181,13 @@ void assert_equal(unsigned long nb,T pa, T pb)

};

#if defined(ARM_FLOAT16_SUPPORTED)

template<>
void assert_equal(unsigned long nb,float16_t pa, float16_t pb);

#endif

template <typename T>
void assert_equal_partial(unsigned long nb,unsigned long nbSamples,AnyPattern<T> &pa, AnyPattern<T> &pb)
{
Expand Down Expand Up @@ -209,7 +218,7 @@ void assert_equal_partial(unsigned long nb,unsigned long nbSamples,AnyPattern<T>
}
catch(Error &err)
{
sprintf(id," (nb=%lu)",i);
snprintf(id,40," (nb=%lu)",i);
strcat(err.details,id);
throw(err);
}
Expand Down Expand Up @@ -241,7 +250,7 @@ void assert_equal(unsigned long nb,AnyPattern<T> &pa, AnyPattern<T> &pb)
}
catch(Error &err)
{
sprintf(id," (nb=%lu)",i);
snprintf(id,40," (nb=%lu)",i);
strcat(err.details,id);
throw(err);
}
Expand All @@ -257,6 +266,12 @@ void assert_near_equal(unsigned long nb,T pa, T pb, T threshold)
}
};

#if defined(ARM_FLOAT16_SUPPORTED)
template <>
void assert_near_equal(unsigned long nb,float16_t pa, float16_t pb, float16_t threshold);

#endif

template <>
void assert_near_equal(unsigned long nb,double pa, double pb, double threshold);
template <>
Expand Down Expand Up @@ -297,7 +312,7 @@ void assert_near_equal(unsigned long nb,AnyPattern<T> &pa, AnyPattern<T> &pb, T
}
catch(Error &err)
{
sprintf(id," (nb=%lu)",i);
snprintf(id,40," (nb=%lu)",i);
strcat(err.details,id);
throw(err);
}
Expand Down
6 changes: 3 additions & 3 deletions Testing/FrameworkInclude/FPGA.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ FPGA driver. Used to read a C array describing how to drive the test.
class FPGA:public IO
{
public:
FPGA(const char *testDesc,const char *patterns);
FPGA(const unsigned char *testDesc,const char *patterns);
~FPGA();
virtual void ReadIdentification();
virtual void ReadTestIdentification();
Expand Down Expand Up @@ -110,7 +110,7 @@ FPGA driver. Used to read a C array describing how to drive the test.
void readChar(char *);

// Driver array
const char *m_testDesc;
const unsigned char *m_testDesc;

// Pattern array
const char *m_patterns;
Expand All @@ -119,7 +119,7 @@ FPGA driver. Used to read a C array describing how to drive the test.
//char *m_parameters;

// Current position in the driver array
const char *currentDesc;
const unsigned char *currentDesc;
int currentKind;
Testing::testID_t currentId;
// Current param ID for the node
Expand Down
Loading
Loading