Skip to content

Commit

Permalink
Work on Neon tests for future github action
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe0606 committed Jun 24, 2024
1 parent fd088ac commit 742e4bc
Show file tree
Hide file tree
Showing 32 changed files with 352 additions and 151 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ PythonWrapper/build_linux/bin_dsp/
PythonWrapper/build_linux/build.sh
PythonWrapper/build_linux/cmake_install.cmake


PythonWrapper/build_darwin/CMakeCache.txt
PythonWrapper/build_darwin/CMakeFiles/
PythonWrapper/build_darwin/Makefile
PythonWrapper/build_darwin/bin_dsp/
PythonWrapper/build_darwin/build.sh
PythonWrapper/build_darwin/cmake_install.cmake

# Output of the linkchecker tool
linkchecker-out.csv
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
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
3 changes: 3 additions & 0 deletions Testing/FrameworkInclude/Timing.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
#ifndef _TIMING_H_
#define _TIMING_H_

#if !defined(__GNUC_PYTHON__)
#include "RTE_Components.h"
#include CMSIS_device_header
#endif

#include "Test.h"
#include "arm_math_types.h"
Expand All @@ -14,6 +16,7 @@ void cycleMeasurementStop();

Testing::cycles_t getCycles();


#if defined(EXTBENCH) || defined(CACHEANALYSIS)
extern unsigned long sectionCounter;

Expand Down
Loading

0 comments on commit 742e4bc

Please sign in to comment.