From 31ddd4902b45b1de74a10bc104a8d84da9768092 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Tue, 30 Aug 2022 17:58:37 +0100 Subject: [PATCH 01/65] Compile latest tflite micro code --- examples/bare-metal/CMakeLists.txt | 23 +- .../shared_src/external_deps/fetch_deps.cmake | 4 +- examples/bare-metal/vnr_test/CMakeLists.txt | 81 ++ examples/bare-metal/vnr_test/src/main.c | 11 + examples/bare-metal/vnr_test/src/outFile.cpp | 1123 +++++++++++++++++ .../bare-metal/vnr_test/src/outFile.cpp.h | 53 + examples/bare-metal/vnr_test/src/wrapper.cpp | 17 + examples/bare-metal/vnr_test/src/wrapper.h | 13 + examples/bare-metal/vnr_test/src/xtflm_conf.h | 14 + modules/CMakeLists.txt | 13 +- xmos_cmake_toolchain | 2 +- 11 files changed, 1334 insertions(+), 20 deletions(-) create mode 100644 examples/bare-metal/vnr_test/CMakeLists.txt create mode 100644 examples/bare-metal/vnr_test/src/main.c create mode 100644 examples/bare-metal/vnr_test/src/outFile.cpp create mode 100644 examples/bare-metal/vnr_test/src/outFile.cpp.h create mode 100644 examples/bare-metal/vnr_test/src/wrapper.cpp create mode 100644 examples/bare-metal/vnr_test/src/wrapper.h create mode 100644 examples/bare-metal/vnr_test/src/xtflm_conf.h diff --git a/examples/bare-metal/CMakeLists.txt b/examples/bare-metal/CMakeLists.txt index dd9abe248..5c7bb07fb 100644 --- a/examples/bare-metal/CMakeLists.txt +++ b/examples/bare-metal/CMakeLists.txt @@ -1,24 +1,25 @@ set( CONFIG_XSCOPE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/shared_src/etc ) -add_subdirectory( shared_src ) +#add_subdirectory( shared_src ) -add_subdirectory( ic ) +#add_subdirectory( ic ) -add_subdirectory( aec_1_thread ) +#add_subdirectory( aec_1_thread ) -add_subdirectory( agc ) +#add_subdirectory( agc ) -add_subdirectory( pipeline_single_threaded ) +#add_subdirectory( pipeline_single_threaded ) -add_subdirectory( vnr ) +#add_subdirectory( vnr ) ## Multi thread example builds only on XCORE -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) +#if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - add_subdirectory( aec_2_threads ) +# add_subdirectory( aec_2_threads ) - add_subdirectory( pipeline_multi_threaded ) -endif() +# add_subdirectory( pipeline_multi_threaded ) +#endif() -add_subdirectory( pipeline_alt_arch ) +#add_subdirectory( pipeline_alt_arch ) +add_subdirectory(vnr_test) diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index 63fb4d629..6f018b3c7 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -22,7 +22,7 @@ FetchContent_Populate(xscope_fileio) FetchContent_Declare( lib_nn GIT_REPOSITORY https://github.com/xmos/lib_nn.git - GIT_TAG 1a0fce0f20b4bbb95dcc72c381d4e88c7b08c9e5 + GIT_TAG f85b4804ea5f52f5fa4ca4b709a787ac62a8c526 GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_nn ) @@ -31,7 +31,7 @@ FetchContent_Populate(lib_nn) FetchContent_Declare( tflite_micro GIT_REPOSITORY https://github.com/xmos/lib_tflite_micro.git - GIT_TAG c85e3be656bd4e250df7859892afede7aaca81d0 + GIT_TAG a2dccc68bdef57a3b0ed326ea4d815a475feb39e GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro ) diff --git a/examples/bare-metal/vnr_test/CMakeLists.txt b/examples/bare-metal/vnr_test/CMakeLists.txt new file mode 100644 index 000000000..8a101337d --- /dev/null +++ b/examples/bare-metal/vnr_test/CMakeLists.txt @@ -0,0 +1,81 @@ +add_library(tflite_test_lib STATIC) +SET(TOP_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro) +include(${TOP_DIR}/cmakefiles/xtflm.cmake) + +file(GLOB_RECURSE TEST_SOURCES src/*.cpp) +target_sources(tflite_test_lib + PRIVATE + ${TEST_SOURCES} + ${TFLM_KERNEL_SOURCES} + ${TFLITE_SOURCES} + ${NN_SOURCES} + ${XTFLIB_KERNEL_SOURCES} + ) + +if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) + file(GLOB_RECURSE LIB_NN_SOURCES_XCORE_XS3A ${TOP_DIR}/../lib_nn/lib_nn/src/asm/*.S) + set_source_files_properties(LIB_NN_SOURCES_XCORE_XS3A PROPERTIES LANGUAGE ASM) + file(GLOB_RECURSE TFLIB_SOURCES_ASM ${TOP_DIR}/lib_tflite_micro/src/*.S) + set_source_files_properties(TFLIB_SOURCES_ASM PROPERTIES LANGUAGE ASM) + target_sources(tflite_test_lib + PRIVATE + ${LIB_NN_SOURCES_XCORE_XS3A} + ${TFLIB_SOURCES_ASM} + ) +endif() + +target_include_directories(tflite_test_lib + PUBLIC + src + ${ALL_INCLUDES}) + +target_compile_options(tflite_test_lib + PRIVATE + -Os + -g + -mcmodel=large + -Wno-xcore-fptrgroup + ) + +target_compile_definitions(tflite_test_lib + PRIVATE + NO_INTERPRETER + TF_LITE_STATIC_MEMORY=1 + TF_LITE_STRIP_ERROR_STRINGS + __xtflm_conf_h_exists__=1) + +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) + set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) + target_compile_definitions(tflite_test_lib + PRIVATE + NN_USE_REF) +endif() + + +############################## + +add_executable(tflite_test_app) + +target_sources(tflite_test_app + PRIVATE + src/main.c + ) +target_include_directories(tflite_test_app + PRIVATE + src) + +target_link_libraries(tflite_test_app + PUBLIC + tflite_test_lib) + +if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) +target_link_options(tflite_test_app + PRIVATE + -w + "-target=${XCORE_TARGET}" + "-report" + "${CONFIG_XSCOPE_PATH}/config.xscope") +else() +target_link_libraries(tflite_test_app + PRIVATE m) +endif() diff --git a/examples/bare-metal/vnr_test/src/main.c b/examples/bare-metal/vnr_test/src/main.c new file mode 100644 index 000000000..3fed4d9d3 --- /dev/null +++ b/examples/bare-metal/vnr_test/src/main.c @@ -0,0 +1,11 @@ + +#include +#include "wrapper.h" + +int main(int argc, char **argv) { + vnr_init(); + while(1) { + vnr_inference_invoke(); + } + return 0; +} diff --git a/examples/bare-metal/vnr_test/src/outFile.cpp b/examples/bare-metal/vnr_test/src/outFile.cpp new file mode 100644 index 000000000..6fe91e557 --- /dev/null +++ b/examples/bare-metal/vnr_test/src/outFile.cpp @@ -0,0 +1,1123 @@ +// This file is generated. Do not edit. +// Generated on: 30.08.2022 11:36:14 + + +#include "../../api/xcore_config.h" +#include "tensorflow/lite/c/builtin_op_data.h" +#include "tensorflow/lite/c/common.h" +#include "tensorflow/lite/micro/kernels/conv.h" +#include "tensorflow/lite/micro/kernels/fully_connected.h" +#include "tensorflow/lite/micro/kernels/micro_ops.h" +#include "tensorflow/lite/micro/kernels/reduce.h" +#include "tensorflow/lite/micro/kernels/softmax.h" +#include "tensorflow/lite/micro/micro_context.h" + +#if defined __GNUC__ +#define ALIGN(X) __attribute__((aligned(X))) +#elif defined _MSC_VER +#define ALIGN(X) __declspec(align(X)) +#elif defined __TASKING__ +#define ALIGN(X) __align(X) +#endif + +namespace tflite { +namespace ops { +namespace micro { +namespace xcore { +extern TfLiteRegistration *Register_XC_conv2d_v2(void); +} // namespace xcore +} // namespace micro +} // namespace ops +} // namespace tflite + +namespace { + +constexpr int kTensorArenaSize = 1208; +uint8_t tensor_arena[kTensorArenaSize] ALIGN(8); +template struct TfArray { + int sz; T elem[SZ]; +}; +enum used_operators_e { + OP_XC_conv2d_v2, OP_CONV_2D, OP_RESHAPE, OP_LOGISTIC, OP_LAST +}; +struct TensorInfo_t { // subset of TfLiteTensor used for initialization from constant memory + TfLiteType type; + void* data; + TfLiteIntArray* dims; + size_t bytes; + TfLiteQuantization quantization; +}; +struct NodeInfo_t { // subset of TfLiteNode used for initialization from constant memory + struct TfLiteIntArray* inputs; + struct TfLiteIntArray* outputs; + void* builtin_data; + used_operators_e used_op_index; + int custom_initial_data_size; +}; + +TfLiteContext ctx{}; +TfLiteTensor tflTensors[16]; +TfLiteEvalTensor evalTensors[16]; +TfLiteRegistration registrations[OP_LAST]; +TfLiteNode tflNodes[6]; + +const TfArray<4, int> tensor_dimension0 = { 4, { 1,1,4,24 } }; +const TfArray<1, float> quant0_scale = { 1, { 0.11438909918069839, } }; +const TfArray<1, int> quant0_zero = { 1, { 127 } }; +const TfLiteAffineQuantization quant0 = { (TfLiteFloatArray*)&quant0_scale, (TfLiteIntArray*)&quant0_zero, 0 }; +const ALIGN(8) int16_t tensor_data1[64] = { + 15962, 15962, 15962, 15962, 15962, 15962, 15962, 15962, 15962, 15962, + 15962, 15962, 15962, 15962, 15962, 15962, -8861, -13158, -1738, -23446, + -3752, -11320, -7356, -13810, -5228, -4251, -11795, -16622, -12463, -5742, + -12875, -17338, 15962, 15962, 15962, 15962, 15962, 15962, 15962, 15962, + 15962, 15962, 15962, 15962, 15962, 15962, 15962, 15962, -9606, -5211, + -12676, -2966, -15436, -4138, -11894, -7782, -16901, -4613, -12642, -17486, + -4245, -6201, -10535, -3371, +}; +const TfArray<1, int> tensor_dimension1 = { 1, { 64 } }; +const ALIGN(8) int8_t tensor_data2[4096] = { + -1, -88, 1, -3, 2, -2, 3, 0, 7, -9, + 1, -1, 3, 2, 1, -8, -1, -11, 6, -2, + -1, 3, -5, 2, 0, -3, 3, 3, 5, -3, + -5, 3, 3, 0, 6, 3, 1, 4, -4, 9, + 2, 8, 6, 3, -2, -5, 5, 2, 7, 6, + -1, 4, -8, -9, -7, -3, 5, -13, -3, 10, + 8, 1, 6, -4, -6, -2, -2, -5, -1, -5, + 12, -2, 5, -1, -10, -3, 6, 9, -3, -3, + -9, 2, -7, -4, -2, 7, 5, -2, -2, 16, + -13, -1, -10, 2, -5, 11, -5, -1, -5, -3, + -7, -6, 2, -6, 2, -4, -4, -2, 5, 3, + -6, -7, -7, -2, -1, -3, 4, -2, -7, 1, + -2, 10, 4, -3, -3, -4, -2, 3, -3, -9, + 0, -12, -4, -2, 5, -13, 4, -1, -4, -11, + 2, 2, -4, -2, -3, -6, 4, -1, -2, 6, + -3, 2, 1, 1, -7, 1, -1, -1, -50, 6, + 2, 4, -1, 1, 3, 3, -5, 4, -10, 4, + 5, 1, -3, -9, 0, 3, 5, 5, -4, 2, + -127, -2, -6, -3, 2, -11, -4, -2, 2, 4, + 5, -4, -3, 0, 0, -3, -1, -3, 4, -3, + 2, -10, -4, -5, 3, 0, -3, -4, -3, -1, + 5, 0, -2, 2, 3, 3, -4, 9, 4, -2, + -1, -2, -2, 3, -6, -10, 0, -6, 5, -5, + 7, 0, 2, -3, -5, -3, -1, 6, -2, -5, + -3, -9, -17, -5, -1, 9, 2, -1, 2, -6, + 6, 4, 3, -6, -2, 11, 3, 9, -6, 2, + 1, 2, -3, 0, -24, 0, 2, 5, 1, -6, + 5, 0, 2, -1, -4, 2, -95, 3, -5, -5, + 4, -7, -2, -11, 2, 4, 1, -3, 2, -2, + 3, 2, 1, 3, -5, 6, 1, 3, 4, 4, + -5, -2, 7, 5, 3, 2, -6, 4, -5, -1, + -8, -5, 4, -10, -3, 4, 2, 5, 3, -3, + 0, -17, 0, -1, 3, -2, -2, 0, 3, -3, + -1, 1, 2, 1, -1, -2, -2, -1, 1, -3, + 0, 5, 2, 1, -4, 0, -10, 0, -4, -2, + 1, -15, -3, -2, 1, -4, 1, -1, 7, 0, + 1, -3, -4, -3, 3, 1, -4, -1, -4, -12, + 6, -4, -3, 4, 4, 2, -1, 10, 6, -3, + -3, -2, -2, 6, -1, -2, -33, -6, -4, -4, + 7, -8, 0, -2, 0, -4, 3, -1, 3, 0, + -7, 1, -5, -2, 0, 1, 5, 0, 3, -5, + 0, -5, -19, 1, -3, -5, 3, -2, 2, 2, + 3, 4, -6, 3, -1, 4, 3, 4, -3, -7, + 5, 3, 3, 2, -4, 4, -3, -1, -11, -4, + 3, -10, -5, 4, 3, 2, 2, -1, -6, -3, + -4, -7, -4, 0, -2, -6, 6, -3, -4, 2, + 6, 5, -9, -5, -6, 0, -14, -3, -1, 5, + 3, -2, -4, 8, -12, 0, -4, -4, -2, 0, + -4, -1, 2, -5, -2, -7, 7, -2, -8, -5, + -6, -6, 3, 4, -4, -5, -6, 0, 7, -1, + -25, 3, 8, 4, -4, 12, 5, -4, -5, -1, + -3, 7, -2, -26, -1, -2, -1, -2, 3, 0, + 2, -10, 6, -3, 1, 1, -1, -5, -2, -16, + 7, -3, 1, -1, -3, 2, 3, 7, 4, -4, + 1, 1, -2, 5, -1, -13, 1, -4, -3, -2, + -1, -9, 0, -4, -1, -1, -3, 5, 2, -4, + -4, -8, -5, -2, -2, 1, -24, -2, 3, -16, + 1, 2, -5, 2, -7, 7, -4, -2, -1, -4, + 0, -4, 3, 1, 2, 0, -9, -8, 6, 7, + -1, -1, -8, 1, -4, -2, -1, 6, 1, -2, + -2, 12, -7, -1, -1, -1, -3, 6, -2, 1, + -4, -4, -3, -6, 4, -3, 2, -3, -6, 1, + 3, 3, -2, -5, 0, -1, 1, 0, 5, 1, + -9, 1, -5, -1, 3, -1, -3, -4, -1, 0, + 0, -1, -2, -7, -4, -2, 7, -10, 1, -1, + 0, -6, 1, 0, -3, -4, -1, -3, 4, -1, + -1, 6, 1, 1, 3, 3, -1, -1, -7, -2, + -26, 6, 2, -6, 1, 1, 2, 0, -6, 0, + -2, 1, 1, 3, -3, 4, 0, 3, -1, -3, + -6, 2, 0, 1, -6, -3, 5, -8, -4, 1, + 4, 3, -2, 0, -2, 0, -1, -3, -3, -4, + 1, -2, 3, -2, -3, -5, 2, 3, -1, -5, + -1, -3, 6, 0, -1, 2, 4, 2, -4, 7, + 4, 0, -3, -4, 0, 4, -3, -2, -3, -7, + -1, -4, 6, 1, -1, -1, -3, -2, -1, 5, + -4, -4, -3, -8, 1, -4, 3, 7, 8, 0, + -2, 17, 4, -1, 2, -2, -1, 9, 3, 0, + 2, 4, 1, 5, -5, 4, 4, 4, 4, 3, + -1, -4, 0, 4, 2, 5, -4, 4, -3, -3, + -6, -2, 2, -9, -3, 7, 3, 3, 2, -5, + 2, 0, 0, 2, 2, 0, -4, 1, -5, 1, + 2, 2, -5, -1, 3, 1, 3, 1, -5, 2, + -6, 0, -7, -1, 3, -6, -2, -2, 2, 2, + 2, -1, -3, -7, 0, -1, -2, -1, -4, -1, + -1, -3, 2, -1, 1, 0, 1, -3, 0, -2, + -1, -3, 3, 4, -3, 1, 2, 5, -8, -3, + -1, 1, 0, -2, -2, 0, 1, -2, -1, 0, + 3, 0, 2, 0, -4, -6, 2, 3, -1, -3, + -5, -9, 6, 0, -1, 1, 3, 0, -2, 8, + 4, 1, -4, -3, -1, 5, -1, -1, -28, -6, + -2, -3, 5, -5, 0, 0, 0, -2, 2, 0, + 4, -2, -6, 1, -1, -2, 2, 1, 3, 2, + 0, -3, 0, 1, -11, -1, 0, -3, 2, 0, + 1, 3, 3, 1, -4, 3, -2, 2, 1, 5, + -4, -2, 3, 2, 3, 1, -3, 1, -4, -1, + -6, -1, 3, -6, -2, 0, 3, 2, 2, -2, + -4, 0, -3, -2, -4, -1, 5, -6, 3, -1, + -7, -3, 4, 6, -1, -1, -2, 0, -11, 0, + -1, 3, 6, -3, -4, 14, -5, -1, -7, 3, + -2, 7, -1, -1, 1, -4, -2, -6, 3, -4, + -3, -2, -3, -3, 3, 3, -4, -4, -3, -1, + 9, -1, -17, 0, 6, 2, -6, 6, 5, -4, + -4, 0, -2, 6, -2, -21, -1, -3, -5, -3, + 3, 1, 1, -1, 8, -4, 4, 1, 0, -1, + -3, -8, 3, -3, 1, 4, 2, 2, 5, 5, + 4, -3, -1, 2, -1, 1, 2, 2, 1, 4, + 2, 4, -2, 4, 3, 4, 6, 2, -1, -8, + 7, 2, 5, 3, -2, 3, -5, 1, -7, -2, + 4, -6, -2, 4, 5, 4, 1, -5, -2, -1, + -1, -4, 1, -7, 11, 0, -1, 0, -5, -4, + 5, 7, 1, -3, -8, 4, -3, 0, -2, 8, + 3, -2, -4, 12, -6, -2, -4, -1, -1, 4, + -2, 2, -3, -1, -6, -5, 5, -5, 1, -3, + -6, -2, 4, 0, -4, -4, -4, -3, -1, -1, + 2, 0, 4, 0, -3, 9, 2, 1, -4, 0, + -2, 5, -1, -1, 1, -3, 0, 0, 7, -3, + 0, -4, -3, -4, 2, 0, -6, -1, -3, -7, + 5, 1, -1, 3, 0, 1, -2, 17, -6, -4, + -3, -4, -24, 7, 2, -3, 4, 1, 2, 2, + -7, 0, 2, 4, 1, 4, -1, -9, 3, 3, + 3, 1, -5, 2, -5, -1, -6, -3, 3, -8, + -3, 5, 5, 1, 2, -3, -1, 0, 0, -1, + -2, -5, 6, -4, 1, -4, -3, -1, 4, 4, + -3, -3, -1, -3, 4, -2, -2, 1, 1, 1, + -4, 4, 5, -2, 0, -1, -1, 6, -3, -3, + 0, -3, 0, -1, -5, -2, -2, 0, -3, -5, + -1, 4, -4, -2, -4, -3, 0, -1, 1, 5, + 3, 1, 0, -4, 6, 2, -1, 0, 0, 7, + -1, -16, 4, -3, 1, -3, -2, -3, 1, -4, + -5, 3, -2, 5, 0, -3, -3, -5, -8, 0, + -1, 1, -9, -5, 3, -14, -2, 3, -4, 2, + -6, 5, 2, 2, 0, 1, 1, 2, -5, 3, + -20, 4, 3, 5, -2, -17, 0, 2, 4, 5, + -1, 1, -77, -2, -7, -3, 2, -5, -2, -1, + 5, 3, 2, -3, -2, -7, -1, -1, -3, -4, + -4, -1, -1, -3, 2, 0, 0, 1, -2, -1, + 0, -1, -4, -1, 0, 4, -3, 2, -2, 8, + -6, -3, -1, 0, 1, -7, -1, 0, 0, -3, + -3, -1, 7, -1, 3, -2, -4, -2, 2, 3, + -1, -1, -7, -9, 6, -4, -1, 3, 2, 1, + -4, 7, 5, -1, 0, -1, 0, 4, -1, 1, + -20, -5, -3, 0, 2, -6, 2, 0, -3, -3, + 1, 0, 3, -2, -5, 2, -7, -1, 1, -1, + -10, 1, 1, -16, 0, -1, -13, 2, -2, 0, + 2, 0, -1, 2, 3, 2, -4, 4, -9, 1, + 1, 3, 0, 1, 1, 1, 2, 5, -3, 2, + -3, -1, -3, -1, 3, -7, -4, -1, 2, 3, + 2, -1, -2, 0, -4, -4, -2, -2, 1, -4, + 2, 0, -3, -2, 4, 4, -3, -2, -1, 0, + -15, -1, 1, 4, 0, -3, -2, 3, -10, -3, + -5, 0, -1, 7, -2, 1, 1, -4, 0, -4, + 4, -2, -2, -2, -3, -4, 3, 4, -5, -4, + 0, -2, 5, -2, -8, 0, 4, 3, -6, 11, + 3, -1, -3, -4, -1, 5, 0, -72, 0, -3, + -4, -3, 6, 0, 5, -3, 1, -9, 4, 6, + -1, 0, -4, -8, 4, -2, 1, 2, -1, 1, + -4, 0, 1, 2, -7, 0, -5, -2, 2, 6, + -6, -2, 1, 1, -3, 2, -39, 1, 2, 3, + -1, -3, 2, 2, 1, 4, -3, 0, -95, 1, + -6, -2, 1, -6, -3, -13, 1, 3, 3, -3, + -4, -2, -1, -4, 0, -4, 6, -3, 4, -2, + -7, -6, 5, 9, -5, 0, -8, 4, -1, 0, + -4, 8, 5, -4, -2, 15, -9, -2, -5, -2, + 0, 10, -2, 1, -5, -1, -6, -6, 3, -5, + 2, -2, -3, -1, 4, 3, -6, -3, -5, -4, + 1, -1, 0, -1, -12, 1, -3, 3, 4, -3, + -3, 1, -3, 4, -1, -8, 1, -4, 2, 0, + 3, -5, 2, -7, 0, 0, 4, 3, -4, -7, + -3, -5, 10, 1, 1, 4, 2, -1, 0, -13, + -3, 0, 0, -2, -26, 12, 2, 3, 1, 4, + 4, 2, -6, 6, -5, 3, 3, 4, -1, 1, + 5, 3, 2, 3, -5, 3, -7, -6, -4, -1, + 2, -11, -2, 0, 1, 0, 2, -6, -3, 1, + -1, -3, -2, -5, 6, -5, 1, -10, -4, -5, + 2, 4, -3, -2, -2, -2, 8, -2, -3, 2, + 6, 3, -4, 16, 4, 0, -2, -2, -2, 6, + -3, -8, -1, 0, 0, -2, 1, 1, 0, 0, + -7, -8, -1, 6, 1, -4, -5, -7, -7, 0, + 0, 7, 6, 0, 3, 15, 4, 4, 0, -3, + 0, 8, 2, 0, 5, 4, 3, 4, -7, 7, + -4, 5, 4, 4, -3, -8, 1, 5, 8, 8, + -5, 3, -32, -8, -2, -5, 1, -13, -3, 6, + 4, 3, 6, -7, 2, -2, 1, 2, 3, 3, + -5, 3, 0, 3, 5, 6, -1, 1, 2, 1, + 2, 2, -3, 3, 1, -5, -6, -3, 1, -7, + -3, 1, 5, 2, 3, -3, -1, -12, 0, -1, + -5, -1, -6, -1, 1, -2, 2, 3, 2, 2, + 1, -3, -2, -1, -3, -1, 1, 6, 3, 3, + 1, 3, -5, 3, -3, -3, 0, -11, -5, 0, + 1, -4, -1, -1, 6, -2, 2, -1, -6, -5, + 4, 3, 0, -2, -2, -16, 8, -6, 1, 2, + 3, 2, -4, 11, 3, 0, -4, -2, -2, 4, + -1, 0, -28, -7, -4, -5, 4, -12, -2, -6, + -2, -2, 1, -1, 6, -5, -3, 1, -6, -2, + -1, 1, 1, 1, 3, -13, -1, -12, -15, 1, + -3, -2, 1, 0, 1, 1, 4, 4, -6, 4, + -5, 3, 5, 3, -1, -9, 1, 2, 4, 1, + -4, 3, -7, -2, -4, -2, 4, -7, -3, 1, + 3, 3, 2, -2, -3, -2, -6, -2, -1, -3, + 2, -7, 2, -1, -2, 0, 4, 4, -5, -6, + -1, 2, -27, -5, -1, 5, 2, -3, 0, 15, + -8, -1, 0, 0, 1, -1, -4, 0, 0, -8, + 0, -8, 8, -2, -6, -3, -5, -4, 2, 3, + -4, -3, -3, -1, 8, -2, -6, 4, 9, 4, + -5, 11, 4, -8, -4, -2, -2, 5, 2, 0, + -1, 1, 5, -1, -4, 3, -7, 2, 4, 5, + -3, 0, -1, 2, 4, -1, -5, 3, -11, -5, + -7, -2, 2, -8, -3, -1, 2, 3, 2, -3, + 0, -21, 11, -3, 3, -5, -3, 4, 5, 0, + 1, -2, 2, 0, 4, 1, 3, 2, -4, 3, + -9, -7, -1, -5, -2, -16, -2, 16, 9, 0, + 3, -13, 1, 3, -5, 2, 1, 3, -3, 3, + -13, 1, 4, 2, 0, -13, -2, 1, 3, 2, + -3, 3, -25, -1, -6, -2, 2, -5, -2, -9, + 0, 4, 3, -2, 1, -3, 0, 4, 3, 1, + -6, 4, -3, 1, 4, 4, -2, 1, 5, 4, + 3, 3, -2, 3, -5, 0, -6, -2, 3, -7, + -3, -3, 1, 1, 2, -4, -2, 0, -13, -1, + 1, -4, 6, -6, -8, -6, -3, -1, 2, 4, + -6, -6, -3, 1, 2, -7, -21, -7, 7, 4, + -5, 4, 6, -4, -5, -2, -1, -7, -1, -7, + -3, -4, -1, -4, -6, 3, -1, 0, 1, -3, + -2, 3, -1, -2, -4, 1, -1, -2, 3, 3, + -5, 3, 1, 2, -6, -6, -8, -1, -1, -7, + 2, -1, 3, 2, 3, 2, -9, 2, 0, 3, + 3, 3, -5, -4, 3, 3, 3, 2, -4, 2, + -3, -1, -11, -5, 1, -10, -5, 2, 1, 4, + 1, -3, -3, -10, 2, -2, 3, -1, 7, -3, + 5, -10, 2, -4, 3, -1, -2, -6, -2, -13, + 7, 0, -2, 8, 0, 1, 3, 2, -2, -1, + -6, 1, -24, 10, -2, -4, 1, -1, 2, -2, + 3, -3, 2, -5, 0, -2, 0, 3, 1, -1, + -3, -8, 8, -1, -3, 4, 0, 3, 0, 2, + 1, -4, -4, -3, -11, 4, 1, -16, 7, -1, + 5, -1, -1, 5, 6, -2, -1, 3, -3, 6, + 4, 2, 1, -3, -5, 4, -6, -4, -13, -5, + 3, -17, -5, 13, 0, -1, -5, 1, -3, -1, + 0, -2, -2, -2, 4, -1, 3, -4, -4, -5, + 1, 2, -4, -4, -4, -4, 5, -1, -2, 2, + 3, 3, -4, 11, 4, -1, 0, -2, -3, 6, + 3, 9, -9, -1, -1, 3, -3, -5, -22, 3, + 1, 3, -1, 2, 6, -1, 2, -2, -6, -1, + -124, 2, -9, -2, 4, -1, -3, -17, -4, 5, + 0, 1, -3, 0, -2, -3, 0, -4, 6, -5, + 1, -2, -5, -4, 3, 4, -3, -2, -6, -5, + 3, -4, 2, 4, 0, 1, -5, 10, 4, -1, + 0, -1, -3, 4, -2, -2, -20, -2, -2, 2, + 3, 0, -1, 1, -4, 0, -2, 1, -4, 3, + -1, -4, 0, -4, -2, 3, 5, 2, 0, 0, + 3, -5, -1, -3, -2, -14, -1, -2, -1, -4, + -3, -4, 2, -5, 3, -2, -7, -4, 5, 4, + -5, -5, -3, -2, 7, -4, -2, 1, 4, 2, + -8, 10, 4, -1, -3, -3, -3, 7, 2, 0, + 1, 3, 3, 3, -5, 4, -7, 3, 2, 5, + -3, -2, 3, 2, 3, 3, -4, 2, -27, -6, + -6, -2, 3, -9, -3, 5, 4, 4, 3, -2, + 1, 2, 0, 2, 2, 1, -6, 3, -3, 1, + 3, 4, -1, -8, 1, 2, 5, 2, -4, 1, + -6, -1, -7, -3, 1, -7, -2, 2, 5, 3, + 1, -1, 0, -1, 3, 3, 2, -1, 0, 7, + -3, 3, 6, 1, -2, 0, 4, 4, 3, 3, + -3, 3, -11, -1, -8, -1, 3, -9, -3, -1, + 4, 0, 1, -3, 2, 6, -2, 2, 2, 2, + -3, 0, -4, 2, 1, 3, -1, 4, 2, 0, + 0, 1, -5, 0, -14, 0, -6, -1, 2, -7, + -1, -3, 1, 3, 2, -2, 2, 4, -3, 1, + 2, 0, -6, 4, -18, 2, 2, 3, -2, -15, + 1, 3, 4, 5, -3, 3, -22, -2, -6, -2, + 4, -8, -3, -4, 3, 3, 3, -2, 0, 0, + -7, 1, -1, -3, 4, -3, -3, -2, -2, -3, + 2, 6, -4, -6, -3, -1, 3, -6, -8, -7, + 4, 3, -4, -2, 3, -4, -3, -2, -1, 0, + -2, -3, -1, -1, 0, -3, -2, -1, -3, 3, + 2, -6, -1, 1, 1, -7, -8, -3, 0, -1, + 6, 3, -5, 3, 2, 8, -5, -4, -4, -1, + -2, -4, 3, 0, 0, 0, 3, 3, -6, 3, + -12, 3, 3, 5, -1, -3, 3, 1, 2, 2, + -4, 1, -14, -2, -5, -2, 3, -9, -3, 2, + 1, 2, 2, -4, -3, -2, 1, -3, 1, -3, + 5, -6, 2, -10, 1, -4, 3, -3, -2, -5, + 1, -14, 4, 0, 0, 5, -1, 1, 5, 4, + -5, -3, -2, -1, -13, 8, -2, 1, 1, 0, + -2, 2, 3, -6, 2, -2, -2, -3, 1, 0, + -3, 0, 0, -6, 3, 0, -1, 3, 1, 2, + -1, 5, 4, -1, -4, -1, -9, 5, 3, 6, + 3, 2, 1, 3, -3, 8, 0, 8, 4, 1, + -3, -14, 6, 4, 4, 7, 0, 6, -7, -1, + -4, -3, 5, -10, -2, 3, 3, 4, 8, -6, + -2, 0, 1, -1, -3, -2, 5, -3, 1, -2, + -5, -4, 2, 3, -3, -2, -4, -3, 5, 0, + 0, 3, 3, 0, -5, 7, 3, -1, -2, -2, + -1, 3, 2, 4, -2, 6, 0, 1, -2, 3, + 2, -2, 2, 1, 0, -3, 2, 2, 2, 3, + -3, 3, -17, 2, -5, -2, 1, -3, -1, -3, + 0, 1, 0, -1, -2, 0, 0, -2, 1, -2, + 7, -4, 2, -1, -5, -2, 4, 4, -1, -2, + -7, -4, 5, -2, 4, 3, 4, 0, -6, 6, + 3, -1, -3, 0, -1, 5, 0, 0, -22, 0, + 0, -1, 0, 1, 2, 0, 0, -2, -4, 1, + 3, 0, -3, -4, 1, -3, 2, 2, 6, 2, + 2, 0, 2, -1, -3, -2, 0, -7, -2, 0, + 0, -3, -3, -1, 5, -4, 1, -1, -4, -4, + 3, 2, -3, -4, -2, -1, 3, 0, -3, 2, + 4, 2, -7, 9, 4, 0, -2, -3, -2, 5, + 0, 0, 3, 0, 0, 2, -5, 0, 0, 2, + 4, 1, -2, -3, 5, 1, 3, 1, -4, 3, + 2, -3, -11, -1, 4, -5, -3, 4, 5, 3, + 2, -2, 2, 0, 1, 2, 3, 3, -6, 3, + -3, 5, 5, 4, -2, -3, 2, 3, 2, 4, + -2, 3, -8, -3, -7, -3, 2, -9, -3, 3, + 4, 2, 2, -3, 3, 6, -8, 0, 2, 0, + -2, 4, -2, 0, 2, 3, -1, -8, 1, 0, + 4, 4, -4, 3, -6, -2, -9, -1, 1, -6, + 0, 0, 1, 2, 5, -1, 2, 0, 1, 3, + 4, 2, -4, 3, 0, 1, 4, 4, -2, -4, + -2, 2, 1, 2, -4, 2, -6, 0, -6, -4, + 4, -7, -1, 2, 3, 3, 2, 0, 3, 1, + -2, 2, 1, -1, -6, 3, -3, 1, 4, 4, + -2, 2, 2, 3, 2, 1, -3, 2, 0, -2, + -3, -3, 0, -6, -2, 0, 3, 2, 3, -3, + -1, -1, -8, -2, -3, -1, 2, -5, -7, -2, + 2, -3, 0, 3, 5, -4, -5, 0, 2, -5, + -7, -6, 2, 3, -3, 3, 2, 1, -2, -1, + -1, -2, 0, -1, -1, -2, -1, -2, -7, 1, + -2, -1, 0, -3, -1, 3, 3, -2, -7, 0, + 3, 0, 5, 3, 0, 2, 3, -2, -9, -3, + -6, -1, 0, -7, 2, -1, 1, 3, 3, 3, + -5, 3, 0, 3, 1, 4, -1, 2, 4, 3, + 1, 1, -2, 0, 0, 0, -3, -1, 3, -6, + -2, 1, 3, 2, 1, -2, -3, -3, -1, -4, + -2, -3, 4, -15, 2, -8, 1, -4, 3, 2, + -2, -3, 0, -11, 5, -2, -1, 5, -1, -1, + 1, 8, 0, -3, -7, -8, -18, 9, -2, 1, + -1, -1, -1, 0, 2, -8, 1, -1, 2, -3, + -2, 1, 0, -2, 0, -6, 4, -2, 0, 2, + 1, 1, -3, 0, 0, -5, -5, -3, -8, 4, + 1, 3, -4, -2, 1, -1, -5, -2, 2, 0, + 2, 4, -1, 4, 2, -2, 0, -5, -1, 1, + -6, 3, -5, -2, 1, -2, 0, -5, 1, 3, + -2, 1, -3, 1, -1, -3, -1, -2, 4, -1, + 1, -1, -4, -3, 2, 1, -2, -1, -3, -2, + 6, -2, 0, 3, 1, 1, -4, 8, 3, -1, + -2, 0, -3, 4, 2, 0, 3, 3, 1, 4, + -3, 4, 0, 3, 3, -2, -2, -4, 3, 5, + 2, 8, -2, 1, -16, -4, -5, -1, 2, -10, + -2, 1, 7, 1, 7, -2, -4, 0, 0, 0, + -2, -1, 4, -3, 3, -4, -4, -4, 3, 4, + -3, 0, -2, -3, 5, -2, 2, 0, 2, 2, + -2, 11, 2, 1, 1, -1, -2, 5, 0, 0, + -19, 2, 0, -1, 3, -2, 1, 1, -1, 1, + -4, 0, 0, -1, -5, -5, 1, -3, 1, 0, + 1, 3, 2, -1, 2, -2, -5, -1, -2, -6, + -1, 2, -1, -1, -5, -3, 3, -2, 1, -3, + -3, -2, 2, 5, -4, -4, -3, -1, 6, -3, + 1, 2, 2, 2, -3, 4, 4, -1, -3, -1, + -2, 7, 2, -2, 2, 1, 4, 3, -5, 6, + 1, 2, 2, 1, -3, -1, 3, 3, 3, 1, + -1, 4, -4, -1, -9, -3, 3, -7, -2, 1, + -1, 3, -1, -1, 3, -4, 1, 1, 3, 3, + -5, 2, 3, 1, 4, 7, -2, -4, 5, -1, + 5, 3, -2, 2, -2, -2, -6, -3, 3, -10, + -4, 3, 4, 0, 2, -4, 2, 9, -11, -2, + 2, 1, 0, -4, -11, -1, 2, 5, -3, 3, + -1, 1, 1, -4, -2, 0, -58, 3, -9, -2, + 1, -2, -4, -21, -4, 5, -1, 2, 2, -14, + 6, 0, 4, 2, -6, 1, 6, 3, -2, 3, + -3, 2, 6, 1, 1, 0, -7, 3, -6, -4, + -7, -8, 7, -11, -3, 10, 9, 2, -1, 0, + 3, -5, 4, 0, 4, 4, -5, 1, 5, 2, + 5, 2, -3, -6, 3, 2, 2, 1, -3, 3, + -1, 0, -6, -6, 1, -9, -5, 9, 3, 3, + 1, -2, -3, 1, -13, -1, 1, -3, 5, -7, + -10, -2, -2, -1, 4, 3, -4, -5, -5, 0, + 1, -5, -18, -7, 5, 2, -3, 2, 5, -4, + -5, 0, -1, -5, 0, -4, -2, 3, -1, -2, + -15, 2, -1, 2, 1, -1, -1, 1, 4, -3, + -5, -1, -3, -1, 2, 4, -3, 2, 0, -1, + -13, -5, -1, 2, 1, -3, 2, 1, 0, 0, + 3, 1, -3, 5, -6, 2, 4, 3, -3, -10, + 1, 3, 4, 4, -4, 2, -17, -2, -4, -3, + 1, -7, -2, -2, 4, 3, 2, -5, -5, -6, + 1, -3, 0, -3, 6, -31, 4, -14, -1, -8, + 2, 3, -2, -3, -2, -19, 6, -4, -3, 8, + -1, 1, 3, 12, -4, 2, -6, -1, -42, 8, + -3, -2, -1, 1, 1, -2, 8, -5, 2, -5, + -1, -3, -2, 3, 0, -3, -1, -7, 5, -3, + 0, 6, -1, 3, -3, 9, 2, -4, -9, -4, + -13, 6, 2, 7, -5, 2, -1, 2, -4, 0, + -54, 2, 0, 5, -3, -8, 2, 2, 3, 5, + 0, 1, -96, 2, -3, -3, 1, -3, -2, -12, + 1, 4, 5, -1, -3, 2, 1, -3, -5, -2, + 5, -6, 4, 0, -5, -5, 1, 3, -1, -3, + -3, -4, 5, -3, -1, 3, 2, 4, -5, 10, + 5, -1, -4, -3, -5, 5, 1, -22, 9, -1, + 4, -2, -5, 3, 3, 3, -4, 3, -3, 2, + -2, -1, 3, 0, -3, 5, -6, -4, -1, -3, + 2, -27, -2, 13, 6, -1, -1, -15, -4, 1, + 1, -1, -2, -3, 3, -4, 1, -3, -7, -6, + 3, 5, -2, -1, -6, -5, 5, -3, 1, 3, + 0, 2, -3, 11, 4, 0, -3, -1, -1, 5, + 0, 0, -21, -1, 1, -1, 1, -1, -2, -1, + -2, -4, -6, 0, 2, 2, -1, -6, -2, -3, + -1, 2, 4, 2, 2, 1, 4, -6, -3, -1, + 0, -11, -1, -1, 1, -4, -4, -3, 5, -6, + 0, -3, -5, -7, 4, 4, -3, -4, -4, -2, + 4, -2, -1, 0, 3, 3, -5, 12, 3, -1, + 0, -1, -3, 7, 4, 2, -1, 2, 2, 2, + -6, 3, -11, 5, 4, 6, -3, -7, 2, 3, + 4, 4, -5, 2, -106, -1, -6, -3, 5, -9, + -4, -4, 2, 2, 4, -5, +}; +const TfArray<1, int> tensor_dimension2 = { 1, { 4096 } }; +const ALIGN(8) int16_t tensor_data3[64] = { + 4161, 1435, 1477, 1690, 10134, 2279, 7528, 1827, 9639, 2416, + 3265, 14307, 5774, 2408, 8157, 11297, -979, 614, -243, -410, + -2413, -523, -1338, -106, -4105, -744, -2006, -4706, -1038, -2560, + -2574, -1725, 3311, 2286, 8294, 18246, 19006, 7112, 7327, 2791, + 3303, 1343, 3734, 5021, 2339, 3670, 4287, 9436, -783, -424, + -565, -3686, -25648, -3069, -2046, 213, -996, 769, -3524, -1570, + -1995, -1199, -894, -3140, +}; +const TfArray<1, int> tensor_dimension3 = { 1, { 64 } }; +const ALIGN(8) int8_t tensor_data4[2048] = { + 4, 5, -1, 2, -127, 8, 1, 7, 2, 9, + 1, 9, -49, 0, 3, -11, -7, 10, -1, 4, + 2, 5, 0, -2, 0, 4, 4, 1, -1, -1, + -3, -15, 0, -23, 4, 0, -32, 37, -4, -17, + -4, -8, 0, 6, -3, -3, 2, 8, -11, -2, + 0, -19, 4, -5, -3, 1, 0, 4, -6, 4, + -21, 9, 6, 3, -77, 0, 6, 2, -50, -26, + 3, -48, -15, -46, 7, -17, 16, -11, 18, -30, + -63, 10, 3, 2, 1, -127, -51, 10, -3, -15, + -12, -14, -8, -17, -28, -31, -13, -6, -8, 1, + -3, 12, 12, 0, -4, -3, -7, 50, -6, 0, + 15, -47, -127, 2, -3, -4, 12, 22, 12, -6, + 7, 5, 16, -4, 5, 14, -23, -26, 3, 2, + 0, 2, 1, -8, -127, 1, -3, 5, -1, 0, + 1, 1, 9, 3, 1, 1, 1, 0, -1, 0, + 1, 1, -3, 0, -100, -3, -10, -7, 0, 0, + 21, 31, -3, 4, -49, 4, -4, -7, 7, 28, + -104, -34, -3, -10, 24, 14, -19, -127, 9, -28, + -70, -1, -41, 0, -14, 6, -10, -4, 13, -46, + -13, 41, 7, -28, -13, 18, -17, -3, -1, -50, + -15, -127, -12, 18, -9, -13, 11, -10, 26, -19, + -13, 89, 6, 3, -27, -10, -11, 13, -3, -6, + 62, -11, 7, -37, 12, -20, 5, -4, 2, -48, + -3, -6, -1, -6, -6, -5, 3, -5, -10, 0, + 1, 1, 2, -18, 2, -9, -7, 3, -10, -4, + 4, 2, -1, -5, -1, -4, -14, -74, 3, -7, + -12, -20, 26, -2, 14, 36, 127, 36, -29, -15, + 48, 32, 27, -28, 2, -2, -5, -1, 26, -15, + -11, 9, -21, -2, 0, -18, 11, 25, 7, -11, + -4, 6, 7, 2, -7, 36, -5, -5, -7, -1, + 8, 3, 1, 4, -1, -5, 2, 4, -1, -2, + 4, -2, -2, 3, -2, 3, -7, 6, 23, -14, + 43, 32, 1, -7, 17, 35, 6, -8, -14, 117, + -11, -7, 81, 1, -7, -33, 6, 36, -23, -127, + 3, 10, 8, -10, -23, -6, -2, -7, -22, 2, + 3, -22, 6, -2, -1, -4, 0, 3, 7, 7, + -3, 2, -5, -4, -9, -1, -27, 1, 4, 0, + -3, 4, -2, 2, 2, 1, 0, -3, -11, 0, + 3, -127, -2, 2, -127, -106, -17, 8, -59, 64, + 12, 83, 2, -72, -20, 71, -11, -17, 56, 7, + 57, 69, 16, -15, -10, 2, -66, 1, 27, 6, + -3, 9, 17, -35, 11, 94, -78, 30, -22, -26, + 38, 42, 20, 9, -25, 35, 19, -22, -21, -16, + 21, -2, 15, -98, 1, 31, 127, 7, -15, -11, + 8, 6, 4, -10, -23, -72, 5, 17, -48, 52, + -12, -19, 8, 64, 32, 9, 14, 48, 14, -43, + -16, 6, 61, 6, 5, -119, -11, 47, -40, 15, + -5, 20, -1, -2, 24, 28, -42, -64, 8, 10, + 10, 7, -11, 4, 3, 0, 8, 1, 1, 23, + 12, 28, 1, 7, 6, 13, 1, -15, -2, -8, + -9, 16, 18, -11, 4, -7, -6, 7, 16, -27, + 4, 36, 8, -3, -3, -1, -3, -14, 3, 1, + -14, 0, 2, 2, 20, -1, 2, 4, 0, -2, + 16, -11, 8, -3, -1, 2, 2, 1, 1, -7, + -1, 1, -2, 0, -127, -1, -9, 2, -21, -4, + 2, 2, 6, -2, 6, 6, -1, 17, -20, -18, + 0, -15, 7, -18, -10, -36, 10, 2, 2, 1, + -5, 10, -6, -4, 6, 3, -9, -14, 5, -5, + 24, 0, -53, 12, 5, -43, 4, -1, -106, 8, + -20, 2, 3, -20, -61, -7, 19, -67, 17, -16, + -34, -17, 11, 14, -14, -1, -19, -1, 14, -3, + 11, -2, 58, -25, -47, -16, -10, -88, 5, 2, + -36, 7, -9, -6, 4, -15, 18, 35, 21, 6, + 11, 0, 21, -3, -11, 16, 0, -1, 5, 7, + -4, 0, -3, 2, -2, 2, 2, -68, -2, 1, + 1, -2, 3, 13, 2, -4, -2, 4, 4, -17, + 5, 3, -2, -2, -3, 1, -4, -4, -2, -2, + -8, 2, 33, -17, -23, 15, 3, 51, -62, -2, + -28, -12, 11, 12, 34, -92, -8, 38, -3, 27, + 11, -59, -45, 21, -12, -10, 36, -9, -22, -36, + 5, -6, -21, 14, -8, 18, -11, -13, -6, -1, + 42, 5, -7, -17, 39, -13, 13, -5, -1, -10, + 2, -2, -5, -39, -15, 8, -23, 0, 5, 6, + 97, -36, 11, -8, -52, 11, -127, -5, 2, 5, + -2, 15, -11, 5, -67, 3, -6, -1, -8, -9, + -3, -2, 3, -5, 6, -7, -8, 10, -7, 2, + -28, -5, -10, -5, 0, -2, -7, -2, 59, -3, + -52, -28, 52, -56, -26, -6, -7, 23, -20, 25, + 45, -36, 4, -16, -5, -12, -5, 103, 15, 5, + -18, -21, -4, 18, -48, -25, 13, 1, 10, -21, + -15, -6, -5, -9, -127, -12, -17, 4, 4, -15, + -5, 2, -13, 1, 2, 4, -1, 1, 19, 0, + 0, -5, -2, 1, 10, -2, 0, 11, -4, 1, + -7, 2, -116, 7, 16, -9, -31, -25, -12, -35, + 7, 2, -10, 14, -11, 37, -10, 8, 9, -69, + -65, 70, 36, -25, 16, -20, 24, -7, 8, 33, + -24, -16, 26, -6, 5, 1, -4, -3, 5, -5, + -1, -7, 19, 4, 0, -2, -6, -1, -6, -1, + -24, 9, -3, 5, -3, 18, -22, -3, -9, 0, + 2, -7, 3, -4, -16, -1, -10, 12, 35, 27, + -90, -47, 11, 1, -28, -1, -17, -9, -1, 74, + 9, 12, -9, 90, -33, 28, -31, 11, -28, -11, + 20, 19, -32, -68, 19, -14, -85, 23, -13, -10, + 17, -23, 42, -74, 42, -5, 36, 6, 10, -4, + 56, 16, -19, 6, 4, 23, 45, -25, -17, -32, + -20, 12, -24, 1, 29, -49, -12, 8, -18, 23, + 74, 19, 20, -9, 127, -5, 22, 3, 90, 10, + 16, -22, 3, 25, 35, 16, 7, 10, -7, 20, + 36, -37, 20, -16, 19, 30, 23, 27, -17, 13, + 10, 19, 1, 0, -3, -15, -127, -24, -19, -6, + 17, 3, 9, 0, 26, 4, -5, -18, -12, -120, + 10, -4, -24, 23, 5, -5, 12, -11, 1, -15, + -5, 8, -3, -7, 12, -10, -3, -5, -2, 10, + -11, -11, -4, 0, -42, 14, -24, 0, 12, -6, + -127, -3, -1, -10, -4, 3, -23, -5, -19, 4, + 0, 5, -1, -6, 6, -15, 3, -2, -2, -10, + 27, -7, 15, -5, 3, 33, -5, 0, -2, 5, + 13, -2, 1, -3, 10, 56, -9, -9, 1, 10, + 52, -6, -6, 4, -19, -15, 8, -30, -15, 27, + 9, -7, 5, -1, 7, 23, 3, -28, -3, 14, + -5, -2, 10, -26, 16, -127, 3, 6, -8, 8, + 0, -12, -19, -2, -6, -8, -26, -38, 4, 13, + 81, -21, -8, 21, -6, 58, -8, -16, 0, -42, + -12, -49, -65, 15, 42, 15, 2, -83, 13, 9, + -21, 15, 19, -17, 54, -2, 8, -11, -124, -5, + -33, 1, -3, -15, 6, 8, -8, -28, -1, 1, + 1, -13, 2, 14, 1, 2, -127, -1, 0, 14, + 1, -15, 3, -2, 2, -8, 2, 5, -6, 1, + 11, 18, 7, 1, -35, -52, -4, -4, -69, -37, + -12, -29, 13, -58, 6, -25, -30, 0, -1, 28, + 59, -26, 1, -1, -20, 78, -17, 10, 5, -1, + -24, 3, -127, 9, 28, -34, -31, 50, -5, 13, + -34, 44, 9, 37, 22, 26, 14, 33, 8, 23, + 6, -44, -42, -44, 27, 4, 39, 9, 127, -30, + 10, 27, 9, 35, -45, -1, 37, -1, 13, 18, + -7, 6, 62, 32, 12, -1, -4, -109, 15, -11, + -127, -12, 45, 13, 34, -2, 6, -16, 1, 6, + 1, 5, -12, -12, -2, 2, -86, -20, 9, -10, + -15, 2, -1, 15, -4, -16, -46, -7, -3, 2, + 8, -35, -5, 5, -9, 3, -56, -52, -9, -3, + -17, -31, 60, 1, -2, -13, 34, -8, -54, 34, + -23, 9, 12, -7, 1, 0, -5, 1, 0, -2, + 7, 6, -2, -4, 6, 2, -4, -3, -16, -2, + 3, -1, -1, 4, -37, 6, -2, -5, 20, -4, + -1, 8, -18, -4, -10, -24, 2, 5, -7, 2, + -17, -15, 5, 14, -14, -2, -2, 0, 15, -15, + 5, 4, -1, 4, -1, 15, -73, -2, -9, 0, + 0, -3, -2, 2, -15, -19, 12, -84, 2, 0, + -3, -65, -6, -5, 0, -10, -14, -80, -8, 1, + -84, -9, -17, -54, 2, -64, 8, -14, -28, 2, + -32, -1, 3, -1, -28, -13, -6, -8, -2, -5, + -1, -2, 2, 2, -3, -1, 0, 8, 2, 2, + 1, 0, 1, 0, 3, 1, -2, 0, 0, 1, + -3, 1, 1, 1, -127, 1, -1, 1, 3, 1, + 20, 13, 0, -5, 7, -19, -7, 6, 4, 3, + 0, -16, -5, 3, -3, 2, 7, 2, -2, -5, + 2, 2, -3, 4, -3, -5, -3, -4, -7, 2, + 1, 14, 14, 127, -12, -5, 52, -9, 7, -14, + -15, -56, 17, -30, -25, -3, 17, 2, 13, -42, + -9, -17, -16, 10, 4, 15, -25, 4, -13, 14, + 21, 0, -7, -35, 5, 16, 11, 13, -34, -57, + -1, -24, 4, -67, 2, -1, 54, 8, 18, 7, + -86, -2, 5, 11, -1, -4, -7, 14, 9, -10, + -1, -2, -28, -4, 14, 11, 6, 3, -22, 5, + 36, -37, 8, -1, 5, -6, -21, -3, 38, -10, + 5, -13, -4, -9, -2, 2, 2, 10, -6, 3, + 12, 0, -15, -18, 2, 0, -10, -4, -34, 8, + 0, -14, -127, -13, -1, -2, 8, -10, -20, 4, + 5, -1, -2, 2, -6, -10, -9, 7, -25, -8, + 11, 10, 11, -10, -4, -17, -7, 2, -7, 5, + -97, -11, 16, -12, 9, 33, 22, -3, 25, 2, + -98, 10, 40, -16, 20, -8, -9, -29, 28, 44, + 1, 12, 15, -11, -63, -9, 9, -2, -7, 3, + 13, -2, 8, -13, -42, -5, 45, -127, -55, 10, + -2, -3, -10, -15, -17, -4, -11, 2, -13, 23, + -13, -86, -43, -9, -25, -15, -16, 20, -36, -42, + 11, -25, -76, 9, -90, 1, 0, 16, 27, 7, + 2, -4, -36, -2, 5, 0, -36, -1, -78, 6, + 0, 3, -2, 3, -9, 3, 4, 7, -4, 8, + -8, 13, 5, 8, 8, 1, -10, -1, -30, 5, + 4, -79, 6, 0, -71, -13, -9, 11, -82, -4, + -27, -4, 6, -8, -48, -62, 11, -26, -8, -2, + -32, -12, -22, -17, 12, -7, -2, -5, 33, -1, + 7, -39, 41, -66, -3, -16, 18, -19, -15, 14, + 19, 14, 25, 112, 2, -12, 13, -1, -36, 86, + 106, -16, 64, -8, 15, 35, -11, 42, 117, -15, + -45, 4, -2, -7, 111, -9, 15, -12, 0, 7, + -64, -4, 6, -8, -68, -21, -12, 15, -87, 19, + 20, -7, 18, 14, 1, 13, 15, 11, 9, -1, + -10, 10, -24, -6, -4, -36, 127, 59, -17, -1, + -38, -10, -9, 15, -42, 3, 23, 58, 25, 12, + -6, -12, 26, -27, 95, -16, 7, 5, -19, 113, + -8, -4, 109, 3, 3, -4, 9, 6, -121, -127, + 13, 1, 11, -13, 4, -2, 25, -10, 16, -16, + 3, 0, 1, 6, -4, 22, -15, -4, -2, -5, + 0, 16, -3, 1, -8, -3, -5, 1, -15, 1, + 16, 15, -3, 3, 17, -15, -5, 0, -54, -22, + 19, -127, 2, -8, 9, -30, -4, 4, -11, 1, + -6, 7, -26, -16, 3, 0, -4, 3, -127, 2, + -11, -1, -62, -94, -5, -2, -71, -1, -60, 1, + 2, -15, -89, -17, -2, -7, 4, -8, -58, 15, + -44, 2, -29, -1, -31, -31, -2, 2, -24, -1, + -4, 0, 15, -4, -2, -6, -7, -25, 3, -2, + -1, 1, 0, -2, 0, -1, -6, -1, -6, -24, + -9, -1, 1, 0, 0, 2, 1, 3, 3, -2, + -1, -2, 0, -4, 4, 0, -127, 20, 15, 2, + -2, 13, -5, 6, 2, -2, -1, -3, 1, 5, + 8, 3, -14, 2, 20, 0, -2, -2, 5, 19, + 0, 0, 4, -2, 18, -5, -37, -54, 36, -40, + -41, -15, 7, 18, 81, 14, 0, 16, -7, -9, + -15, 18, 7, 55, -45, -1, -25, 12, 9, -18, + 9, -10, -18, -3, -5, 3, 3, -7, -4, -27, + 21, 15, 9, -2, 50, 11, -9, -2, -22, 10, + -12, 13, 3, 7, 92, -127, -39, -17, 4, -9, + -12, 3, 7, 12, -8, 3, -6, 15, +}; +const TfArray<1, int> tensor_dimension4 = { 1, { 2048 } }; +const ALIGN(8) int16_t tensor_data5[128] = { + 9995, 10980, 1112, 1018, 8471, 6201, 13185, 7779, 960, 12163, + 8559, 5352, 7723, 1478, 7106, 7075, -584, -1232, -1697, -1880, + -1086, -1575, -1151, -1128, -1979, -1321, -1103, -1732, -883, -1954, + -2009, -1023, 11348, 5426, 1411, 10800, 4680, 6043, 11071, 973, + 7618, 1143, 23811, 905, 7064, 10330, 5678, 12963, -1196, -993, + -2058, -1599, 136, -1376, -1246, -1761, -1501, -2157, -1949, -1976, + -1364, -777, -935, -1036, 9093, 1436, 12302, 2487, 10722, 15381, + 9388, 9812, 8092, 12649, 11091, 1237, 12354, 8280, 14331, 9768, + -2130, -2190, -1127, -1083, -3649, -1699, -1135, -1172, -1691, -977, + -1578, -2035, -1167, -1272, -3792, -1238, 11690, 11114, 9194, 9223, + 15636, 4424, 10925, 1003, 7456, 982, 9832, 10600, 1254, 1301, + 11318, 998, -2263, -1106, -1068, -1142, -2195, -520, -1352, -1882, + -1711, -2059, -1303, -1185, -1811, -2099, -1223, -1747, +}; +const TfArray<1, int> tensor_dimension5 = { 1, { 128 } }; +const ALIGN(8) int8_t tensor_data6[1664] = { + -11, 19, -19, 12, -6, -2, -22, -6, 66, 14, + 23, 23, -22, -127, -98, -6, 46, 53, 82, 96, + -65, -90, -26, 59, -34, 75, -127, 78, -62, 27, + 64, 80, 26, 49, 41, 19, 13, -3, -16, 33, + -33, -2, -93, -11, 58, -1, -25, 11, 55, 74, + 30, 94, -37, -3, 31, -6, -44, 22, 35, 32, + -19, 53, -67, 83, -41, -5, 127, 70, 91, 17, + 66, -13, 6, -4, 2, 22, 0, 11, 6, -20, + -13, 9, -12, -9, 11, -44, -42, 35, -127, -109, + 68, 70, 7, 85, -14, 34, 73, -83, -100, -127, + -48, 62, 69, 36, 40, -10, 57, -71, -47, 104, + 91, 13, 68, 11, 74, 86, -12, -76, -7, -68, + -17, 30, 14, 4, 14, 58, 10, 21, -38, -127, + -122, -8, 67, 41, 24, 42, 6, -22, 0, -37, + 32, -37, 29, 13, -6, 11, 0, -6, 11, 16, + -1, -2, 9, 15, 22, 5, 28, -3, -127, 4, + 38, -33, 25, -17, 0, 28, -21, 9, -50, 126, + 95, 104, 105, 89, -33, -51, 127, -63, 87, -16, + 98, -33, -15, 6, 92, 82, 91, 6, 127, -76, + 124, 3, -2, 0, 13, 8, -26, -22, 6, 61, + 40, -43, -62, 17, 127, -113, -27, 31, -3, 73, + -68, -60, 9, -57, -24, 119, 46, -105, 127, -82, + -3, 20, 9, 8, -3, -11, 3, -1, 3, -15, + -9, 6, 16, -6, -3, -16, 11, -6, 6, 3, + 41, -63, 52, -78, 49, 63, 47, 27, -20, 12, + 9, -6, 45, 30, 16, -65, 63, -4, -118, 37, + -53, -127, 51, 43, -11, 14, -22, 6, 2, 11, + -11, -14, 13, 15, 0, -4, 41, -30, 18, 73, + -62, -79, 53, 76, -28, -127, -22, 77, 37, 112, + 110, 24, 112, 82, 7, 124, -29, 97, 127, -55, + -11, -30, -88, 125, -73, -103, 25, 107, 88, 3, + -17, 93, 41, 85, -6, 74, 90, -70, 18, -17, + 124, -84, -4, 68, 80, -39, -70, 127, 60, 81, + -100, 63, 45, 52, -79, 84, -4, 14, -7, -17, + 21, 47, -9, -12, -49, 6, 61, 35, -53, 66, + -15, -127, 11, 33, -3, -4, 32, -31, 16, -7, + -1, -8, -8, -13, -15, -8, -6, -16, 3, 4, + 16, 16, -7, 78, -6, -127, 5, 24, 32, -24, + -30, -15, 20, 8, -6, 8, 1, 0, -1, 5, + -2, -7, -7, -2, 40, 55, -45, -127, 36, 59, + -24, 17, 1, -23, 14, -11, 19, -4, 5, -14, + -10, -14, 7, -2, -2, -26, 6, -27, -14, 10, + 32, -54, -28, -7, -12, 81, 17, 119, 82, 51, + -127, -120, 8, -17, 7, -42, -21, -19, -27, -49, + -127, 103, 56, 20, -3, 17, 13, 65, -44, 34, + 4, -50, 15, 11, 22, -6, 6, 4, -66, 27, + 19, -13, 27, -40, -41, -11, 8, -8, -42, -87, + -86, -21, 52, 37, 79, 71, 9, 47, -52, 127, + -2, 24, 104, 105, -34, -61, 71, -91, 44, 119, + 127, 52, 59, 75, 127, 108, 35, 117, -31, 2, + 58, -1, 112, -33, 127, -62, -12, 14, -17, 10, + -5, -5, -8, 5, -2, 7, -10, 3, -10, 9, + 4, -14, 13, -2, -7, 20, -11, -1, 99, 112, + 64, 87, -48, -25, 67, 127, 113, -27, -17, 123, + -26, -43, 120, 69, 124, 49, -45, 60, 46, 19, + 63, -89, 3, 7, 39, 70, 120, 43, -112, -127, + -79, -34, 38, 33, 19, -30, 60, 12, -11, 19, + -24, 31, -19, -59, 64, -16, 11, -4, 112, 87, + -87, 64, 68, 7, 127, 67, 11, -53, 116, -60, + -83, 120, -107, 2, 63, 15, 51, 74, 110, 71, + 1, -3, -9, 7, -18, -62, 89, 44, -36, -95, + 127, -5, -83, 81, -52, 19, 4, -26, 33, 11, + -12, -4, -17, 19, -18, 34, 44, 45, 14, -29, + 45, 19, -41, -21, 9, 13, -7, 20, -16, -3, + -4, 71, -3, -13, -32, -4, -127, 5, -6, -14, + -127, -60, -8, -27, -91, -62, -49, -20, 10, 26, + -18, -39, -6, 68, 29, -1, 18, 41, 60, 24, + -21, 14, -9, 27, -5, -8, 15, 36, 7, 24, + 27, 51, 56, -24, -127, -67, 26, -5, -6, 31, + -11, 8, 6, -32, 50, -28, -30, 20, 116, 85, + -43, -63, 40, 113, 98, 10, 40, 29, 2, -31, + 84, -36, -22, 127, 44, -22, 101, -31, 16, 111, + -1, 12, -33, -2, -5, -46, -59, -14, -8, -81, + -127, -103, 90, -76, 30, 72, 99, 34, 99, -2, + 7, 46, 62, 7, -4, 0, 1, 8, -3, 4, + -2, 2, 6, -3, -7, 12, 15, -1, -10, 35, + 3, -64, -53, -80, -2, 127, 11, 10, 7, -4, + 25, -27, -84, 91, 55, -82, -37, 127, -15, -104, + 116, -86, 45, 2, -4, -2, -12, -7, -19, 11, + 11, 7, -31, 24, 100, 127, -26, 25, 68, -52, + 27, -29, 31, -18, 0, -2, -19, 12, -26, -40, + -3, 15, -4, -13, 1, 21, -49, 112, -127, 72, + -14, 79, 25, -1, -52, -64, -41, 53, 52, 19, + -24, 33, 24, -50, -36, 69, -48, -67, 36, 20, + -4, 16, 0, -15, -20, 7, 10, 0, 13, 3, + 0, 15, -1, -13, 5, 22, -1, 16, 33, -127, + 27, -6, 4, 11, 38, 106, 68, -41, 114, 44, + 116, -55, 116, 45, -61, 25, -57, -65, -72, 48, + 121, 28, 126, 81, -30, 61, -42, 127, 1, 15, + 62, 72, 62, -43, -127, -36, 27, -19, 0, -15, + -3, -25, 65, -14, -8, 7, 13, -21, -3, 8, + 23, -4, -1, -2, -4, 1, -10, 2, -4, 3, + 7, 11, 14, -4, -14, -6, -95, 27, 127, -31, + -42, 5, 2, -9, 20, -6, 10, -20, 42, -112, + 4, -11, 64, 32, 27, 3, 14, 29, 57, -8, + -15, 64, -12, -55, 78, 7, -127, -37, 30, 10, + 127, 18, -67, -66, 34, -21, 23, -2, -14, -2, + 14, -1, -11, 15, 16, -30, 16, 4, 13, 8, + -34, 18, -31, 0, 12, -20, -15, 19, -13, 1, + -11, -13, 19, -39, -28, -7, 31, 92, -31, 58, + 97, -127, 56, -74, -21, 18, 4, -10, 8, -10, + -9, 3, -23, -8, 29, -4, 15, -13, 9, -9, + 3, 9, 19, -12, 10, -37, -18, 127, -45, -18, + 12, 19, -5, -18, 23, 2, -24, -9, -16, 23, + -35, -19, 41, 37, -25, -31, 72, -13, -25, -10, + 25, 3, 71, 14, 68, 127, -25, 51, -36, -16, + -62, 12, -38, -71, -101, 53, 56, -91, 21, 4, + 51, 60, 127, 72, 28, -24, -58, 38, -23, -4, + -19, 29, 80, -127, 42, -50, 69, -18, 4, -6, + -38, -1, 27, 28, -47, 23, 57, -70, 12, 13, + 9, -7, -19, 12, -11, 76, -29, 29, -67, 127, + 121, 76, -7, 112, 26, -3, 66, -73, 21, -5, + -82, 18, 13, 50, 121, 76, 52, 120, 9, 4, + -17, 10, 127, 48, -6, 38, 64, 37, -38, -42, + -54, -30, 2, -49, 2, -7, 18, -33, -7, -14, + 45, -15, 125, 0, 29, -7, 127, 49, 102, -90, + 127, -36, -37, -15, -26, 25, 19, 18, -52, 111, + -23, 109, 111, 5, 61, 15, 6, -8, 0, -8, + -15, 37, -38, -68, 127, -41, -48, 108, -92, 81, + -53, 37, -19, 14, -9, 5, -2, -3, 12, -6, + 97, 113, 127, 73, 56, -17, 102, -31, 57, 34, + 30, -37, -31, 84, 78, 37, -16, -44, 51, 35, + -70, 30, 111, -18, 127, 57, -45, -25, 54, 18, + -12, 100, -8, 54, -2, 59, 21, 64, 2, -22, + -56, -19, 46, 70, 84, -1, 53, 30, 6, 3, + -23, -27, 44, 1, -50, 17, 55, -83, 125, -127, + 97, -53, 41, 9, -33, 12, -23, 14, -14, 17, + 19, -10, 4, -5, 15, -11, 28, 46, 34, -21, + -72, -93, 19, 96, 14, -20, 53, -4, -127, 25, + 29, 8, 11, -13, 11, -10, -29, 74, 62, -109, + 60, 106, -102, 74, 101, -45, 24, 127, 118, -6, + 110, -60, 76, 78, 58, 64, 108, 39, 112, 48, + 23, -34, -28, 56, 127, -7, -90, -39, 35, 74, + 39, -19, 14, 4, 3, 19, 5, -33, 32, -91, + 28, 32, -48, -41, 115, 76, -29, 55, 24, -121, + -25, -10, 114, 37, -62, 13, 77, 85, 28, -27, + 72, -5, 26, 113, 97, 116, 127, -13, 6, 1, + -7, -5, 16, -17, -36, 87, -67, 83, -95, 78, + -9, -60, 127, -77, 25, -26, 8, -5, 9, -8, + 17, -10, -13, 17, -35, -23, 2, 1, 29, -20, + 1, 9, -2, 17, -12, -127, 17, 76, -34, -96, + -17, -14, 56, -73, -5, 30, 36, -35, -65, 127, + 29, -84, 79, 28, -44, 25, -5, -13, 22, -17, + -9, 8, 6, 2, -9, 7, -2, 13, -24, -1, + 40, -83, 13, 83, -127, 56, -21, 1, -10, 26, + 1, -6, 26, 29, -53, -17, 70, -59, -2, 24, + 30, 4, -59, 18, -2, 2, 6, 5, -5, 2, + 3, 7, 7, -15, -8, 0, 34, -35, 48, -16, + -51, 34, -9, -45, 20, 66, 56, -127, -5, 6, + 14, 3, 5, 13, -5, 27, 30, 8, -40, -127, + -40, 68, 22, 23, 7, -25, 31, -11, -2, -23, + 16, -4, -104, 17, 127, 7, -6, -5, 3, -7, + -17, 28, 16, 6, -10, 24, 6, 1, -14, 20, + -12, 9, -20, 14, 4, 18, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, +}; +const TfArray<1, int> tensor_dimension6 = { 1, { 1664 } }; +const ALIGN(8) int64_t tensor_data7[2] = { + -1, 1, +}; +const TfArray<1, int> tensor_dimension7 = { 1, { 2 } }; +const TfArray<4, int> tensor_dimension8 = { 4, { 1,1,4,64 } }; +const TfArray<1, float> quant8_scale = { 1, { 0.24111956357955933, } }; +const TfArray<1, int> quant8_zero = { 1, { -128 } }; +const TfLiteAffineQuantization quant8 = { (TfLiteFloatArray*)&quant8_scale, (TfLiteIntArray*)&quant8_zero, 0 }; +const TfArray<4, int> tensor_dimension9 = { 4, { 1,1,4,32 } }; +const TfArray<1, float> quant9_scale = { 1, { 0.33315452933311462, } }; +const TfArray<1, int> quant9_zero = { 1, { -128 } }; +const TfLiteAffineQuantization quant9 = { (TfLiteFloatArray*)&quant9_scale, (TfLiteIntArray*)&quant9_zero, 0 }; +const ALIGN(4) int32_t tensor_data10[1] = { + 865, +}; +const TfArray<1, int> tensor_dimension10 = { 1, { 1 } }; +const TfArray<1, float> quant10_scale = { 1, { 0.00022624728444498032, } }; +const TfArray<1, int> quant10_zero = { 1, { 0 } }; +const TfLiteAffineQuantization quant10 = { (TfLiteFloatArray*)&quant10_scale, (TfLiteIntArray*)&quant10_zero, 0 }; +const TfArray<4, int> tensor_dimension11 = { 4, { 1,1,1,32 } }; +const TfArray<1, float> quant11_scale = { 1, { 0.79527455568313599, } }; +const TfArray<1, int> quant11_zero = { 1, { -128 } }; +const TfLiteAffineQuantization quant11 = { (TfLiteFloatArray*)&quant11_scale, (TfLiteIntArray*)&quant11_zero, 0 }; +const ALIGN(8) int8_t tensor_data12[1*1*1*32] = { + /* [0][0][][] */ -69,-31,73,-73,-72,-67,64,78,-47,-88,52,-82,-42,-106,21,-99,57,-46,-68,-43,95,-64,76,-92,-87,55,-127,-28,93,76,88,36, +}; +const TfArray<4, int> tensor_dimension12 = { 4, { 1,1,1,32 } }; +const TfArray<1, float> quant12_scale = { 1, { 0.00028448953526094556, } }; +const TfArray<1, int> quant12_zero = { 1, { 0 } }; +const TfLiteAffineQuantization quant12 = { (TfLiteFloatArray*)&quant12_scale, (TfLiteIntArray*)&quant12_zero, 0 }; +const TfArray<4, int> tensor_dimension13 = { 4, { 1,1,1,1 } }; +const TfArray<1, float> quant13_scale = { 1, { 0.17188803851604462, } }; +const TfArray<1, int> quant13_zero = { 1, { 31 } }; +const TfLiteAffineQuantization quant13 = { (TfLiteFloatArray*)&quant13_scale, (TfLiteIntArray*)&quant13_zero, 0 }; +const TfArray<2, int> tensor_dimension14 = { 2, { 1,1 } }; +const TfArray<1, float> quant14_scale = { 1, { 0.17188803851604462, } }; +const TfArray<1, int> quant14_zero = { 1, { 31 } }; +const TfLiteAffineQuantization quant14 = { (TfLiteFloatArray*)&quant14_scale, (TfLiteIntArray*)&quant14_zero, 0 }; +const TfArray<2, int> tensor_dimension15 = { 2, { 1,1 } }; +const TfArray<1, float> quant15_scale = { 1, { 0.00390625, } }; +const TfArray<1, int> quant15_zero = { 1, { -128 } }; +const TfLiteAffineQuantization quant15 = { (TfLiteFloatArray*)&quant15_scale, (TfLiteIntArray*)&quant15_zero, 0 }; +uint8_t ALIGN(4) opdata0[143] = { 107, 116, 0, 109, 112, 0, 32, 96, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 248, 255, 255, 255, 72, 0, 0, 0, 0, 97, 103, 103, 112, 0, 8, 64, 0, 0, 0, 24, 0, 0, 0, 0, 111, 116, 112, 0, 8, 64, 0, 0, 0, 3, 0, 251, 255, 0, 115, 99, 114, 97, 116, 99, 104, 0, 97, 107, 112, 0, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 1, 34, 20, 6, 79, 43, 121, 119, 68, 55, 6, 1, 6, 82, 13, 1, 124, 72, 64, 20, 40, 4, 20, 20, 4, 12, 36, 1, }; /* custom_initial_data */ +const TfArray<3, int> inputs0 = { 3, { 0,6,5 } }; +const TfArray<1, int> outputs0 = { 1, { 8 } }; +uint8_t ALIGN(4) opdata1[135] = { 107, 116, 0, 109, 112, 0, 8, 0, 1, 0, 0, 64, 0, 0, 0, 0, 97, 103, 103, 112, 0, 24, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 111, 116, 112, 0, 8, 32, 0, 0, 0, 3, 0, 249, 255, 0, 115, 99, 114, 97, 116, 99, 104, 0, 97, 107, 112, 0, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 1, 34, 20, 6, 95, 43, 113, 111, 68, 55, 6, 1, 6, 98, 13, 0, 116, 72, 0, 20, 40, 4, 20, 20, 4, 12, 36, 1, }; /* custom_initial_data */ +const TfArray<3, int> inputs1 = { 3, { 8,4,3 } }; +const TfArray<1, int> outputs1 = { 1, { 9 } }; +uint8_t ALIGN(4) opdata2[135] = { 107, 116, 0, 109, 112, 0, 8, 128, 0, 0, 0, 128, 0, 0, 0, 0, 97, 103, 103, 112, 0, 24, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, 116, 112, 0, 8, 32, 0, 0, 0, 1, 0, 252, 255, 0, 115, 99, 114, 97, 116, 99, 104, 0, 97, 107, 112, 0, 32, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 1, 34, 20, 6, 95, 43, 113, 111, 68, 55, 6, 1, 6, 98, 13, 0, 116, 72, 0, 20, 40, 4, 20, 20, 4, 12, 36, 1, }; /* custom_initial_data */ +const TfArray<3, int> inputs2 = { 3, { 9,2,1 } }; +const TfArray<1, int> outputs2 = { 1, { 11 } }; +const TfLiteConvParams opdata3 = { kTfLitePaddingValid, 1,1, kTfLiteActNone, 1,1 }; +const TfArray<3, int> inputs3 = { 3, { 11,12,10 } }; +const TfArray<1, int> outputs3 = { 1, { 13 } }; +const TfLiteReshapeParams opdata4 = { { 0, 0, 0, 0, 0, 0, 0, 0, }, 0 }; +const TfArray<2, int> inputs4 = { 2, { 13,7 } }; +const TfArray<1, int> outputs4 = { 1, { 14 } }; +const TfArray<1, int> inputs5 = { 1, { 14 } }; +const TfArray<1, int> outputs5 = { 1, { 15 } }; +const TensorInfo_t tensorData[] = { + { kTfLiteInt8, tensor_arena + 256, (TfLiteIntArray*)&tensor_dimension0, 96, {kTfLiteAffineQuantization, const_cast(static_cast(&quant0)) },}, + { kTfLiteInt16, (void*)tensor_data1, (TfLiteIntArray*)&tensor_dimension1, 128, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt8, (void*)tensor_data2, (TfLiteIntArray*)&tensor_dimension2, 4096, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt16, (void*)tensor_data3, (TfLiteIntArray*)&tensor_dimension3, 128, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt8, (void*)tensor_data4, (TfLiteIntArray*)&tensor_dimension4, 2048, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt16, (void*)tensor_data5, (TfLiteIntArray*)&tensor_dimension5, 256, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt8, (void*)tensor_data6, (TfLiteIntArray*)&tensor_dimension6, 1664, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt64, (void*)tensor_data7, (TfLiteIntArray*)&tensor_dimension7, 16, {kTfLiteNoQuantization, nullptr },}, + { kTfLiteInt8, tensor_arena + 0, (TfLiteIntArray*)&tensor_dimension8, 256, {kTfLiteAffineQuantization, const_cast(static_cast(&quant8)) },}, + { kTfLiteInt8, tensor_arena + 256, (TfLiteIntArray*)&tensor_dimension9, 128, {kTfLiteAffineQuantization, const_cast(static_cast(&quant9)) },}, + { kTfLiteInt32, (void*)tensor_data10, (TfLiteIntArray*)&tensor_dimension10, 4, {kTfLiteAffineQuantization, const_cast(static_cast(&quant10)) },}, + { kTfLiteInt8, tensor_arena + 0, (TfLiteIntArray*)&tensor_dimension11, 32, {kTfLiteAffineQuantization, const_cast(static_cast(&quant11)) },}, + { kTfLiteInt8, (void*)tensor_data12, (TfLiteIntArray*)&tensor_dimension12, 32, {kTfLiteAffineQuantization, const_cast(static_cast(&quant12)) },}, + { kTfLiteInt8, tensor_arena + 32, (TfLiteIntArray*)&tensor_dimension13, 1, {kTfLiteAffineQuantization, const_cast(static_cast(&quant13)) },}, + { kTfLiteInt8, tensor_arena + 16, (TfLiteIntArray*)&tensor_dimension14, 1, {kTfLiteAffineQuantization, const_cast(static_cast(&quant14)) },}, + { kTfLiteInt8, tensor_arena + 0, (TfLiteIntArray*)&tensor_dimension15, 1, {kTfLiteAffineQuantization, const_cast(static_cast(&quant15)) },}, +}; +const NodeInfo_t nodeData[] = { + { (TfLiteIntArray*)&inputs0, (TfLiteIntArray*)&outputs0, const_cast(static_cast(&opdata0)), OP_XC_conv2d_v2, 143, }, + { (TfLiteIntArray*)&inputs1, (TfLiteIntArray*)&outputs1, const_cast(static_cast(&opdata1)), OP_XC_conv2d_v2, 135, }, + { (TfLiteIntArray*)&inputs2, (TfLiteIntArray*)&outputs2, const_cast(static_cast(&opdata2)), OP_XC_conv2d_v2, 135, }, + { (TfLiteIntArray*)&inputs3, (TfLiteIntArray*)&outputs3, const_cast(static_cast(&opdata3)), OP_CONV_2D, 0, }, + { (TfLiteIntArray*)&inputs4, (TfLiteIntArray*)&outputs4, const_cast(static_cast(&opdata4)), OP_RESHAPE, 0, }, + { (TfLiteIntArray*)&inputs5, (TfLiteIntArray*)&outputs5, nullptr, OP_LOGISTIC, 0, }, +}; + +// Scratch buffer variables +int scratch_buffer_idx = 0; +const int scratch_buffer_offsets[3] = { 352, 0, 0 }; +tflite::MicroContext mc; + +// Xcore context and thread variables +xc_context_config_t xc_config; +constexpr int kStackWordsPerThread = 256; +uint64_t xc_stack[kStackWordsPerThread/2]; + +// Functions to be used as function pointers for TfLiteContext and MicroContext +static void* AllocatePersistentBuffer(struct TfLiteContext* ctx, + size_t bytes) { + static uint8_t *AllocPtr = tensor_arena + sizeof(tensor_arena); + + AllocPtr -= bytes; + return AllocPtr; +} + +static TfLiteEvalTensor *GetEvalTensor(const struct TfLiteContext *context, + int tensor_idx) { + return &evalTensors[tensor_idx]; +} + +static TfLiteStatus RequestScratchBufferInArena(struct TfLiteContext *context, size_t bytes, + int *buffer_idx) { + *buffer_idx = scratch_buffer_idx++; + return kTfLiteOk; +}; + +static void *GetScratchBuffer(struct TfLiteContext *context, + int buffer_idx) { + return tensor_arena + scratch_buffer_offsets[buffer_idx]; +} + +static TfLiteTensor* AllocateTempInputTensor(const TfLiteNode* node, int index) { + return &ctx.tensors[node->inputs->data[index]]; +} + +static TfLiteTensor* AllocateTempOutputTensor(const TfLiteNode* node, int index) { + return &ctx.tensors[node->outputs->data[index]]; +} + +static void DeallocateTempTfLiteTensor(TfLiteTensor* tensor) { +} + +static void* external_context() { + return &xc_config; +} + +} // namespace + +TfLiteStatus model_init(void *flash_data) { + // Set flash data in xcore context config + xc_config.flash_data = flash_data; + + // Setup microcontext functions + mc.AllocateTempInputTensor = &AllocateTempInputTensor; + mc.AllocateTempOutputTensor = &AllocateTempOutputTensor; + mc.DeallocateTempTfLiteTensor = &DeallocateTempTfLiteTensor; + mc.external_context = &external_context; + + // Setup tflitecontext functions + ctx.AllocatePersistentBuffer = &AllocatePersistentBuffer; + ctx.GetEvalTensor = &GetEvalTensor; + ctx.RequestScratchBufferInArena = &RequestScratchBufferInArena; + ctx.GetScratchBuffer = &GetScratchBuffer; + + // Set microcontext as the context ptr + ctx.impl_ = (void*)&mc; + ctx.tensors = tflTensors; + ctx.tensors_size = 16; + for(size_t i = 0; i < 16; ++i) { + tflTensors[i].data.data = tensorData[i].data; + evalTensors[i].data.data = tensorData[i].data; + tflTensors[i].type = tensorData[i].type; + evalTensors[i].type = tensorData[i].type; + tflTensors[i].is_variable = 0; + tflTensors[i].allocation_type = (tensor_arena <= tensorData[i].data && tensorData[i].data < tensor_arena + kTensorArenaSize) ? kTfLiteArenaRw : kTfLiteMmapRo; + tflTensors[i].bytes = tensorData[i].bytes; + tflTensors[i].dims = tensorData[i].dims; + evalTensors[i].dims = tensorData[i].dims; + tflTensors[i].quantization = tensorData[i].quantization; + if (tflTensors[i].quantization.type == kTfLiteAffineQuantization) { + TfLiteAffineQuantization const* quant = ((TfLiteAffineQuantization const*)(tensorData[i].quantization.params)); + tflTensors[i].params.scale = quant->scale->data[0]; + tflTensors[i].params.zero_point = quant->zero_point->data[0]; + } + } + registrations[OP_XC_conv2d_v2] = *(tflite::ops::micro::xcore::Register_XC_conv2d_v2()); + registrations[OP_CONV_2D] = tflite::Register_CONV_2D(); + registrations[OP_RESHAPE] = tflite::ops::micro::Register_RESHAPE(); + registrations[OP_LOGISTIC] = tflite::Register_LOGISTIC(); + + for(size_t i = 0; i < 6; ++i) { + tflNodes[i].inputs = nodeData[i].inputs; + tflNodes[i].outputs = nodeData[i].outputs; + tflNodes[i].builtin_data = nodeData[i].builtin_data; + tflNodes[i].custom_initial_data = nullptr; + tflNodes[i].custom_initial_data_size = 0; + if (registrations[nodeData[i].used_op_index].init) { + tflNodes[i].user_data = registrations[nodeData[i].used_op_index].init(&ctx, (const char*)tflNodes[i].builtin_data, nodeData[i].custom_initial_data_size); + } + } + for(size_t i = 0; i < 6; ++i) { + if (registrations[nodeData[i].used_op_index].prepare) { + TfLiteStatus status = registrations[nodeData[i].used_op_index].prepare(&ctx, &tflNodes[i]); + if (status != kTfLiteOk) { + return status; + } + } + } + return kTfLiteOk; +} + +static const int inTensorIndices[] = { + 0, +}; +TfLiteTensor* model_input(int index) { + return &ctx.tensors[inTensorIndices[index]]; +} + +static const int outTensorIndices[] = { + 15, +}; +TfLiteTensor* model_output(int index) { + return &ctx.tensors[outTensorIndices[index]]; +} + +TfLiteStatus model_invoke() { + thread_init_1(&xc_config.thread_info); + xc_config.thread_info.nstackwords = kStackWordsPerThread; + xc_config.thread_info.stacks = &xc_stack[kStackWordsPerThread/2 - 1]; + for(size_t i = 0; i < 6; ++i) { + TfLiteStatus status = registrations[nodeData[i].used_op_index].invoke(&ctx, &tflNodes[i]); + if (status != kTfLiteOk) { + thread_destroy(&xc_config.thread_info); + return status; + } + } + thread_destroy(&xc_config.thread_info); + return kTfLiteOk; +} diff --git a/examples/bare-metal/vnr_test/src/outFile.cpp.h b/examples/bare-metal/vnr_test/src/outFile.cpp.h new file mode 100644 index 000000000..6f71d8ac2 --- /dev/null +++ b/examples/bare-metal/vnr_test/src/outFile.cpp.h @@ -0,0 +1,53 @@ +// This file is generated. Do not edit. +// Generated on: 30.08.2022 11:36:14 + +#ifndef model_GEN_H +#define model_GEN_H + +#include "tensorflow/lite/c/common.h" + +// Sets up the model with init and prepare steps. +TfLiteStatus model_init(void *flash_data = nullptr); +// Returns the input tensor with the given index. +TfLiteTensor *model_input(int index); +// Returns the output tensor with the given index. +TfLiteTensor *model_output(int index); +// Runs inference for the model. +TfLiteStatus model_invoke(); + +// Returns the number of input tensors. +inline size_t model_inputs() { + return 1; +} +// Returns the number of output tensors. +inline size_t model_outputs() { + return 1; +} + +inline void *model_input_ptr(int index) { + return model_input(index)->data.data; +} +inline size_t model_input_size(int index) { + return model_input(index)->bytes; +} +inline int model_input_dims_len(int index) { + return model_input(index)->dims->data[0]; +} +inline int *model_input_dims(int index) { + return &model_input(index)->dims->data[1]; +} + +inline void *model_output_ptr(int index) { + return model_output(index)->data.data; +} +inline size_t model_output_size(int index) { + return model_output(index)->bytes; +} +inline int model_output_dims_len(int index) { + return model_output(index)->dims->data[0]; +} +inline int *model_output_dims(int index) { + return &model_output(index)->dims->data[1]; +} + +#endif diff --git a/examples/bare-metal/vnr_test/src/wrapper.cpp b/examples/bare-metal/vnr_test/src/wrapper.cpp new file mode 100644 index 000000000..88b0f27ef --- /dev/null +++ b/examples/bare-metal/vnr_test/src/wrapper.cpp @@ -0,0 +1,17 @@ +#include "outFile.cpp.h" +#include "wrapper.h" + +void vnr_init() { + model_init(NULL); +} +int8_t* vnr_get_input() { + return model_input(0)->data.int8; +} + +int8_t* vnr_get_output() { + return model_output(0)->data.int8; +} + +void vnr_inference_invoke() { + model_invoke(); +} \ No newline at end of file diff --git a/examples/bare-metal/vnr_test/src/wrapper.h b/examples/bare-metal/vnr_test/src/wrapper.h new file mode 100644 index 000000000..95a75322d --- /dev/null +++ b/examples/bare-metal/vnr_test/src/wrapper.h @@ -0,0 +1,13 @@ +#pragma once + +#include +#ifdef __cplusplus +extern "C" { +#endif + void vnr_init(); + int8_t* vnr_get_input(); + int8_t* vnr_get_output(); + void vnr_inference_invoke(); +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/examples/bare-metal/vnr_test/src/xtflm_conf.h b/examples/bare-metal/vnr_test/src/xtflm_conf.h new file mode 100644 index 000000000..027d13aae --- /dev/null +++ b/examples/bare-metal/vnr_test/src/xtflm_conf.h @@ -0,0 +1,14 @@ +#ifndef _xtflm_conf_h_ +#define _xtflm_conf_h_ + +#define XTFLM_OPERATORS 25 + +#define NETWORK_NUM_THREADS (1) +#define AISRV_GPIO_LENGTH (4) + +#define NUM_OUTPUT_TENSORS (2) +#define NUM_INPUT_TENSORS (1) + +#define MAX_DEBUG_LOG_LENGTH 256 + +#endif \ No newline at end of file diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index c4b903341..32e595b7d 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -6,14 +6,15 @@ if(PROJECT_IS_TOP_LEVEL) endif() endif() -add_subdirectory( lib_vnr ) +#add_subdirectory( lib_vnr ) -add_subdirectory( lib_ns ) +#add_subdirectory( lib_ns ) -add_subdirectory( lib_aec ) +#add_subdirectory( lib_aec ) -add_subdirectory( lib_ic ) +#add_subdirectory( lib_ic ) -add_subdirectory( lib_agc ) +#add_subdirectory( lib_agc ) + +#add_subdirectory( lib_adec ) -add_subdirectory( lib_adec ) diff --git a/xmos_cmake_toolchain b/xmos_cmake_toolchain index 3a19f0284..fa4766744 160000 --- a/xmos_cmake_toolchain +++ b/xmos_cmake_toolchain @@ -1 +1 @@ -Subproject commit 3a19f0284c66a92dbb9d5adc9d3d5016aac22646 +Subproject commit fa476674462ecd5e365e2025d3bc0aa43352805e From d01c9734bb02e020020b23253ae785dcc6d94785 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Fri, 2 Sep 2022 17:27:11 +0100 Subject: [PATCH 02/65] lib_ftl_mcr builds as an interface, lib_vnr as a static library --- examples/bare-metal/CMakeLists.txt | 23 +- .../external_deps/inference/CMakeLists.txt | 124 +-- .../inference/inference_x86.cmake | 203 ---- .../inference/inference_xcore.cmake | 139 --- examples/bare-metal/vnr_test/CMakeLists.txt | 81 -- examples/bare-metal/vnr_test/src/main.c | 11 - examples/bare-metal/vnr_test/src/xtflm_conf.h | 14 - modules/CMakeLists.txt | 12 +- modules/lib_vnr/CMakeLists.txt | 50 +- .../lib_vnr/src/inference/model}/outFile.cpp | 1 + .../src/inference/model}/outFile.cpp.h | 1 + .../src/inference/model/vnr_model_data.c | 882 ------------------ .../src/inference/model/vnr_model_data.h | 10 - .../lib_vnr/src/inference/model}/wrapper.cpp | 3 +- .../lib_vnr/src/inference/model}/wrapper.h | 3 +- .../lib_vnr/src/inference/vnr_inference.cc | 26 +- .../src/inference/vnr_inference_priv.h | 1 - test/lib_vnr/CMakeLists.txt | 29 +- test/lib_vnr/profile_memory/CMakeLists.txt | 16 +- .../build_vnr_feature_extraction.py | 2 +- test/lib_vnr/test_wav_vnr/CMakeLists.txt | 2 +- .../feature_extraction/CMakeLists.txt | 2 +- .../vnr_unit_tests/full/CMakeLists.txt | 2 +- .../vnr_unit_tests/inference/CMakeLists.txt | 2 +- 24 files changed, 102 insertions(+), 1537 deletions(-) delete mode 100644 examples/bare-metal/shared_src/external_deps/inference/inference_x86.cmake delete mode 100644 examples/bare-metal/shared_src/external_deps/inference/inference_xcore.cmake delete mode 100644 examples/bare-metal/vnr_test/CMakeLists.txt delete mode 100644 examples/bare-metal/vnr_test/src/main.c delete mode 100644 examples/bare-metal/vnr_test/src/xtflm_conf.h rename {examples/bare-metal/vnr_test/src => modules/lib_vnr/src/inference/model}/outFile.cpp (99%) rename {examples/bare-metal/vnr_test/src => modules/lib_vnr/src/inference/model}/outFile.cpp.h (99%) delete mode 100644 modules/lib_vnr/src/inference/model/vnr_model_data.c delete mode 100644 modules/lib_vnr/src/inference/model/vnr_model_data.h rename {examples/bare-metal/vnr_test/src => modules/lib_vnr/src/inference/model}/wrapper.cpp (98%) rename {examples/bare-metal/vnr_test/src => modules/lib_vnr/src/inference/model}/wrapper.h (96%) diff --git a/examples/bare-metal/CMakeLists.txt b/examples/bare-metal/CMakeLists.txt index 5c7bb07fb..dd9abe248 100644 --- a/examples/bare-metal/CMakeLists.txt +++ b/examples/bare-metal/CMakeLists.txt @@ -1,25 +1,24 @@ set( CONFIG_XSCOPE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/shared_src/etc ) -#add_subdirectory( shared_src ) +add_subdirectory( shared_src ) -#add_subdirectory( ic ) +add_subdirectory( ic ) -#add_subdirectory( aec_1_thread ) +add_subdirectory( aec_1_thread ) -#add_subdirectory( agc ) +add_subdirectory( agc ) -#add_subdirectory( pipeline_single_threaded ) +add_subdirectory( pipeline_single_threaded ) -#add_subdirectory( vnr ) +add_subdirectory( vnr ) ## Multi thread example builds only on XCORE -#if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) +if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) -# add_subdirectory( aec_2_threads ) + add_subdirectory( aec_2_threads ) -# add_subdirectory( pipeline_multi_threaded ) -#endif() + add_subdirectory( pipeline_multi_threaded ) +endif() -#add_subdirectory( pipeline_alt_arch ) -add_subdirectory(vnr_test) +add_subdirectory( pipeline_alt_arch ) diff --git a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt index 71bf167f9..b9116b489 100644 --- a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt @@ -1,101 +1,53 @@ - +add_library(xcore_sdk_inferencing_lib_tflite_micro INTERFACE) +SET(TOP_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro) +include(${TOP_DIR}/cmakefiles/xtflm.cmake) + +target_sources(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + ${TOP_DIR}/lib_tflite_micro/submodules/flatbuffers/src/util.cpp #link error on x86 + ${TFLM_KERNEL_SOURCES} + ${TFLITE_SOURCES} + ${NN_SOURCES} + ${XTFLIB_KERNEL_SOURCES} + ) if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - - include(inference_xcore.cmake) - -## ********************************** -## Create tflite-micro runtime target -## ********************************** - add_library(xcore_sdk_inferencing_tflite_micro INTERFACE) - target_sources(xcore_sdk_inferencing_tflite_micro - INTERFACE - ${TFLITE_SOURCES} - ) - target_include_directories(xcore_sdk_inferencing_tflite_micro - INTERFACE - ${TFLITE_INCLUDES} - ) - -## Create an alias - add_library(sdk::inferencing::tflite_micro ALIAS xcore_sdk_inferencing_tflite_micro) - -##################################################################################### -## ******************** -## Create lib_nn target -## ******************** - add_library(xcore_sdk_inferencing_lib_nn INTERFACE) - - - target_include_directories(xcore_sdk_inferencing_lib_nn - INTERFACE - ${LIB_NN_INCLUDES} - ) - - target_sources(xcore_sdk_inferencing_lib_nn - INTERFACE - ${LIB_NN_SOURCES} - ) - - ## cmake doesn't recognize .S files as assembly by default + file(GLOB_RECURSE LIB_NN_SOURCES_XCORE_XS3A ${TOP_DIR}/../lib_nn/lib_nn/src/asm/*.S) set_source_files_properties(LIB_NN_SOURCES_XCORE_XS3A PROPERTIES LANGUAGE ASM) - - target_sources(xcore_sdk_inferencing_lib_nn - INTERFACE - ${LIB_NN_SOURCES_XCORE_XS3A} - ) -## Create an alias -add_library(sdk::inferencing::lib_nn ALIAS xcore_sdk_inferencing_lib_nn) - -##################################################################################### - ## ****************************** - ## Create lib_tflite_micro target - ## ****************************** - add_library(xcore_sdk_inferencing_lib_tflite_micro INTERFACE) - - ## Source files + file(GLOB_RECURSE TFLIB_SOURCES_ASM ${TOP_DIR}/lib_tflite_micro/src/*.S) set_source_files_properties(TFLIB_SOURCES_ASM PROPERTIES LANGUAGE ASM) - target_sources(xcore_sdk_inferencing_lib_tflite_micro INTERFACE - ## XCORE implementations + ${LIB_NN_SOURCES_XCORE_XS3A} ${TFLIB_SOURCES_ASM} - ${TFLIB_SOURCES} ) +endif() - target_include_directories(xcore_sdk_inferencing_lib_tflite_micro - INTERFACE - ${TFLIB_INCLUDES} - ) - target_link_libraries(xcore_sdk_inferencing_lib_tflite_micro - INTERFACE - sdk::inferencing::tflite_micro - sdk::inferencing::lib_nn - ) - - ## Create an alias - add_library(sdk::inferencing::lib_tflite_micro ALIAS xcore_sdk_inferencing_lib_tflite_micro) - -else() - - include(inference_x86.cmake) - - ## ****************************** - ## Create lib_tflite_micro target - ## ****************************** - add_library(xcore_sdk_inferencing_lib_tflite_micro INTERFACE) +target_include_directories(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + src + ${ALL_INCLUDES}) - target_sources(xcore_sdk_inferencing_lib_tflite_micro +target_compile_options(xcore_sdk_inferencing_lib_tflite_micro INTERFACE - ## XCORE implementations - ${ALL_SOURCES} + -Os + -g + -mcmodel=large + -Wno-xcore-fptrgroup ) - target_include_directories(xcore_sdk_inferencing_lib_tflite_micro - INTERFACE - ${ALL_INCLUDES} - ) +target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + NO_INTERPRETER + TF_LITE_STATIC_MEMORY=1 + TF_LITE_STRIP_ERROR_STRINGS + __xtflm_conf_h_exists__=1) - ## Create an alias - add_library(sdk::inferencing::lib_tflite_micro ALIAS xcore_sdk_inferencing_lib_tflite_micro) +if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) + set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) + target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + NN_USE_REF) endif() + +add_library(sdk::inferencing::lib_tflite_micro ALIAS xcore_sdk_inferencing_lib_tflite_micro) diff --git a/examples/bare-metal/shared_src/external_deps/inference/inference_x86.cmake b/examples/bare-metal/shared_src/external_deps/inference/inference_x86.cmake deleted file mode 100644 index 251de2d4c..000000000 --- a/examples/bare-metal/shared_src/external_deps/inference/inference_x86.cmake +++ /dev/null @@ -1,203 +0,0 @@ -set(TOP_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps) - -set(NNLIB_DIR "${TOP_DIR}/lib_nn/lib_nn") - -set(TFLIB_DIR - "${TOP_DIR}/lib_tflite_micro/lib_tflite_micro") - -set(TFLITE_SRC_DIR - "${TOP_DIR}/lib_tflite_micro/lib_tflite_micro/submodules/tflite-micro/tensorflow/lite") - -set(TFLIB_SRC_DIR - "${TFLIB_DIR}/src/tflite-xcore-kernels") - -set(XTFLM_SRC_DIR - "${TFLITE_SRC_DIR}/micro") - -set(NN_SRC_DIR - "${NNLIB_DIR}/src") - -file(GLOB_RECURSE ALL_SOURCES "${NN_SRC_DIR}/c/*.c") - -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/c/common.c") - -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/AggregateFn.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/AggregateFn_DW.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/Filter2D.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/MaxPool2d.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/MaxPoolAgg.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/MemCpyFn.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/OutputTransformFn.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/conv2d_utils.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/util.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/geom/Filter2dGeometry.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/geom/ImageGeometry.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/geom/WindowGeometry.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/cpp/filt2d/geom/WindowLocation.cpp") -list(APPEND ALL_SOURCES "${NN_SRC_DIR}/asm/asm_constants.c") - -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/core/api/error_reporter.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/core/api/tensor_utils.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/core/api/flatbuffer_conversions.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/core/api/op_resolver.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/kernels/kernel_util.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/kernels/internal/quantization_util.cc") -list(APPEND ALL_SOURCES "${TFLITE_SRC_DIR}/schema/schema_utils.cc") - -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/../inference_engine.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_bsign.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_conv2d_v2.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_strided_slice.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/../thread_call_host.c") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_custom_options.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_detection_post.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_dispatcher.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_error_reporter.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_interpreter.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_load_from_flash.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_profiler.cc") -list(APPEND ALL_SOURCES "${TFLIB_SRC_DIR}/xcore_utils.cc") - -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/all_ops_resolver.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/flatbuffer_utils.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/memory_helpers.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_error_reporter.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_graph.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_interpreter.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_profiler.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_string.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_time.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_utils.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/mock_micro_graph.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/recording_micro_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/recording_simple_memory_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/simple_memory_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/system_setup.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/all_ops_resolver.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/flatbuffer_utils.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/memory_helpers.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_error_reporter.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_graph.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_interpreter.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_profiler.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_resource_variable.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_string.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_time.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/micro_utils.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/mock_micro_graph.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/recording_micro_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/recording_simple_memory_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/simple_memory_allocator.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/system_setup.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/test_helpers.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/memory_planner/greedy_memory_planner.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/activations.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/activations_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/add.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/add_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/add_n.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/slice.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/arg_min_max.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/assign_variable.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/batch_to_space_nd.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/call_once.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/cast.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/ceil.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/circular_buffer.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/circular_buffer_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/circular_buffer_flexbuffers_generated_data.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/comparisons.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/concatenation.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/conv.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/conv_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/cumsum.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/depth_to_space.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/depthwise_conv.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/depthwise_conv_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/dequantize.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/dequantize_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/detection_postprocess_flexbuffers_generated_data.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/elementwise.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/elu.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/ethosu.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/exp.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/expand_dims.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/fill.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/floor.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/floor_div.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/floor_mod.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/fully_connected.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/fully_connected_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/gather.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/gather_nd.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/hard_swish.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/hard_swish_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/if.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/kernel_runner.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/kernel_util.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/l2_pool_2d.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/l2norm.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/leaky_relu.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/leaky_relu_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/log_softmax.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/logical.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/logical_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/logistic.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/logistic_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/maximum_minimum.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/mul.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/mul_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/neg.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/pack.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/pad.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/pooling.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/pooling_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/prelu.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/prelu_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/quantize.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/quantize_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/read_variable.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/reduce.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/reshape.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/resize_bilinear.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/resize_nearest_neighbor.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/round.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/shape.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/softmax.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/softmax_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/space_to_batch_nd.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/space_to_depth.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/split.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/split_v.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/squeeze.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/strided_slice.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/sub.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/sub_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/svdf.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/svdf_common.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/tanh.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/transpose.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/transpose_conv.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/unpack.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/var_handle.cc") -list(APPEND ALL_SOURCES "${XTFLM_SRC_DIR}/kernels/zeros_like.cc") - -list(APPEND ALL_SOURCES "${TOP_DIR}/lib_tflite_micro/lib_tflite_micro/submodules/flatbuffers/src/util.cpp") - -set(ALL_INCLUDES "") - -list(APPEND ALL_INCLUDES ${XCORE_INTERPRETER_INCLUDES}) -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/src/tflite-xcore-kernels") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/api") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/submodules/tflite-micro") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/submodules/gemmlowp") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/submodules/ruy") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/submodules/flatbuffers/include") -list(APPEND ALL_INCLUDES "${TFLIB_DIR}/..") -list(APPEND ALL_INCLUDES "${NNLIB_DIR}/api") -list(APPEND ALL_INCLUDES "${NNLIB_DIR}/..") -list(APPEND ALL_INCLUDES "${XMOS_TOOL_PATH}/target/include/") - - diff --git a/examples/bare-metal/shared_src/external_deps/inference/inference_xcore.cmake b/examples/bare-metal/shared_src/external_deps/inference/inference_xcore.cmake deleted file mode 100644 index 041a217a9..000000000 --- a/examples/bare-metal/shared_src/external_deps/inference/inference_xcore.cmake +++ /dev/null @@ -1,139 +0,0 @@ - -set(TOP_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps) - -set(NNLIB_DIR "${TOP_DIR}/lib_nn/lib_nn") - -set(TFLIB_DIR - "${TOP_DIR}/lib_tflite_micro/lib_tflite_micro") - -set(TFLITE_SRC_DIR - "${TOP_DIR}/lib_tflite_micro/lib_tflite_micro/submodules/tflite-micro/tensorflow/lite") - -set(TFLIB_SRC_DIR - "${TFLIB_DIR}/src/tflite-xcore-kernels") - - -unset(LIB_NN_SOURCES) -file(GLOB_RECURSE LIB_NN_SOURCES_XCORE_XS3A ${NNLIB_DIR}/src/asm/*.S) -file(GLOB_RECURSE LIB_NN_SOURCES_C ${NNLIB_DIR}/src/c/*.c) -file(GLOB_RECURSE LIB_NN_SOURCES_CPP ${NNLIB_DIR}/src/cpp/*.cpp) -list(APPEND LIB_NN_SOURCES ${LIB_NN_SOURCES_C} ${LIB_NN_SOURCES_CPP}) - -unset(LIB_NN_INCLUDES) -list(APPEND LIB_NN_INCLUDES ${NNLIB_DIR}/api) -list(APPEND LIB_NN_INCLUDES ${NNLIB_DIR}/..) - -unset(TFLITE_SOURCES) -## tflite-micro runtime sources -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/c/common.c) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/core/api/error_reporter.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/core/api/flatbuffer_conversions.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/core/api/op_resolver.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/core/api/tensor_utils.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/kernels/kernel_util.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/kernels/internal/quantization_util.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/flatbuffer_utils.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/memory_helpers.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_allocator.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_error_reporter.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_graph.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_interpreter.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_profiler.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_utils.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/micro_string.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/recording_micro_allocator.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/recording_simple_memory_allocator.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/simple_memory_allocator.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/memory_planner/greedy_memory_planner.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/memory_planner/linear_memory_planner.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/schema/schema_utils.cc) -## tflite-micro operator sources -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/fully_connected_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/kernel_util.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/quantize_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/activations.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/add.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/add_n.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/arg_min_max.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/ceil.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/circular_buffer.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/comparisons.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/concatenation.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/conv.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/conv_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/cumsum.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/depthwise_conv.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/depthwise_conv_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/dequantize.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/detection_postprocess.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/elementwise.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/elu.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/floor.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/fully_connected.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/l2norm.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/logical.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/logistic.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/maximum_minimum.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/mul.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/neg.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/pack.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/pad.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/pooling.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/prelu.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/quantize.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/reduce.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/reshape.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/shape.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/resize_nearest_neighbor.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/round.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/split.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/split_v.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/squeeze.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/strided_slice.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/sub.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/svdf.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/svdf_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/tanh.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/unpack.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/hard_swish.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/floor_div.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/floor_mod.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/l2_pool_2d.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/leaky_relu.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/depth_to_space.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/transpose_conv.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/resize_bilinear.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/batch_to_space_nd.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/space_to_batch_nd.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/transpose.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/pooling_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/expand_dims.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/space_to_depth.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/circular_buffer.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/activations_common.cc) -list(APPEND TFLITE_SOURCES ${TFLITE_SRC_DIR}/micro/kernels/logistic_common.cc) - -unset(TFLITE_INCLUDES) -list(APPEND TFLITE_INCLUDES "${TFLIB_DIR}/submodules/tflite-micro") -list(APPEND TFLITE_INCLUDES "${TFLIB_DIR}/submodules/gemmlowp") -list(APPEND TFLITE_INCLUDES "${TFLIB_DIR}/submodules/ruy") -list(APPEND TFLITE_INCLUDES "${TFLIB_DIR}/submodules/flatbuffers/include") - -unset(TFLIB_SOURCES) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/micro_time.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/../inference_engine.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_bsign.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_custom_options.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_conv2d_v2.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_error_reporter.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_interpreter.cc) -list(APPEND TFLIB_SOURCES ${TFLIB_SRC_DIR}/xcore_profiler.cc) - -file(GLOB_RECURSE TFLIB_SOURCES_ASM ${TFLIB_DIR}/src/*.S) - -unset(TFLIB_INCLUDES) -list(APPEND TFLIB_INCLUDES ${TFLIB_DIR}/..) -list(APPEND TFLIB_INCLUDES ${TFLIB_DIR}/api) -list(APPEND TFLIB_INCLUDES ${TFLIB_DIR}/src) -list(APPEND TFLIB_INCLUDES ${TFLIB_DIR}/src/tflite-xcore-kernels) - diff --git a/examples/bare-metal/vnr_test/CMakeLists.txt b/examples/bare-metal/vnr_test/CMakeLists.txt deleted file mode 100644 index 8a101337d..000000000 --- a/examples/bare-metal/vnr_test/CMakeLists.txt +++ /dev/null @@ -1,81 +0,0 @@ -add_library(tflite_test_lib STATIC) -SET(TOP_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro) -include(${TOP_DIR}/cmakefiles/xtflm.cmake) - -file(GLOB_RECURSE TEST_SOURCES src/*.cpp) -target_sources(tflite_test_lib - PRIVATE - ${TEST_SOURCES} - ${TFLM_KERNEL_SOURCES} - ${TFLITE_SOURCES} - ${NN_SOURCES} - ${XTFLIB_KERNEL_SOURCES} - ) - -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - file(GLOB_RECURSE LIB_NN_SOURCES_XCORE_XS3A ${TOP_DIR}/../lib_nn/lib_nn/src/asm/*.S) - set_source_files_properties(LIB_NN_SOURCES_XCORE_XS3A PROPERTIES LANGUAGE ASM) - file(GLOB_RECURSE TFLIB_SOURCES_ASM ${TOP_DIR}/lib_tflite_micro/src/*.S) - set_source_files_properties(TFLIB_SOURCES_ASM PROPERTIES LANGUAGE ASM) - target_sources(tflite_test_lib - PRIVATE - ${LIB_NN_SOURCES_XCORE_XS3A} - ${TFLIB_SOURCES_ASM} - ) -endif() - -target_include_directories(tflite_test_lib - PUBLIC - src - ${ALL_INCLUDES}) - -target_compile_options(tflite_test_lib - PRIVATE - -Os - -g - -mcmodel=large - -Wno-xcore-fptrgroup - ) - -target_compile_definitions(tflite_test_lib - PRIVATE - NO_INTERPRETER - TF_LITE_STATIC_MEMORY=1 - TF_LITE_STRIP_ERROR_STRINGS - __xtflm_conf_h_exists__=1) - -if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) - target_compile_definitions(tflite_test_lib - PRIVATE - NN_USE_REF) -endif() - - -############################## - -add_executable(tflite_test_app) - -target_sources(tflite_test_app - PRIVATE - src/main.c - ) -target_include_directories(tflite_test_app - PRIVATE - src) - -target_link_libraries(tflite_test_app - PUBLIC - tflite_test_lib) - -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) -target_link_options(tflite_test_app - PRIVATE - -w - "-target=${XCORE_TARGET}" - "-report" - "${CONFIG_XSCOPE_PATH}/config.xscope") -else() -target_link_libraries(tflite_test_app - PRIVATE m) -endif() diff --git a/examples/bare-metal/vnr_test/src/main.c b/examples/bare-metal/vnr_test/src/main.c deleted file mode 100644 index 3fed4d9d3..000000000 --- a/examples/bare-metal/vnr_test/src/main.c +++ /dev/null @@ -1,11 +0,0 @@ - -#include -#include "wrapper.h" - -int main(int argc, char **argv) { - vnr_init(); - while(1) { - vnr_inference_invoke(); - } - return 0; -} diff --git a/examples/bare-metal/vnr_test/src/xtflm_conf.h b/examples/bare-metal/vnr_test/src/xtflm_conf.h deleted file mode 100644 index 027d13aae..000000000 --- a/examples/bare-metal/vnr_test/src/xtflm_conf.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _xtflm_conf_h_ -#define _xtflm_conf_h_ - -#define XTFLM_OPERATORS 25 - -#define NETWORK_NUM_THREADS (1) -#define AISRV_GPIO_LENGTH (4) - -#define NUM_OUTPUT_TENSORS (2) -#define NUM_INPUT_TENSORS (1) - -#define MAX_DEBUG_LOG_LENGTH 256 - -#endif \ No newline at end of file diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 32e595b7d..3fab4bcd2 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -6,15 +6,15 @@ if(PROJECT_IS_TOP_LEVEL) endif() endif() -#add_subdirectory( lib_vnr ) +add_subdirectory( lib_vnr ) -#add_subdirectory( lib_ns ) +add_subdirectory( lib_ns ) -#add_subdirectory( lib_aec ) +add_subdirectory( lib_aec ) -#add_subdirectory( lib_ic ) +add_subdirectory( lib_ic ) -#add_subdirectory( lib_agc ) +add_subdirectory( lib_agc ) -#add_subdirectory( lib_adec ) +add_subdirectory( lib_adec ) diff --git a/modules/lib_vnr/CMakeLists.txt b/modules/lib_vnr/CMakeLists.txt index a7b618596..df94d8a0f 100644 --- a/modules/lib_vnr/CMakeLists.txt +++ b/modules/lib_vnr/CMakeLists.txt @@ -1,48 +1,18 @@ ## VNR Inference -add_library(fwk_voice_module_lib_vnr_inference INTERFACE) -file(GLOB_RECURSE VNR_INFERENCE_SOURCES src/inference/*.c src/inference/*.cc) -target_sources(fwk_voice_module_lib_vnr_inference INTERFACE ${VNR_INFERENCE_SOURCES}) -target_include_directories(fwk_voice_module_lib_vnr_inference INTERFACE api/common api/inference) -target_link_libraries(fwk_voice_module_lib_vnr_inference - INTERFACE - core::xs3_math - ) -target_link_libraries(fwk_voice_module_lib_vnr_inference - INTERFACE - sdk::inferencing::lib_tflite_micro - ) +add_library(fwk_voice_module_lib_vnr_inference STATIC) -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - # lib_tflite_micro compilation is dependant on the HW target which is why we don't build fwk_voice::vnr::inference as a static library - target_compile_options(fwk_voice_module_lib_vnr_inference - INTERFACE - -Os - -g - -mcmodel=large - -Wno-xcore-fptrgroup - ) +file(GLOB_RECURSE VNR_INFERENCE_SOURCES src/inference/model/*.cpp src/inference/*.cc) - target_compile_definitions(fwk_voice_module_lib_vnr_inference - INTERFACE - TF_LITE_STATIC_MEMORY=1 - TF_LITE_STRIP_ERROR_STRINGS=1 - __xtflm_conf_h_exists__=1 - ) -else() - set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) +target_sources(fwk_voice_module_lib_vnr_inference PRIVATE ${VNR_INFERENCE_SOURCES}) - set(BUILD_FLAGS - "-Os" - "-g" - "-D__xtflm_conf_h_exists__" - "-DNN_USE_REF" - ) - target_compile_options(fwk_voice_module_lib_vnr_inference - INTERFACE - ${BUILD_FLAGS} - ) -endif() +target_include_directories(fwk_voice_module_lib_vnr_inference PUBLIC api/common api/inference) + +target_link_libraries(fwk_voice_module_lib_vnr_inference + PUBLIC + sdk::inferencing::lib_tflite_micro + core::xs3_math + ) add_library(fwk_voice::vnr::inference ALIAS fwk_voice_module_lib_vnr_inference) diff --git a/examples/bare-metal/vnr_test/src/outFile.cpp b/modules/lib_vnr/src/inference/model/outFile.cpp similarity index 99% rename from examples/bare-metal/vnr_test/src/outFile.cpp rename to modules/lib_vnr/src/inference/model/outFile.cpp index 6fe91e557..062a22535 100644 --- a/examples/bare-metal/vnr_test/src/outFile.cpp +++ b/modules/lib_vnr/src/inference/model/outFile.cpp @@ -1121,3 +1121,4 @@ TfLiteStatus model_invoke() { thread_destroy(&xc_config.thread_info); return kTfLiteOk; } + diff --git a/examples/bare-metal/vnr_test/src/outFile.cpp.h b/modules/lib_vnr/src/inference/model/outFile.cpp.h similarity index 99% rename from examples/bare-metal/vnr_test/src/outFile.cpp.h rename to modules/lib_vnr/src/inference/model/outFile.cpp.h index 6f71d8ac2..8e30e370b 100644 --- a/examples/bare-metal/vnr_test/src/outFile.cpp.h +++ b/modules/lib_vnr/src/inference/model/outFile.cpp.h @@ -51,3 +51,4 @@ inline int *model_output_dims(int index) { } #endif + diff --git a/modules/lib_vnr/src/inference/model/vnr_model_data.c b/modules/lib_vnr/src/inference/model/vnr_model_data.c deleted file mode 100644 index a48476bfa..000000000 --- a/modules/lib_vnr/src/inference/model/vnr_model_data.c +++ /dev/null @@ -1,882 +0,0 @@ -// This is a TensorFlow Lite model file that has been converted into a C data -// array using the convert_tflite_to_c_source() tool. - -#if( USE_SWMEM == 1) -__attribute__((section(".SwMem_data"))) -#elif( USE_EXTMEM == 1) -__attribute__((section(".ExtMem_data"))) -#endif -const unsigned char vnr_model_data[] __attribute__((aligned(4))) = { - 0x20, 0x00, 0x00, 0x00, 0x54, 0x46, 0x4c, 0x33, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x00, 0x20, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x1c, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x70, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0xb4, 0x01, 0x00, 0x00, - 0x0c, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x13, - 0x00, 0x00, 0x00, 0xe0, 0x2b, 0x00, 0x00, 0xdc, 0x2b, 0x00, 0x00, 0x68, 0x2a, - 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x64, 0x19, 0x00, 0x00, 0x28, 0x11, 0x00, - 0x00, 0xec, 0x0f, 0x00, 0x00, 0x30, 0x09, 0x00, 0x00, 0xe4, 0x08, 0x00, 0x00, - 0xbc, 0x2b, 0x00, 0x00, 0xb8, 0x2b, 0x00, 0x00, 0xf8, 0x05, 0x00, 0x00, 0xb0, - 0x2b, 0x00, 0x00, 0x50, 0x04, 0x00, 0x00, 0xa8, 0x2b, 0x00, 0x00, 0xa4, 0x2b, - 0x00, 0x00, 0xa0, 0x2b, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0xd4, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x74, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x1c, 0x08, 0x00, 0x00, 0xac, 0x03, 0x00, 0x00, 0xd0, 0x02, 0x00, 0x00, 0x14, - 0x02, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x08, 0x00, 0x04, 0x00, 0x0a, 0x00, 0x00, - 0x00, 0x0c, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x0f, 0x00, 0x00, 0x00, 0x73, 0x65, 0x72, 0x76, 0x69, 0x6e, 0x67, 0x5f, 0x64, - 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, - 0x00, 0x08, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x61, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x32, 0x00, 0x00, 0x00, 0x00, 0x6e, 0xd6, - 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x69, 0x6e, 0x70, - 0x75, 0x74, 0x5f, 0x31, 0x00, 0x02, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0xa0, 0xff, 0xff, 0xff, 0x08, 0x00, 0x00, 0x00, 0x12, - 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x78, 0x63, 0x6f, 0x72, 0x65, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x00, 0x00, - 0x00, 0xb2, 0xd6, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, - 0x6e, 0x87, 0xfa, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x0c, 0x00, - 0x04, 0x00, 0x08, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x11, - 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x6d, 0x69, 0x6e, 0x5f, 0x72, 0x75, - 0x6e, 0x74, 0x69, 0x6d, 0x65, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, - 0x00, 0x1a, 0xd7, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, - 0x31, 0x2e, 0x31, 0x34, 0x2e, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x4d, 0x4c, 0x49, 0x52, 0x20, 0x43, - 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x65, 0x64, 0x2e, 0x00, 0x00, 0x00, 0x0e, - 0x00, 0x18, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, - 0x0e, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x34, - 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, - 0x00, 0xc0, 0x05, 0x00, 0x00, 0x8c, 0x04, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, - 0xb8, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x34, 0x29, 0x00, 0x00, 0xf0, 0x28, 0x00, - 0x00, 0x18, 0x28, 0x00, 0x00, 0xdc, 0x17, 0x00, 0x00, 0x20, 0x17, 0x00, 0x00, - 0xe4, 0x0e, 0x00, 0x00, 0xa8, 0x0d, 0x00, 0x00, 0xec, 0x06, 0x00, 0x00, 0x60, - 0x06, 0x00, 0x00, 0xf4, 0x04, 0x00, 0x00, 0xf4, 0x03, 0x00, 0x00, 0x74, 0x03, - 0x00, 0x00, 0x68, 0x02, 0x00, 0x00, 0xcc, 0x01, 0x00, 0x00, 0xf0, 0x00, 0x00, - 0x00, 0x34, 0x00, 0x00, 0x00, 0x56, 0xff, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x7c, 0xfe, - 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, - 0x00, 0x50, 0xd7, 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x40, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, - 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x53, 0x74, 0x61, 0x74, 0x65, 0x66, 0x75, - 0x6c, 0x50, 0x61, 0x72, 0x74, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x65, 0x64, 0x43, - 0x61, 0x6c, 0x6c, 0x3a, 0x30, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2c, 0xd7, 0xff, 0xff, 0x18, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x80, 0x3b, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x08, - 0x00, 0x0c, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, - 0x34, 0xff, 0xff, 0xff, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x01, - 0x00, 0x00, 0x00, 0x08, 0xd8, 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x28, 0x00, - 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xcc, 0xd7, - 0xff, 0xff, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x6b, 0x03, 0x30, 0x3e, 0x00, 0x00, 0x0e, 0x00, 0x1a, - 0x00, 0x08, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x07, 0x00, 0x14, 0x00, 0x0e, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, - 0x00, 0x24, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, - 0x10, 0x00, 0x0f, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, - 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, - 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, - 0x0b, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0xe0, 0xd8, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x30, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x43, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb4, 0xd8, 0xff, 0xff, - 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1f, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x6b, 0x03, - 0x30, 0x3e, 0x1a, 0xda, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, - 0x00, 0xbb, 0xe1, 0x49, 0xb7, 0xb8, 0xbd, 0x40, 0x4e, 0xd1, 0xa8, 0x34, 0xae, - 0xd6, 0x96, 0x15, 0x9d, 0x39, 0xd2, 0xbc, 0xd5, 0x5f, 0xc0, 0x4c, 0xa4, 0xa9, - 0x37, 0x81, 0xe4, 0x5d, 0x4c, 0x58, 0x24, 0xb2, 0xd9, 0xff, 0xff, 0x00, 0x00, - 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x42, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x34, 0xd9, 0xff, 0xff, 0x14, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x8a, 0x27, 0x95, 0x39, - 0x68, 0xfd, 0xff, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x6b, 0x74, 0x00, 0x6d, 0x70, 0x00, - 0x08, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x61, 0x67, 0x67, - 0x70, 0x00, 0x18, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x6f, 0x74, 0x70, 0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, - 0xfc, 0xff, 0x00, 0x73, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x00, 0x61, 0x6b, - 0x70, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x22, 0x14, - 0x06, 0x5f, 0x2b, 0x71, 0x6f, 0x44, 0x37, 0x06, 0x01, 0x06, 0x62, 0x0d, 0x00, - 0x74, 0x48, 0x00, 0x14, 0x28, 0x04, 0x14, 0x14, 0x04, 0x0c, 0x24, 0x01, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, - 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xda, - 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x30, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x41, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x54, 0xda, 0xff, 0xff, - 0x14, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x1d, 0x97, - 0x4b, 0x3f, 0xba, 0xdb, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x61, 0x03, 0x00, 0x00, 0x36, 0xdb, 0xff, 0xff, 0x00, 0x00, 0x00, 0x02, - 0x18, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xac, 0xda, 0xff, 0xff, 0x14, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xcb, 0x3c, 0x6d, 0x39, 0xe0, - 0xfe, 0xff, 0xff, 0xa0, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x6b, 0x74, 0x00, 0x6d, 0x70, 0x00, 0x08, - 0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x61, 0x67, 0x67, 0x70, - 0x00, 0x18, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, - 0x00, 0x6f, 0x74, 0x70, 0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x03, 0x00, 0xf9, - 0xff, 0x00, 0x73, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x00, 0x61, 0x6b, 0x70, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x22, 0x14, 0x06, - 0x5f, 0x2b, 0x71, 0x6f, 0x44, 0x37, 0x06, 0x01, 0x06, 0x62, 0x0d, 0x00, 0x74, - 0x48, 0x00, 0x14, 0x28, 0x04, 0x14, 0x14, 0x04, 0x0c, 0x24, 0x01, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0xdb, 0xff, - 0xff, 0x00, 0x00, 0x00, 0x09, 0x30, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, - 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0xcc, 0xdb, 0xff, 0xff, 0x14, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, - 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x93, 0xaa, - 0x3e, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x00, 0x00, 0xa8, 0x00, 0x00, 0x00, 0x9c, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x6b, 0x74, - 0x00, 0x6d, 0x70, 0x00, 0x20, 0x60, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, - 0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0xff, 0x48, 0x00, 0x00, 0x00, 0x00, 0x61, - 0x67, 0x67, 0x70, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, - 0x00, 0x6f, 0x74, 0x70, 0x00, 0x08, 0x40, 0x00, 0x00, 0x00, 0x03, 0x00, 0xfb, - 0xff, 0x00, 0x73, 0x63, 0x72, 0x61, 0x74, 0x63, 0x68, 0x00, 0x61, 0x6b, 0x70, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x01, 0x22, 0x14, 0x06, - 0x4f, 0x2b, 0x79, 0x77, 0x44, 0x37, 0x06, 0x01, 0x06, 0x52, 0x0d, 0x01, 0x7c, - 0x48, 0x40, 0x14, 0x28, 0x04, 0x14, 0x14, 0x04, 0x0c, 0x24, 0x01, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x10, - 0x00, 0x0f, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x0c, - 0x00, 0x00, 0x00, 0x58, 0x43, 0x5f, 0x63, 0x6f, 0x6e, 0x76, 0x32, 0x64, 0x5f, - 0x76, 0x32, 0x00, 0x00, 0x00, 0x00, 0x60, 0xdd, 0xff, 0xff, 0x00, 0x00, 0x00, - 0x09, 0x30, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, - 0x38, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x34, 0xdd, 0xff, 0xff, 0x14, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x80, 0xff, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x0c, 0xe8, 0x76, 0x3e, 0x9a, 0xde, 0xff, - 0xff, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, - 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, - 0xde, 0xff, 0xff, 0x00, 0x00, 0x00, 0x04, 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x36, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, - 0x6c, 0xdd, 0xff, 0xff, 0xe2, 0xde, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x80, - 0x06, 0x00, 0x00, 0xf5, 0x13, 0xed, 0x0c, 0xfa, 0xfe, 0xea, 0xfa, 0x42, 0x0e, - 0x17, 0x17, 0xea, 0x81, 0x9e, 0xfa, 0x2e, 0x35, 0x52, 0x60, 0xbf, 0xa6, 0xe6, - 0x3b, 0xde, 0x4b, 0x81, 0x4e, 0xc2, 0x1b, 0x40, 0x50, 0x1a, 0x31, 0x29, 0x13, - 0x0d, 0xfd, 0xf0, 0x21, 0xdf, 0xfe, 0xa3, 0xf5, 0x3a, 0xff, 0xe7, 0x0b, 0x37, - 0x4a, 0x1e, 0x5e, 0xdb, 0xfd, 0x1f, 0xfa, 0xd4, 0x16, 0x23, 0x20, 0xed, 0x35, - 0xbd, 0x53, 0xd7, 0xfb, 0x7f, 0x46, 0x5b, 0x11, 0x42, 0xf3, 0x06, 0xfc, 0x02, - 0x16, 0x00, 0x0b, 0x06, 0xec, 0xf3, 0x09, 0xf4, 0xf7, 0x0b, 0xd4, 0xd6, 0x23, - 0x81, 0x93, 0x44, 0x46, 0x07, 0x55, 0xf2, 0x22, 0x49, 0xad, 0x9c, 0x81, 0xd0, - 0x3e, 0x45, 0x24, 0x28, 0xf6, 0x39, 0xb9, 0xd1, 0x68, 0x5b, 0x0d, 0x44, 0x0b, - 0x4a, 0x56, 0xf4, 0xb4, 0xf9, 0xbc, 0xef, 0x1e, 0x0e, 0x04, 0x0e, 0x3a, 0x0a, - 0x15, 0xda, 0x81, 0x86, 0xf8, 0x43, 0x29, 0x18, 0x2a, 0x06, 0xea, 0x00, 0xdb, - 0x20, 0xdb, 0x1d, 0x0d, 0xfa, 0x0b, 0x00, 0xfa, 0x0b, 0x10, 0xff, 0xfe, 0x09, - 0x0f, 0x16, 0x05, 0x1c, 0xfd, 0x81, 0x04, 0x26, 0xdf, 0x19, 0xef, 0x00, 0x1c, - 0xeb, 0x09, 0xce, 0x7e, 0x5f, 0x68, 0x69, 0x59, 0xdf, 0xcd, 0x7f, 0xc1, 0x57, - 0xf0, 0x62, 0xdf, 0xf1, 0x06, 0x5c, 0x52, 0x5b, 0x06, 0x7f, 0xb4, 0x7c, 0x03, - 0xfe, 0x00, 0x0d, 0x08, 0xe6, 0xea, 0x06, 0x3d, 0x28, 0xd5, 0xc2, 0x11, 0x7f, - 0x8f, 0xe5, 0x1f, 0xfd, 0x49, 0xbc, 0xc4, 0x09, 0xc7, 0xe8, 0x77, 0x2e, 0x97, - 0x7f, 0xae, 0xfd, 0x14, 0x09, 0x08, 0xfd, 0xf5, 0x03, 0xff, 0x03, 0xf1, 0xf7, - 0x06, 0x10, 0xfa, 0xfd, 0xf0, 0x0b, 0xfa, 0x06, 0x03, 0x29, 0xc1, 0x34, 0xb2, - 0x31, 0x3f, 0x2f, 0x1b, 0xec, 0x0c, 0x09, 0xfa, 0x2d, 0x1e, 0x10, 0xbf, 0x3f, - 0xfc, 0x8a, 0x25, 0xcb, 0x81, 0x33, 0x2b, 0xf5, 0x0e, 0xea, 0x06, 0x02, 0x0b, - 0xf5, 0xf2, 0x0d, 0x0f, 0x00, 0xfc, 0x29, 0xe2, 0x12, 0x49, 0xc2, 0xb1, 0x35, - 0x4c, 0xe4, 0x81, 0xea, 0x4d, 0x25, 0x70, 0x6e, 0x18, 0x70, 0x52, 0x07, 0x7c, - 0xe3, 0x61, 0x7f, 0xc9, 0xf5, 0xe2, 0xa8, 0x7d, 0xb7, 0x99, 0x19, 0x6b, 0x58, - 0x03, 0xef, 0x5d, 0x29, 0x55, 0xfa, 0x4a, 0x5a, 0xba, 0x12, 0xef, 0x7c, 0xac, - 0xfc, 0x44, 0x50, 0xd9, 0xba, 0x7f, 0x3c, 0x51, 0x9c, 0x3f, 0x2d, 0x34, 0xb1, - 0x54, 0xfc, 0x0e, 0xf9, 0xef, 0x15, 0x2f, 0xf7, 0xf4, 0xcf, 0x06, 0x3d, 0x23, - 0xcb, 0x42, 0xf1, 0x81, 0x0b, 0x21, 0xfd, 0xfc, 0x20, 0xe1, 0x10, 0xf9, 0xff, - 0xf8, 0xf8, 0xf3, 0xf1, 0xf8, 0xfa, 0xf0, 0x03, 0x04, 0x10, 0x10, 0xf9, 0x4e, - 0xfa, 0x81, 0x05, 0x18, 0x20, 0xe8, 0xe2, 0xf1, 0x14, 0x08, 0xfa, 0x08, 0x01, - 0x00, 0xff, 0x05, 0xfe, 0xf9, 0xf9, 0xfe, 0x28, 0x37, 0xd3, 0x81, 0x24, 0x3b, - 0xe8, 0x11, 0x01, 0xe9, 0x0e, 0xf5, 0x13, 0xfc, 0x05, 0xf2, 0xf6, 0xf2, 0x07, - 0xfe, 0xfe, 0xe6, 0x06, 0xe5, 0xf2, 0x0a, 0x20, 0xca, 0xe4, 0xf9, 0xf4, 0x51, - 0x11, 0x77, 0x52, 0x33, 0x81, 0x88, 0x08, 0xef, 0x07, 0xd6, 0xeb, 0xed, 0xe5, - 0xcf, 0x81, 0x67, 0x38, 0x14, 0xfd, 0x11, 0x0d, 0x41, 0xd4, 0x22, 0x04, 0xce, - 0x0f, 0x0b, 0x16, 0xfa, 0x06, 0x04, 0xbe, 0x1b, 0x13, 0xf3, 0x1b, 0xd8, 0xd7, - 0xf5, 0x08, 0xf8, 0xd6, 0xa9, 0xaa, 0xeb, 0x34, 0x25, 0x4f, 0x47, 0x09, 0x2f, - 0xcc, 0x7f, 0xfe, 0x18, 0x68, 0x69, 0xde, 0xc3, 0x47, 0xa5, 0x2c, 0x77, 0x7f, - 0x34, 0x3b, 0x4b, 0x7f, 0x6c, 0x23, 0x75, 0xe1, 0x02, 0x3a, 0xff, 0x70, 0xdf, - 0x7f, 0xc2, 0xf4, 0x0e, 0xef, 0x0a, 0xfb, 0xfb, 0xf8, 0x05, 0xfe, 0x07, 0xf6, - 0x03, 0xf6, 0x09, 0x04, 0xf2, 0x0d, 0xfe, 0xf9, 0x14, 0xf5, 0xff, 0x63, 0x70, - 0x40, 0x57, 0xd0, 0xe7, 0x43, 0x7f, 0x71, 0xe5, 0xef, 0x7b, 0xe6, 0xd5, 0x78, - 0x45, 0x7c, 0x31, 0xd3, 0x3c, 0x2e, 0x13, 0x3f, 0xa7, 0x03, 0x07, 0x27, 0x46, - 0x78, 0x2b, 0x90, 0x81, 0xb1, 0xde, 0x26, 0x21, 0x13, 0xe2, 0x3c, 0x0c, 0xf5, - 0x13, 0xe8, 0x1f, 0xed, 0xc5, 0x40, 0xf0, 0x0b, 0xfc, 0x70, 0x57, 0xa9, 0x40, - 0x44, 0x07, 0x7f, 0x43, 0x0b, 0xcb, 0x74, 0xc4, 0xad, 0x78, 0x95, 0x02, 0x3f, - 0x0f, 0x33, 0x4a, 0x6e, 0x47, 0x01, 0xfd, 0xf7, 0x07, 0xee, 0xc2, 0x59, 0x2c, - 0xdc, 0xa1, 0x7f, 0xfb, 0xad, 0x51, 0xcc, 0x13, 0x04, 0xe6, 0x21, 0x0b, 0xf4, - 0xfc, 0xef, 0x13, 0xee, 0x22, 0x2c, 0x2d, 0x0e, 0xe3, 0x2d, 0x13, 0xd7, 0xeb, - 0x09, 0x0d, 0xf9, 0x14, 0xf0, 0xfd, 0xfc, 0x47, 0xfd, 0xf3, 0xe0, 0xfc, 0x81, - 0x05, 0xfa, 0xf2, 0x81, 0xc4, 0xf8, 0xe5, 0xa5, 0xc2, 0xcf, 0xec, 0x0a, 0x1a, - 0xee, 0xd9, 0xfa, 0x44, 0x1d, 0xff, 0x12, 0x29, 0x3c, 0x18, 0xeb, 0x0e, 0xf7, - 0x1b, 0xfb, 0xf8, 0x0f, 0x24, 0x07, 0x18, 0x1b, 0x33, 0x38, 0xe8, 0x81, 0xbd, - 0x1a, 0xfb, 0xfa, 0x1f, 0xf5, 0x08, 0x06, 0xe0, 0x32, 0xe4, 0xe2, 0x14, 0x74, - 0x55, 0xd5, 0xc1, 0x28, 0x71, 0x62, 0x0a, 0x28, 0x1d, 0x02, 0xe1, 0x54, 0xdc, - 0xea, 0x7f, 0x2c, 0xea, 0x65, 0xe1, 0x10, 0x6f, 0xff, 0x0c, 0xdf, 0xfe, 0xfb, - 0xd2, 0xc5, 0xf2, 0xf8, 0xaf, 0x81, 0x99, 0x5a, 0xb4, 0x1e, 0x48, 0x63, 0x22, - 0x63, 0xfe, 0x07, 0x2e, 0x3e, 0x07, 0xfc, 0x00, 0x01, 0x08, 0xfd, 0x04, 0xfe, - 0x02, 0x06, 0xfd, 0xf9, 0x0c, 0x0f, 0xff, 0xf6, 0x23, 0x03, 0xc0, 0xcb, 0xb0, - 0xfe, 0x7f, 0x0b, 0x0a, 0x07, 0xfc, 0x19, 0xe5, 0xac, 0x5b, 0x37, 0xae, 0xdb, - 0x7f, 0xf1, 0x98, 0x74, 0xaa, 0x2d, 0x02, 0xfc, 0xfe, 0xf4, 0xf9, 0xed, 0x0b, - 0x0b, 0x07, 0xe1, 0x18, 0x64, 0x7f, 0xe6, 0x19, 0x44, 0xcc, 0x1b, 0xe3, 0x1f, - 0xee, 0x00, 0xfe, 0xed, 0x0c, 0xe6, 0xd8, 0xfd, 0x0f, 0xfc, 0xf3, 0x01, 0x15, - 0xcf, 0x70, 0x81, 0x48, 0xf2, 0x4f, 0x19, 0xff, 0xcc, 0xc0, 0xd7, 0x35, 0x34, - 0x13, 0xe8, 0x21, 0x18, 0xce, 0xdc, 0x45, 0xd0, 0xbd, 0x24, 0x14, 0xfc, 0x10, - 0x00, 0xf1, 0xec, 0x07, 0x0a, 0x00, 0x0d, 0x03, 0x00, 0x0f, 0xff, 0xf3, 0x05, - 0x16, 0xff, 0x10, 0x21, 0x81, 0x1b, 0xfa, 0x04, 0x0b, 0x26, 0x6a, 0x44, 0xd7, - 0x72, 0x2c, 0x74, 0xc9, 0x74, 0x2d, 0xc3, 0x19, 0xc7, 0xbf, 0xb8, 0x30, 0x79, - 0x1c, 0x7e, 0x51, 0xe2, 0x3d, 0xd6, 0x7f, 0x01, 0x0f, 0x3e, 0x48, 0x3e, 0xd5, - 0x81, 0xdc, 0x1b, 0xed, 0x00, 0xf1, 0xfd, 0xe7, 0x41, 0xf2, 0xf8, 0x07, 0x0d, - 0xeb, 0xfd, 0x08, 0x17, 0xfc, 0xff, 0xfe, 0xfc, 0x01, 0xf6, 0x02, 0xfc, 0x03, - 0x07, 0x0b, 0x0e, 0xfc, 0xf2, 0xfa, 0xa1, 0x1b, 0x7f, 0xe1, 0xd6, 0x05, 0x02, - 0xf7, 0x14, 0xfa, 0x0a, 0xec, 0x2a, 0x90, 0x04, 0xf5, 0x40, 0x20, 0x1b, 0x03, - 0x0e, 0x1d, 0x39, 0xf8, 0xf1, 0x40, 0xf4, 0xc9, 0x4e, 0x07, 0x81, 0xdb, 0x1e, - 0x0a, 0x7f, 0x12, 0xbd, 0xbe, 0x22, 0xeb, 0x17, 0xfe, 0xf2, 0xfe, 0x0e, 0xff, - 0xf5, 0x0f, 0x10, 0xe2, 0x10, 0x04, 0x0d, 0x08, 0xde, 0x12, 0xe1, 0x00, 0x0c, - 0xec, 0xf1, 0x13, 0xf3, 0x01, 0xf5, 0xf3, 0x13, 0xd9, 0xe4, 0xf9, 0x1f, 0x5c, - 0xe1, 0x3a, 0x61, 0x81, 0x38, 0xb6, 0xeb, 0x12, 0x04, 0xf6, 0x08, 0xf6, 0xf7, - 0x03, 0xe9, 0xf8, 0x1d, 0xfc, 0x0f, 0xf3, 0x09, 0xf7, 0x03, 0x09, 0x13, 0xf4, - 0x0a, 0xdb, 0xee, 0x7f, 0xd3, 0xee, 0x0c, 0x13, 0xfb, 0xee, 0x17, 0x02, 0xe8, - 0xf7, 0xf0, 0x17, 0xdd, 0xed, 0x29, 0x25, 0xe7, 0xe1, 0x48, 0xf3, 0xe7, 0xf6, - 0x19, 0x03, 0x47, 0x0e, 0x44, 0x7f, 0xe7, 0x33, 0xdc, 0xf0, 0xc2, 0x0c, 0xda, - 0xb9, 0x9b, 0x35, 0x38, 0xa5, 0x15, 0x04, 0x33, 0x3c, 0x7f, 0x48, 0x1c, 0xe8, - 0xc6, 0x26, 0xe9, 0xfc, 0xed, 0x1d, 0x50, 0x81, 0x2a, 0xce, 0x45, 0xee, 0x04, - 0xfa, 0xda, 0xff, 0x1b, 0x1c, 0xd1, 0x17, 0x39, 0xba, 0x0c, 0x0d, 0x09, 0xf9, - 0xed, 0x0c, 0xf5, 0x4c, 0xe3, 0x1d, 0xbd, 0x7f, 0x79, 0x4c, 0xf9, 0x70, 0x1a, - 0xfd, 0x42, 0xb7, 0x15, 0xfb, 0xae, 0x12, 0x0d, 0x32, 0x79, 0x4c, 0x34, 0x78, - 0x09, 0x04, 0xef, 0x0a, 0x7f, 0x30, 0xfa, 0x26, 0x40, 0x25, 0xda, 0xd6, 0xca, - 0xe2, 0x02, 0xcf, 0x02, 0xf9, 0x12, 0xdf, 0xf9, 0xf2, 0x2d, 0xf1, 0x7d, 0x00, - 0x1d, 0xf9, 0x7f, 0x31, 0x66, 0xa6, 0x7f, 0xdc, 0xdb, 0xf1, 0xe6, 0x19, 0x13, - 0x12, 0xcc, 0x6f, 0xe9, 0x6d, 0x6f, 0x05, 0x3d, 0x0f, 0x06, 0xf8, 0x00, 0xf8, - 0xf1, 0x25, 0xda, 0xbc, 0x7f, 0xd7, 0xd0, 0x6c, 0xa4, 0x51, 0xcb, 0x25, 0xed, - 0x0e, 0xf7, 0x05, 0xfe, 0xfd, 0x0c, 0xfa, 0x61, 0x71, 0x7f, 0x49, 0x38, 0xef, - 0x66, 0xe1, 0x39, 0x22, 0x1e, 0xdb, 0xe1, 0x54, 0x4e, 0x25, 0xf0, 0xd4, 0x33, - 0x23, 0xba, 0x1e, 0x6f, 0xee, 0x7f, 0x39, 0xd3, 0xe7, 0x36, 0x12, 0xf4, 0x64, - 0xf8, 0x36, 0xfe, 0x3b, 0x15, 0x40, 0x02, 0xea, 0xc8, 0xed, 0x2e, 0x46, 0x54, - 0xff, 0x35, 0x1e, 0x06, 0x03, 0xe9, 0xe5, 0x2c, 0x01, 0xce, 0x11, 0x37, 0xad, - 0x7d, 0x81, 0x61, 0xcb, 0x29, 0x09, 0xdf, 0x0c, 0xe9, 0x0e, 0xf2, 0x11, 0x13, - 0xf6, 0x04, 0xfb, 0x0f, 0xf5, 0x1c, 0x2e, 0x22, 0xeb, 0xb8, 0xa3, 0x13, 0x60, - 0x0e, 0xec, 0x35, 0xfc, 0x81, 0x19, 0x1d, 0x08, 0x0b, 0xf3, 0x0b, 0xf6, 0xe3, - 0x4a, 0x3e, 0x93, 0x3c, 0x6a, 0x9a, 0x4a, 0x65, 0xd3, 0x18, 0x7f, 0x76, 0xfa, - 0x6e, 0xc4, 0x4c, 0x4e, 0x3a, 0x40, 0x6c, 0x27, 0x70, 0x30, 0x17, 0xde, 0xe4, - 0x38, 0x7f, 0xf9, 0xa6, 0xd9, 0x23, 0x4a, 0x27, 0xed, 0x0e, 0x04, 0x03, 0x13, - 0x05, 0xdf, 0x20, 0xa5, 0x1c, 0x20, 0xd0, 0xd7, 0x73, 0x4c, 0xe3, 0x37, 0x18, - 0x87, 0xe7, 0xf6, 0x72, 0x25, 0xc2, 0x0d, 0x4d, 0x55, 0x1c, 0xe5, 0x48, 0xfb, - 0x1a, 0x71, 0x61, 0x74, 0x7f, 0xf3, 0x06, 0x01, 0xf9, 0xfb, 0x10, 0xef, 0xdc, - 0x57, 0xbd, 0x53, 0xa1, 0x4e, 0xf7, 0xc4, 0x7f, 0xb3, 0x19, 0xe6, 0x08, 0xfb, - 0x09, 0xf8, 0x11, 0xf6, 0xf3, 0x11, 0xdd, 0xe9, 0x02, 0x01, 0x1d, 0xec, 0x01, - 0x09, 0xfe, 0x11, 0xf4, 0x81, 0x11, 0x4c, 0xde, 0xa0, 0xef, 0xf2, 0x38, 0xb7, - 0xfb, 0x1e, 0x24, 0xdd, 0xbf, 0x7f, 0x1d, 0xac, 0x4f, 0x1c, 0xd4, 0x19, 0xfb, - 0xf3, 0x16, 0xef, 0xf7, 0x08, 0x06, 0x02, 0xf7, 0x07, 0xfe, 0x0d, 0xe8, 0xff, - 0x28, 0xad, 0x0d, 0x53, 0x81, 0x38, 0xeb, 0x01, 0xf6, 0x1a, 0x01, 0xfa, 0x1a, - 0x1d, 0xcb, 0xef, 0x46, 0xc5, 0xfe, 0x18, 0x1e, 0x04, 0xc5, 0x12, 0xfe, 0x02, - 0x06, 0x05, 0xfb, 0x02, 0x03, 0x07, 0x07, 0xf1, 0xf8, 0x00, 0x22, 0xdd, 0x30, - 0xf0, 0xcd, 0x22, 0xf7, 0xd3, 0x14, 0x42, 0x38, 0x81, 0xfb, 0x06, 0x0e, 0x03, - 0x05, 0x0d, 0xfb, 0x1b, 0x1e, 0x08, 0xd8, 0x81, 0xd8, 0x44, 0x16, 0x17, 0x07, - 0xe7, 0x1f, 0xf5, 0xfe, 0xe9, 0x10, 0xfc, 0x98, 0x11, 0x7f, 0x07, 0xfa, 0xfb, - 0x03, 0xf9, 0xef, 0x1c, 0x10, 0x06, 0xf6, 0x18, 0x06, 0x01, 0xf2, 0x14, 0xf4, - 0x09, 0xec, 0x0e, 0x04, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0xda, 0xe4, 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x18, 0x00, - 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x35, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x80, 0x06, 0x00, 0x00, 0x24, 0xe4, 0xff, 0xff, 0x9a, 0xe5, 0xff, 0xff, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x27, 0xe4, 0x2a, 0x58, 0x04, - 0xfa, 0x03, 0x17, 0x21, 0x39, 0x18, 0x81, 0x33, 0x63, 0x1e, 0xc0, 0x03, 0x83, - 0x2f, 0x6f, 0x21, 0xe8, 0x14, 0x2b, 0x1e, 0xc6, 0x05, 0xc2, 0x1b, 0xa3, 0x1b, - 0xb8, 0xfd, 0x30, 0xfb, 0x5f, 0xf9, 0xa8, 0xf8, 0xc2, 0xfb, 0xd9, 0xf9, 0x81, - 0xfb, 0x98, 0xfb, 0x45, 0xf8, 0xd7, 0xfa, 0xb1, 0xfb, 0x3c, 0xf9, 0x8d, 0xfc, - 0x5e, 0xf8, 0x27, 0xf8, 0x01, 0xfc, 0x54, 0x2c, 0x32, 0x15, 0x83, 0x05, 0x30, - 0x2a, 0x48, 0x12, 0x9b, 0x17, 0x3f, 0x2b, 0xcd, 0x03, 0xc2, 0x1d, 0x77, 0x04, - 0x03, 0x5d, 0x89, 0x03, 0x98, 0x1b, 0x5a, 0x28, 0x2e, 0x16, 0xa3, 0x32, 0x54, - 0xfb, 0x1f, 0xfc, 0xf6, 0xf7, 0xc1, 0xf9, 0x88, 0x00, 0xa0, 0xfa, 0x22, 0xfb, - 0x1f, 0xf9, 0x23, 0xfa, 0x93, 0xf7, 0x63, 0xf8, 0x48, 0xf8, 0xac, 0xfa, 0xf7, - 0xfc, 0x59, 0xfc, 0xf4, 0xfb, 0x85, 0x23, 0x9c, 0x05, 0x0e, 0x30, 0xb7, 0x09, - 0xe2, 0x29, 0x15, 0x3c, 0xac, 0x24, 0x54, 0x26, 0x9c, 0x1f, 0x69, 0x31, 0x53, - 0x2b, 0xd5, 0x04, 0x42, 0x30, 0x58, 0x20, 0xfb, 0x37, 0x28, 0x26, 0xae, 0xf7, - 0x72, 0xf7, 0x99, 0xfb, 0xc5, 0xfb, 0xbf, 0xf1, 0x5d, 0xf9, 0x91, 0xfb, 0x6c, - 0xfb, 0x65, 0xf9, 0x2f, 0xfc, 0xd6, 0xf9, 0x0d, 0xf8, 0x71, 0xfb, 0x08, 0xfb, - 0x30, 0xf1, 0x2a, 0xfb, 0xaa, 0x2d, 0x6a, 0x2b, 0xea, 0x23, 0x07, 0x24, 0x14, - 0x3d, 0x48, 0x11, 0xad, 0x2a, 0xeb, 0x03, 0x20, 0x1d, 0xd6, 0x03, 0x68, 0x26, - 0x68, 0x29, 0xe6, 0x04, 0x15, 0x05, 0x36, 0x2c, 0xe6, 0x03, 0x29, 0xf7, 0xae, - 0xfb, 0xd4, 0xfb, 0x8a, 0xfb, 0x6d, 0xf7, 0xf8, 0xfd, 0xb8, 0xfa, 0xa6, 0xf8, - 0x51, 0xf9, 0xf5, 0xf7, 0xe9, 0xfa, 0x5f, 0xfb, 0xed, 0xf8, 0xcd, 0xf7, 0x39, - 0xfb, 0x2d, 0xf9, 0x12, 0xe6, 0xff, 0xff, 0x00, 0x00, 0x00, 0x07, 0x18, 0x00, - 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x5c, 0xe5, 0xff, 0xff, 0xd2, 0xe6, 0xff, 0xff, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x04, 0x05, 0xff, 0x02, 0x81, 0x08, - 0x01, 0x07, 0x02, 0x09, 0x01, 0x09, 0xcf, 0x00, 0x03, 0xf5, 0xf9, 0x0a, 0xff, - 0x04, 0x02, 0x05, 0x00, 0xfe, 0x00, 0x04, 0x04, 0x01, 0xff, 0xff, 0xfd, 0xf1, - 0x00, 0xe9, 0x04, 0x00, 0xe0, 0x25, 0xfc, 0xef, 0xfc, 0xf8, 0x00, 0x06, 0xfd, - 0xfd, 0x02, 0x08, 0xf5, 0xfe, 0x00, 0xed, 0x04, 0xfb, 0xfd, 0x01, 0x00, 0x04, - 0xfa, 0x04, 0xeb, 0x09, 0x06, 0x03, 0xb3, 0x00, 0x06, 0x02, 0xce, 0xe6, 0x03, - 0xd0, 0xf1, 0xd2, 0x07, 0xef, 0x10, 0xf5, 0x12, 0xe2, 0xc1, 0x0a, 0x03, 0x02, - 0x01, 0x81, 0xcd, 0x0a, 0xfd, 0xf1, 0xf4, 0xf2, 0xf8, 0xef, 0xe4, 0xe1, 0xf3, - 0xfa, 0xf8, 0x01, 0xfd, 0x0c, 0x0c, 0x00, 0xfc, 0xfd, 0xf9, 0x32, 0xfa, 0x00, - 0x0f, 0xd1, 0x81, 0x02, 0xfd, 0xfc, 0x0c, 0x16, 0x0c, 0xfa, 0x07, 0x05, 0x10, - 0xfc, 0x05, 0x0e, 0xe9, 0xe6, 0x03, 0x02, 0x00, 0x02, 0x01, 0xf8, 0x81, 0x01, - 0xfd, 0x05, 0xff, 0x00, 0x01, 0x01, 0x09, 0x03, 0x01, 0x01, 0x01, 0x00, 0xff, - 0x00, 0x01, 0x01, 0xfd, 0x00, 0x9c, 0xfd, 0xf6, 0xf9, 0x00, 0x00, 0x15, 0x1f, - 0xfd, 0x04, 0xcf, 0x04, 0xfc, 0xf9, 0x07, 0x1c, 0x98, 0xde, 0xfd, 0xf6, 0x18, - 0x0e, 0xed, 0x81, 0x09, 0xe4, 0xba, 0xff, 0xd7, 0x00, 0xf2, 0x06, 0xf6, 0xfc, - 0x0d, 0xd2, 0xf3, 0x29, 0x07, 0xe4, 0xf3, 0x12, 0xef, 0xfd, 0xff, 0xce, 0xf1, - 0x81, 0xf4, 0x12, 0xf7, 0xf3, 0x0b, 0xf6, 0x1a, 0xed, 0xf3, 0x59, 0x06, 0x03, - 0xe5, 0xf6, 0xf5, 0x0d, 0xfd, 0xfa, 0x3e, 0xf5, 0x07, 0xdb, 0x0c, 0xec, 0x05, - 0xfc, 0x02, 0xd0, 0xfd, 0xfa, 0xff, 0xfa, 0xfa, 0xfb, 0x03, 0xfb, 0xf6, 0x00, - 0x01, 0x01, 0x02, 0xee, 0x02, 0xf7, 0xf9, 0x03, 0xf6, 0xfc, 0x04, 0x02, 0xff, - 0xfb, 0xff, 0xfc, 0xf2, 0xb6, 0x03, 0xf9, 0xf4, 0xec, 0x1a, 0xfe, 0x0e, 0x24, - 0x7f, 0x24, 0xe3, 0xf1, 0x30, 0x20, 0x1b, 0xe4, 0x02, 0xfe, 0xfb, 0xff, 0x1a, - 0xf1, 0xf5, 0x09, 0xeb, 0xfe, 0x00, 0xee, 0x0b, 0x19, 0x07, 0xf5, 0xfc, 0x06, - 0x07, 0x02, 0xf9, 0x24, 0xfb, 0xfb, 0xf9, 0xff, 0x08, 0x03, 0x01, 0x04, 0xff, - 0xfb, 0x02, 0x04, 0xff, 0xfe, 0x04, 0xfe, 0xfe, 0x03, 0xfe, 0x03, 0xf9, 0x06, - 0x17, 0xf2, 0x2b, 0x20, 0x01, 0xf9, 0x11, 0x23, 0x06, 0xf8, 0xf2, 0x75, 0xf5, - 0xf9, 0x51, 0x01, 0xf9, 0xdf, 0x06, 0x24, 0xe9, 0x81, 0x03, 0x0a, 0x08, 0xf6, - 0xe9, 0xfa, 0xfe, 0xf9, 0xea, 0x02, 0x03, 0xea, 0x06, 0xfe, 0xff, 0xfc, 0x00, - 0x03, 0x07, 0x07, 0xfd, 0x02, 0xfb, 0xfc, 0xf7, 0xff, 0xe5, 0x01, 0x04, 0x00, - 0xfd, 0x04, 0xfe, 0x02, 0x02, 0x01, 0x00, 0xfd, 0xf5, 0x00, 0x03, 0x81, 0xfe, - 0x02, 0x81, 0x96, 0xef, 0x08, 0xc5, 0x40, 0x0c, 0x53, 0x02, 0xb8, 0xec, 0x47, - 0xf5, 0xef, 0x38, 0x07, 0x39, 0x45, 0x10, 0xf1, 0xf6, 0x02, 0xbe, 0x01, 0x1b, - 0x06, 0xfd, 0x09, 0x11, 0xdd, 0x0b, 0x5e, 0xb2, 0x1e, 0xea, 0xe6, 0x26, 0x2a, - 0x14, 0x09, 0xe7, 0x23, 0x13, 0xea, 0xeb, 0xf0, 0x15, 0xfe, 0x0f, 0x9e, 0x01, - 0x1f, 0x7f, 0x07, 0xf1, 0xf5, 0x08, 0x06, 0x04, 0xf6, 0xe9, 0xb8, 0x05, 0x11, - 0xd0, 0x34, 0xf4, 0xed, 0x08, 0x40, 0x20, 0x09, 0x0e, 0x30, 0x0e, 0xd5, 0xf0, - 0x06, 0x3d, 0x06, 0x05, 0x89, 0xf5, 0x2f, 0xd8, 0x0f, 0xfb, 0x14, 0xff, 0xfe, - 0x18, 0x1c, 0xd6, 0xc0, 0x08, 0x0a, 0x0a, 0x07, 0xf5, 0x04, 0x03, 0x00, 0x08, - 0x01, 0x01, 0x17, 0x0c, 0x1c, 0x01, 0x07, 0x06, 0x0d, 0x01, 0xf1, 0xfe, 0xf8, - 0xf7, 0x10, 0x12, 0xf5, 0x04, 0xf9, 0xfa, 0x07, 0x10, 0xe5, 0x04, 0x24, 0x08, - 0xfd, 0xfd, 0xff, 0xfd, 0xf2, 0x03, 0x01, 0xf2, 0x00, 0x02, 0x02, 0x14, 0xff, - 0x02, 0x04, 0x00, 0xfe, 0x10, 0xf5, 0x08, 0xfd, 0xff, 0x02, 0x02, 0x01, 0x01, - 0xf9, 0xff, 0x01, 0xfe, 0x00, 0x81, 0xff, 0xf7, 0x02, 0xeb, 0xfc, 0x02, 0x02, - 0x06, 0xfe, 0x06, 0x06, 0xff, 0x11, 0xec, 0xee, 0x00, 0xf1, 0x07, 0xee, 0xf6, - 0xdc, 0x0a, 0x02, 0x02, 0x01, 0xfb, 0x0a, 0xfa, 0xfc, 0x06, 0x03, 0xf7, 0xf2, - 0x05, 0xfb, 0x18, 0x00, 0xcb, 0x0c, 0x05, 0xd5, 0x04, 0xff, 0x96, 0x08, 0xec, - 0x02, 0x03, 0xec, 0xc3, 0xf9, 0x13, 0xbd, 0x11, 0xf0, 0xde, 0xef, 0x0b, 0x0e, - 0xf2, 0xff, 0xed, 0xff, 0x0e, 0xfd, 0x0b, 0xfe, 0x3a, 0xe7, 0xd1, 0xf0, 0xf6, - 0xa8, 0x05, 0x02, 0xdc, 0x07, 0xf7, 0xfa, 0x04, 0xf1, 0x12, 0x23, 0x15, 0x06, - 0x0b, 0x00, 0x15, 0xfd, 0xf5, 0x10, 0x00, 0xff, 0x05, 0x07, 0xfc, 0x00, 0xfd, - 0x02, 0xfe, 0x02, 0x02, 0xbc, 0xfe, 0x01, 0x01, 0xfe, 0x03, 0x0d, 0x02, 0xfc, - 0xfe, 0x04, 0x04, 0xef, 0x05, 0x03, 0xfe, 0xfe, 0xfd, 0x01, 0xfc, 0xfc, 0xfe, - 0xfe, 0xf8, 0x02, 0x21, 0xef, 0xe9, 0x0f, 0x03, 0x33, 0xc2, 0xfe, 0xe4, 0xf4, - 0x0b, 0x0c, 0x22, 0xa4, 0xf8, 0x26, 0xfd, 0x1b, 0x0b, 0xc5, 0xd3, 0x15, 0xf4, - 0xf6, 0x24, 0xf7, 0xea, 0xdc, 0x05, 0xfa, 0xeb, 0x0e, 0xf8, 0x12, 0xf5, 0xf3, - 0xfa, 0xff, 0x2a, 0x05, 0xf9, 0xef, 0x27, 0xf3, 0x0d, 0xfb, 0xff, 0xf6, 0x02, - 0xfe, 0xfb, 0xd9, 0xf1, 0x08, 0xe9, 0x00, 0x05, 0x06, 0x61, 0xdc, 0x0b, 0xf8, - 0xcc, 0x0b, 0x81, 0xfb, 0x02, 0x05, 0xfe, 0x0f, 0xf5, 0x05, 0xbd, 0x03, 0xfa, - 0xff, 0xf8, 0xf7, 0xfd, 0xfe, 0x03, 0xfb, 0x06, 0xf9, 0xf8, 0x0a, 0xf9, 0x02, - 0xe4, 0xfb, 0xf6, 0xfb, 0x00, 0xfe, 0xf9, 0xfe, 0x3b, 0xfd, 0xcc, 0xe4, 0x34, - 0xc8, 0xe6, 0xfa, 0xf9, 0x17, 0xec, 0x19, 0x2d, 0xdc, 0x04, 0xf0, 0xfb, 0xf4, - 0xfb, 0x67, 0x0f, 0x05, 0xee, 0xeb, 0xfc, 0x12, 0xd0, 0xe7, 0x0d, 0x01, 0x0a, - 0xeb, 0xf1, 0xfa, 0xfb, 0xf7, 0x81, 0xf4, 0xef, 0x04, 0x04, 0xf1, 0xfb, 0x02, - 0xf3, 0x01, 0x02, 0x04, 0xff, 0x01, 0x13, 0x00, 0x00, 0xfb, 0xfe, 0x01, 0x0a, - 0xfe, 0x00, 0x0b, 0xfc, 0x01, 0xf9, 0x02, 0x8c, 0x07, 0x10, 0xf7, 0xe1, 0xe7, - 0xf4, 0xdd, 0x07, 0x02, 0xf6, 0x0e, 0xf5, 0x25, 0xf6, 0x08, 0x09, 0xbb, 0xbf, - 0x46, 0x24, 0xe7, 0x10, 0xec, 0x18, 0xf9, 0x08, 0x21, 0xe8, 0xf0, 0x1a, 0xfa, - 0x05, 0x01, 0xfc, 0xfd, 0x05, 0xfb, 0xff, 0xf9, 0x13, 0x04, 0x00, 0xfe, 0xfa, - 0xff, 0xfa, 0xff, 0xe8, 0x09, 0xfd, 0x05, 0xfd, 0x12, 0xea, 0xfd, 0xf7, 0x00, - 0x02, 0xf9, 0x03, 0xfc, 0xf0, 0xff, 0xf6, 0x0c, 0x23, 0x1b, 0xa6, 0xd1, 0x0b, - 0x01, 0xe4, 0xff, 0xef, 0xf7, 0xff, 0x4a, 0x09, 0x0c, 0xf7, 0x5a, 0xdf, 0x1c, - 0xe1, 0x0b, 0xe4, 0xf5, 0x14, 0x13, 0xe0, 0xbc, 0x13, 0xf2, 0xab, 0x17, 0xf3, - 0xf6, 0x11, 0xe9, 0x2a, 0xb6, 0x2a, 0xfb, 0x24, 0x06, 0x0a, 0xfc, 0x38, 0x10, - 0xed, 0x06, 0x04, 0x17, 0x2d, 0xe7, 0xef, 0xe0, 0xec, 0x0c, 0xe8, 0x01, 0x1d, - 0xcf, 0xf4, 0x08, 0xee, 0x17, 0x4a, 0x13, 0x14, 0xf7, 0x7f, 0xfb, 0x16, 0x03, - 0x5a, 0x0a, 0x10, 0xea, 0x03, 0x19, 0x23, 0x10, 0x07, 0x0a, 0xf9, 0x14, 0x24, - 0xdb, 0x14, 0xf0, 0x13, 0x1e, 0x17, 0x1b, 0xef, 0x0d, 0x0a, 0x13, 0x01, 0x00, - 0xfd, 0xf1, 0x81, 0xe8, 0xed, 0xfa, 0x11, 0x03, 0x09, 0x00, 0x1a, 0x04, 0xfb, - 0xee, 0xf4, 0x88, 0x0a, 0xfc, 0xe8, 0x17, 0x05, 0xfb, 0x0c, 0xf5, 0x01, 0xf1, - 0xfb, 0x08, 0xfd, 0xf9, 0x0c, 0xf6, 0xfd, 0xfb, 0xfe, 0x0a, 0xf5, 0xf5, 0xfc, - 0x00, 0xd6, 0x0e, 0xe8, 0x00, 0x0c, 0xfa, 0x81, 0xfd, 0xff, 0xf6, 0xfc, 0x03, - 0xe9, 0xfb, 0xed, 0x04, 0x00, 0x05, 0xff, 0xfa, 0x06, 0xf1, 0x03, 0xfe, 0xfe, - 0xf6, 0x1b, 0xf9, 0x0f, 0xfb, 0x03, 0x21, 0xfb, 0x00, 0xfe, 0x05, 0x0d, 0xfe, - 0x01, 0xfd, 0x0a, 0x38, 0xf7, 0xf7, 0x01, 0x0a, 0x34, 0xfa, 0xfa, 0x04, 0xed, - 0xf1, 0x08, 0xe2, 0xf1, 0x1b, 0x09, 0xf9, 0x05, 0xff, 0x07, 0x17, 0x03, 0xe4, - 0xfd, 0x0e, 0xfb, 0xfe, 0x0a, 0xe6, 0x10, 0x81, 0x03, 0x06, 0xf8, 0x08, 0x00, - 0xf4, 0xed, 0xfe, 0xfa, 0xf8, 0xe6, 0xda, 0x04, 0x0d, 0x51, 0xeb, 0xf8, 0x15, - 0xfa, 0x3a, 0xf8, 0xf0, 0x00, 0xd6, 0xf4, 0xcf, 0xbf, 0x0f, 0x2a, 0x0f, 0x02, - 0xad, 0x0d, 0x09, 0xeb, 0x0f, 0x13, 0xef, 0x36, 0xfe, 0x08, 0xf5, 0x84, 0xfb, - 0xdf, 0x01, 0xfd, 0xf1, 0x06, 0x08, 0xf8, 0xe4, 0xff, 0x01, 0x01, 0xf3, 0x02, - 0x0e, 0x01, 0x02, 0x81, 0xff, 0x00, 0x0e, 0x01, 0xf1, 0x03, 0xfe, 0x02, 0xf8, - 0x02, 0x05, 0xfa, 0x01, 0x0b, 0x12, 0x07, 0x01, 0xdd, 0xcc, 0xfc, 0xfc, 0xbb, - 0xdb, 0xf4, 0xe3, 0x0d, 0xc6, 0x06, 0xe7, 0xe2, 0x00, 0xff, 0x1c, 0x3b, 0xe6, - 0x01, 0xff, 0xec, 0x4e, 0xef, 0x0a, 0x05, 0xff, 0xe8, 0x03, 0x81, 0x09, 0x1c, - 0xde, 0xe1, 0x32, 0xfb, 0x0d, 0xde, 0x2c, 0x09, 0x25, 0x16, 0x1a, 0x0e, 0x21, - 0x08, 0x17, 0x06, 0xd4, 0xd6, 0xd4, 0x1b, 0x04, 0x27, 0x09, 0x7f, 0xe2, 0x0a, - 0x1b, 0x09, 0x23, 0xd3, 0xff, 0x25, 0xff, 0x0d, 0x12, 0xf9, 0x06, 0x3e, 0x20, - 0x0c, 0xff, 0xfc, 0x93, 0x0f, 0xf5, 0x81, 0xf4, 0x2d, 0x0d, 0x22, 0xfe, 0x06, - 0xf0, 0x01, 0x06, 0x01, 0x05, 0xf4, 0xf4, 0xfe, 0x02, 0xaa, 0xec, 0x09, 0xf6, - 0xf1, 0x02, 0xff, 0x0f, 0xfc, 0xf0, 0xd2, 0xf9, 0xfd, 0x02, 0x08, 0xdd, 0xfb, - 0x05, 0xf7, 0x03, 0xc8, 0xcc, 0xf7, 0xfd, 0xef, 0xe1, 0x3c, 0x01, 0xfe, 0xf3, - 0x22, 0xf8, 0xca, 0x22, 0xe9, 0x09, 0x0c, 0xf9, 0x01, 0x00, 0xfb, 0x01, 0x00, - 0xfe, 0x07, 0x06, 0xfe, 0xfc, 0x06, 0x02, 0xfc, 0xfd, 0xf0, 0xfe, 0x03, 0xff, - 0xff, 0x04, 0xdb, 0x06, 0xfe, 0xfb, 0x14, 0xfc, 0xff, 0x08, 0xee, 0xfc, 0xf6, - 0xe8, 0x02, 0x05, 0xf9, 0x02, 0xef, 0xf1, 0x05, 0x0e, 0xf2, 0xfe, 0xfe, 0x00, - 0x0f, 0xf1, 0x05, 0x04, 0xff, 0x04, 0xff, 0x0f, 0xb7, 0xfe, 0xf7, 0x00, 0x00, - 0xfd, 0xfe, 0x02, 0xf1, 0xed, 0x0c, 0xac, 0x02, 0x00, 0xfd, 0xbf, 0xfa, 0xfb, - 0x00, 0xf6, 0xf2, 0xb0, 0xf8, 0x01, 0xac, 0xf7, 0xef, 0xca, 0x02, 0xc0, 0x08, - 0xf2, 0xe4, 0x02, 0xe0, 0xff, 0x03, 0xff, 0xe4, 0xf3, 0xfa, 0xf8, 0xfe, 0xfb, - 0xff, 0xfe, 0x02, 0x02, 0xfd, 0xff, 0x00, 0x08, 0x02, 0x02, 0x01, 0x00, 0x01, - 0x00, 0x03, 0x01, 0xfe, 0x00, 0x00, 0x01, 0xfd, 0x01, 0x01, 0x01, 0x81, 0x01, - 0xff, 0x01, 0x03, 0x01, 0x14, 0x0d, 0x00, 0xfb, 0x07, 0xed, 0xf9, 0x06, 0x04, - 0x03, 0x00, 0xf0, 0xfb, 0x03, 0xfd, 0x02, 0x07, 0x02, 0xfe, 0xfb, 0x02, 0x02, - 0xfd, 0x04, 0xfd, 0xfb, 0xfd, 0xfc, 0xf9, 0x02, 0x01, 0x0e, 0x0e, 0x7f, 0xf4, - 0xfb, 0x34, 0xf7, 0x07, 0xf2, 0xf1, 0xc8, 0x11, 0xe2, 0xe7, 0xfd, 0x11, 0x02, - 0x0d, 0xd6, 0xf7, 0xef, 0xf0, 0x0a, 0x04, 0x0f, 0xe7, 0x04, 0xf3, 0x0e, 0x15, - 0x00, 0xf9, 0xdd, 0x05, 0x10, 0x0b, 0x0d, 0xde, 0xc7, 0xff, 0xe8, 0x04, 0xbd, - 0x02, 0xff, 0x36, 0x08, 0x12, 0x07, 0xaa, 0xfe, 0x05, 0x0b, 0xff, 0xfc, 0xf9, - 0x0e, 0x09, 0xf6, 0xff, 0xfe, 0xe4, 0xfc, 0x0e, 0x0b, 0x06, 0x03, 0xea, 0x05, - 0x24, 0xdb, 0x08, 0xff, 0x05, 0xfa, 0xeb, 0xfd, 0x26, 0xf6, 0x05, 0xf3, 0xfc, - 0xf7, 0xfe, 0x02, 0x02, 0x0a, 0xfa, 0x03, 0x0c, 0x00, 0xf1, 0xee, 0x02, 0x00, - 0xf6, 0xfc, 0xde, 0x08, 0x00, 0xf2, 0x81, 0xf3, 0xff, 0xfe, 0x08, 0xf6, 0xec, - 0x04, 0x05, 0xff, 0xfe, 0x02, 0xfa, 0xf6, 0xf7, 0x07, 0xe7, 0xf8, 0x0b, 0x0a, - 0x0b, 0xf6, 0xfc, 0xef, 0xf9, 0x02, 0xf9, 0x05, 0x9f, 0xf5, 0x10, 0xf4, 0x09, - 0x21, 0x16, 0xfd, 0x19, 0x02, 0x9e, 0x0a, 0x28, 0xf0, 0x14, 0xf8, 0xf7, 0xe3, - 0x1c, 0x2c, 0x01, 0x0c, 0x0f, 0xf5, 0xc1, 0xf7, 0x09, 0xfe, 0xf9, 0x03, 0x0d, - 0xfe, 0x08, 0xf3, 0xd6, 0xfb, 0x2d, 0x81, 0xc9, 0x0a, 0xfe, 0xfd, 0xf6, 0xf1, - 0xef, 0xfc, 0xf5, 0x02, 0xf3, 0x17, 0xf3, 0xaa, 0xd5, 0xf7, 0xe7, 0xf1, 0xf0, - 0x14, 0xdc, 0xd6, 0x0b, 0xe7, 0xb4, 0x09, 0xa6, 0x01, 0x00, 0x10, 0x1b, 0x07, - 0x02, 0xfc, 0xdc, 0xfe, 0x05, 0x00, 0xdc, 0xff, 0xb2, 0x06, 0x00, 0x03, 0xfe, - 0x03, 0xf7, 0x03, 0x04, 0x07, 0xfc, 0x08, 0xf8, 0x0d, 0x05, 0x08, 0x08, 0x01, - 0xf6, 0xff, 0xe2, 0x05, 0x04, 0xb1, 0x06, 0x00, 0xb9, 0xf3, 0xf7, 0x0b, 0xae, - 0xfc, 0xe5, 0xfc, 0x06, 0xf8, 0xd0, 0xc2, 0x0b, 0xe6, 0xf8, 0xfe, 0xe0, 0xf4, - 0xea, 0xef, 0x0c, 0xf9, 0xfe, 0xfb, 0x21, 0xff, 0x07, 0xd9, 0x29, 0xbe, 0xfd, - 0xf0, 0x12, 0xed, 0xf1, 0x0e, 0x13, 0x0e, 0x19, 0x70, 0x02, 0xf4, 0x0d, 0xff, - 0xdc, 0x56, 0x6a, 0xf0, 0x40, 0xf8, 0x0f, 0x23, 0xf5, 0x2a, 0x75, 0xf1, 0xd3, - 0x04, 0xfe, 0xf9, 0x6f, 0xf7, 0x0f, 0xf4, 0x00, 0x07, 0xc0, 0xfc, 0x06, 0xf8, - 0xbc, 0xeb, 0xf4, 0x0f, 0xa9, 0x13, 0x14, 0xf9, 0x12, 0x0e, 0x01, 0x0d, 0x0f, - 0x0b, 0x09, 0xff, 0xf6, 0x0a, 0xe8, 0xfa, 0xfc, 0xdc, 0x7f, 0x3b, 0xef, 0xff, - 0xda, 0xf6, 0xf7, 0x0f, 0xd6, 0x03, 0x17, 0x3a, 0x19, 0x0c, 0xfa, 0xf4, 0x1a, - 0xe5, 0x5f, 0xf0, 0x07, 0x05, 0xed, 0x71, 0xf8, 0xfc, 0x6d, 0x03, 0x03, 0xfc, - 0x09, 0x06, 0x87, 0x81, 0x0d, 0x01, 0x0b, 0xf3, 0x04, 0xfe, 0x19, 0xf6, 0x10, - 0xf0, 0x03, 0x00, 0x01, 0x06, 0xfc, 0x16, 0xf1, 0xfc, 0xfe, 0xfb, 0x00, 0x10, - 0xfd, 0x01, 0xf8, 0xfd, 0xfb, 0x01, 0xf1, 0x01, 0x10, 0x0f, 0xfd, 0x03, 0x11, - 0xf1, 0xfb, 0x00, 0xca, 0xea, 0x13, 0x81, 0x02, 0xf8, 0x09, 0xe2, 0xfc, 0x04, - 0xf5, 0x01, 0xfa, 0x07, 0xe6, 0xf0, 0x03, 0x00, 0xfc, 0x03, 0x81, 0x02, 0xf5, - 0xff, 0xc2, 0xa2, 0xfb, 0xfe, 0xb9, 0xff, 0xc4, 0x01, 0x02, 0xf1, 0xa7, 0xef, - 0xfe, 0xf9, 0x04, 0xf8, 0xc6, 0x0f, 0xd4, 0x02, 0xe3, 0xff, 0xe1, 0xe1, 0xfe, - 0x02, 0xe8, 0xff, 0xfc, 0x00, 0x0f, 0xfc, 0xfe, 0xfa, 0xf9, 0xe7, 0x03, 0xfe, - 0xff, 0x01, 0x00, 0xfe, 0x00, 0xff, 0xfa, 0xff, 0xfa, 0xe8, 0xf7, 0xff, 0x01, - 0x00, 0x00, 0x02, 0x01, 0x03, 0x03, 0xfe, 0xff, 0xfe, 0x00, 0xfc, 0x04, 0x00, - 0x81, 0x14, 0x0f, 0x02, 0xfe, 0x0d, 0xfb, 0x06, 0x02, 0xfe, 0xff, 0xfd, 0x01, - 0x05, 0x08, 0x03, 0xf2, 0x02, 0x14, 0x00, 0xfe, 0xfe, 0x05, 0x13, 0x00, 0x00, - 0x04, 0xfe, 0x12, 0xfb, 0xdb, 0xca, 0x24, 0xd8, 0xd7, 0xf1, 0x07, 0x12, 0x51, - 0x0e, 0x00, 0x10, 0xf9, 0xf7, 0xf1, 0x12, 0x07, 0x37, 0xd3, 0xff, 0xe7, 0x0c, - 0x09, 0xee, 0x09, 0xf6, 0xee, 0xfd, 0xfb, 0x03, 0x03, 0xf9, 0xfc, 0xe5, 0x15, - 0x0f, 0x09, 0xfe, 0x32, 0x0b, 0xf7, 0xfe, 0xea, 0x0a, 0xf4, 0x0d, 0x03, 0x07, - 0x5c, 0x81, 0xd9, 0xef, 0x04, 0xf7, 0xf4, 0x03, 0x07, 0x0c, 0xf8, 0x03, 0xfa, - 0x0f, 0x4a, 0xee, 0xff, 0xff, 0x00, 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, - 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, - 0x00, 0x00, 0x00, 0x33, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x08, - 0x00, 0x00, 0x94, 0xed, 0xff, 0xff, 0x0a, 0xef, 0xff, 0xff, 0x04, 0x00, 0x00, - 0x00, 0x80, 0x00, 0x00, 0x00, 0x41, 0x10, 0x9b, 0x05, 0xc5, 0x05, 0x9a, 0x06, - 0x96, 0x27, 0xe7, 0x08, 0x68, 0x1d, 0x23, 0x07, 0xa7, 0x25, 0x70, 0x09, 0xc1, - 0x0c, 0xe3, 0x37, 0x8e, 0x16, 0x68, 0x09, 0xdd, 0x1f, 0x21, 0x2c, 0x2d, 0xfc, - 0x66, 0x02, 0x0d, 0xff, 0x66, 0xfe, 0x93, 0xf6, 0xf5, 0xfd, 0xc6, 0xfa, 0x96, - 0xff, 0xf7, 0xef, 0x18, 0xfd, 0x2a, 0xf8, 0x9e, 0xed, 0xf2, 0xfb, 0x00, 0xf6, - 0xf2, 0xf5, 0x43, 0xf9, 0xef, 0x0c, 0xee, 0x08, 0x66, 0x20, 0x46, 0x47, 0x3e, - 0x4a, 0xc8, 0x1b, 0x9f, 0x1c, 0xe7, 0x0a, 0xe7, 0x0c, 0x3f, 0x05, 0x96, 0x0e, - 0x9d, 0x13, 0x23, 0x09, 0x56, 0x0e, 0xbf, 0x10, 0xdc, 0x24, 0xf1, 0xfc, 0x58, - 0xfe, 0xcb, 0xfd, 0x9a, 0xf1, 0xd0, 0x9b, 0x03, 0xf4, 0x02, 0xf8, 0xd5, 0x00, - 0x1c, 0xfc, 0x01, 0x03, 0x3c, 0xf2, 0xde, 0xf9, 0x35, 0xf8, 0x51, 0xfb, 0x82, - 0xfc, 0xbc, 0xf3, 0x02, 0xef, 0xff, 0xff, 0x00, 0x00, 0x00, 0x07, 0x18, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, 0x4c, 0xee, 0xff, 0xff, 0xc2, 0xef, 0xff, 0xff, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0xff, 0xa8, 0x01, 0xfd, 0x02, 0xfe, - 0x03, 0x00, 0x07, 0xf7, 0x01, 0xff, 0x03, 0x02, 0x01, 0xf8, 0xff, 0xf5, 0x06, - 0xfe, 0xff, 0x03, 0xfb, 0x02, 0x00, 0xfd, 0x03, 0x03, 0x05, 0xfd, 0xfb, 0x03, - 0x03, 0x00, 0x06, 0x03, 0x01, 0x04, 0xfc, 0x09, 0x02, 0x08, 0x06, 0x03, 0xfe, - 0xfb, 0x05, 0x02, 0x07, 0x06, 0xff, 0x04, 0xf8, 0xf7, 0xf9, 0xfd, 0x05, 0xf3, - 0xfd, 0x0a, 0x08, 0x01, 0x06, 0xfc, 0xfa, 0xfe, 0xfe, 0xfb, 0xff, 0xfb, 0x0c, - 0xfe, 0x05, 0xff, 0xf6, 0xfd, 0x06, 0x09, 0xfd, 0xfd, 0xf7, 0x02, 0xf9, 0xfc, - 0xfe, 0x07, 0x05, 0xfe, 0xfe, 0x10, 0xf3, 0xff, 0xf6, 0x02, 0xfb, 0x0b, 0xfb, - 0xff, 0xfb, 0xfd, 0xf9, 0xfa, 0x02, 0xfa, 0x02, 0xfc, 0xfc, 0xfe, 0x05, 0x03, - 0xfa, 0xf9, 0xf9, 0xfe, 0xff, 0xfd, 0x04, 0xfe, 0xf9, 0x01, 0xfe, 0x0a, 0x04, - 0xfd, 0xfd, 0xfc, 0xfe, 0x03, 0xfd, 0xf7, 0x00, 0xf4, 0xfc, 0xfe, 0x05, 0xf3, - 0x04, 0xff, 0xfc, 0xf5, 0x02, 0x02, 0xfc, 0xfe, 0xfd, 0xfa, 0x04, 0xff, 0xfe, - 0x06, 0xfd, 0x02, 0x01, 0x01, 0xf9, 0x01, 0xff, 0xff, 0xce, 0x06, 0x02, 0x04, - 0xff, 0x01, 0x03, 0x03, 0xfb, 0x04, 0xf6, 0x04, 0x05, 0x01, 0xfd, 0xf7, 0x00, - 0x03, 0x05, 0x05, 0xfc, 0x02, 0x81, 0xfe, 0xfa, 0xfd, 0x02, 0xf5, 0xfc, 0xfe, - 0x02, 0x04, 0x05, 0xfc, 0xfd, 0x00, 0x00, 0xfd, 0xff, 0xfd, 0x04, 0xfd, 0x02, - 0xf6, 0xfc, 0xfb, 0x03, 0x00, 0xfd, 0xfc, 0xfd, 0xff, 0x05, 0x00, 0xfe, 0x02, - 0x03, 0x03, 0xfc, 0x09, 0x04, 0xfe, 0xff, 0xfe, 0xfe, 0x03, 0xfa, 0xf6, 0x00, - 0xfa, 0x05, 0xfb, 0x07, 0x00, 0x02, 0xfd, 0xfb, 0xfd, 0xff, 0x06, 0xfe, 0xfb, - 0xfd, 0xf7, 0xef, 0xfb, 0xff, 0x09, 0x02, 0xff, 0x02, 0xfa, 0x06, 0x04, 0x03, - 0xfa, 0xfe, 0x0b, 0x03, 0x09, 0xfa, 0x02, 0x01, 0x02, 0xfd, 0x00, 0xe8, 0x00, - 0x02, 0x05, 0x01, 0xfa, 0x05, 0x00, 0x02, 0xff, 0xfc, 0x02, 0xa1, 0x03, 0xfb, - 0xfb, 0x04, 0xf9, 0xfe, 0xf5, 0x02, 0x04, 0x01, 0xfd, 0x02, 0xfe, 0x03, 0x02, - 0x01, 0x03, 0xfb, 0x06, 0x01, 0x03, 0x04, 0x04, 0xfb, 0xfe, 0x07, 0x05, 0x03, - 0x02, 0xfa, 0x04, 0xfb, 0xff, 0xf8, 0xfb, 0x04, 0xf6, 0xfd, 0x04, 0x02, 0x05, - 0x03, 0xfd, 0x00, 0xef, 0x00, 0xff, 0x03, 0xfe, 0xfe, 0x00, 0x03, 0xfd, 0xff, - 0x01, 0x02, 0x01, 0xff, 0xfe, 0xfe, 0xff, 0x01, 0xfd, 0x00, 0x05, 0x02, 0x01, - 0xfc, 0x00, 0xf6, 0x00, 0xfc, 0xfe, 0x01, 0xf1, 0xfd, 0xfe, 0x01, 0xfc, 0x01, - 0xff, 0x07, 0x00, 0x01, 0xfd, 0xfc, 0xfd, 0x03, 0x01, 0xfc, 0xff, 0xfc, 0xf4, - 0x06, 0xfc, 0xfd, 0x04, 0x04, 0x02, 0xff, 0x0a, 0x06, 0xfd, 0xfd, 0xfe, 0xfe, - 0x06, 0xff, 0xfe, 0xdf, 0xfa, 0xfc, 0xfc, 0x07, 0xf8, 0x00, 0xfe, 0x00, 0xfc, - 0x03, 0xff, 0x03, 0x00, 0xf9, 0x01, 0xfb, 0xfe, 0x00, 0x01, 0x05, 0x00, 0x03, - 0xfb, 0x00, 0xfb, 0xed, 0x01, 0xfd, 0xfb, 0x03, 0xfe, 0x02, 0x02, 0x03, 0x04, - 0xfa, 0x03, 0xff, 0x04, 0x03, 0x04, 0xfd, 0xf9, 0x05, 0x03, 0x03, 0x02, 0xfc, - 0x04, 0xfd, 0xff, 0xf5, 0xfc, 0x03, 0xf6, 0xfb, 0x04, 0x03, 0x02, 0x02, 0xff, - 0xfa, 0xfd, 0xfc, 0xf9, 0xfc, 0x00, 0xfe, 0xfa, 0x06, 0xfd, 0xfc, 0x02, 0x06, - 0x05, 0xf7, 0xfb, 0xfa, 0x00, 0xf2, 0xfd, 0xff, 0x05, 0x03, 0xfe, 0xfc, 0x08, - 0xf4, 0x00, 0xfc, 0xfc, 0xfe, 0x00, 0xfc, 0xff, 0x02, 0xfb, 0xfe, 0xf9, 0x07, - 0xfe, 0xf8, 0xfb, 0xfa, 0xfa, 0x03, 0x04, 0xfc, 0xfb, 0xfa, 0x00, 0x07, 0xff, - 0xe7, 0x03, 0x08, 0x04, 0xfc, 0x0c, 0x05, 0xfc, 0xfb, 0xff, 0xfd, 0x07, 0xfe, - 0xe6, 0xff, 0xfe, 0xff, 0xfe, 0x03, 0x00, 0x02, 0xf6, 0x06, 0xfd, 0x01, 0x01, - 0xff, 0xfb, 0xfe, 0xf0, 0x07, 0xfd, 0x01, 0xff, 0xfd, 0x02, 0x03, 0x07, 0x04, - 0xfc, 0x01, 0x01, 0xfe, 0x05, 0xff, 0xf3, 0x01, 0xfc, 0xfd, 0xfe, 0xff, 0xf7, - 0x00, 0xfc, 0xff, 0xff, 0xfd, 0x05, 0x02, 0xfc, 0xfc, 0xf8, 0xfb, 0xfe, 0xfe, - 0x01, 0xe8, 0xfe, 0x03, 0xf0, 0x01, 0x02, 0xfb, 0x02, 0xf9, 0x07, 0xfc, 0xfe, - 0xff, 0xfc, 0x00, 0xfc, 0x03, 0x01, 0x02, 0x00, 0xf7, 0xf8, 0x06, 0x07, 0xff, - 0xff, 0xf8, 0x01, 0xfc, 0xfe, 0xff, 0x06, 0x01, 0xfe, 0xfe, 0x0c, 0xf9, 0xff, - 0xff, 0xff, 0xfd, 0x06, 0xfe, 0x01, 0xfc, 0xfc, 0xfd, 0xfa, 0x04, 0xfd, 0x02, - 0xfd, 0xfa, 0x01, 0x03, 0x03, 0xfe, 0xfb, 0x00, 0xff, 0x01, 0x00, 0x05, 0x01, - 0xf7, 0x01, 0xfb, 0xff, 0x03, 0xff, 0xfd, 0xfc, 0xff, 0x00, 0x00, 0xff, 0xfe, - 0xf9, 0xfc, 0xfe, 0x07, 0xf6, 0x01, 0xff, 0x00, 0xfa, 0x01, 0x00, 0xfd, 0xfc, - 0xff, 0xfd, 0x04, 0xff, 0xff, 0x06, 0x01, 0x01, 0x03, 0x03, 0xff, 0xff, 0xf9, - 0xfe, 0xe6, 0x06, 0x02, 0xfa, 0x01, 0x01, 0x02, 0x00, 0xfa, 0x00, 0xfe, 0x01, - 0x01, 0x03, 0xfd, 0x04, 0x00, 0x03, 0xff, 0xfd, 0xfa, 0x02, 0x00, 0x01, 0xfa, - 0xfd, 0x05, 0xf8, 0xfc, 0x01, 0x04, 0x03, 0xfe, 0x00, 0xfe, 0x00, 0xff, 0xfd, - 0xfd, 0xfc, 0x01, 0xfe, 0x03, 0xfe, 0xfd, 0xfb, 0x02, 0x03, 0xff, 0xfb, 0xff, - 0xfd, 0x06, 0x00, 0xff, 0x02, 0x04, 0x02, 0xfc, 0x07, 0x04, 0x00, 0xfd, 0xfc, - 0x00, 0x04, 0xfd, 0xfe, 0xfd, 0xf9, 0xff, 0xfc, 0x06, 0x01, 0xff, 0xff, 0xfd, - 0xfe, 0xff, 0x05, 0xfc, 0xfc, 0xfd, 0xf8, 0x01, 0xfc, 0x03, 0x07, 0x08, 0x00, - 0xfe, 0x11, 0x04, 0xff, 0x02, 0xfe, 0xff, 0x09, 0x03, 0x00, 0x02, 0x04, 0x01, - 0x05, 0xfb, 0x04, 0x04, 0x04, 0x04, 0x03, 0xff, 0xfc, 0x00, 0x04, 0x02, 0x05, - 0xfc, 0x04, 0xfd, 0xfd, 0xfa, 0xfe, 0x02, 0xf7, 0xfd, 0x07, 0x03, 0x03, 0x02, - 0xfb, 0x02, 0x00, 0x00, 0x02, 0x02, 0x00, 0xfc, 0x01, 0xfb, 0x01, 0x02, 0x02, - 0xfb, 0xff, 0x03, 0x01, 0x03, 0x01, 0xfb, 0x02, 0xfa, 0x00, 0xf9, 0xff, 0x03, - 0xfa, 0xfe, 0xfe, 0x02, 0x02, 0x02, 0xff, 0xfd, 0xf9, 0x00, 0xff, 0xfe, 0xff, - 0xfc, 0xff, 0xff, 0xfd, 0x02, 0xff, 0x01, 0x00, 0x01, 0xfd, 0x00, 0xfe, 0xff, - 0xfd, 0x03, 0x04, 0xfd, 0x01, 0x02, 0x05, 0xf8, 0xfd, 0xff, 0x01, 0x00, 0xfe, - 0xfe, 0x00, 0x01, 0xfe, 0xff, 0x00, 0x03, 0x00, 0x02, 0x00, 0xfc, 0xfa, 0x02, - 0x03, 0xff, 0xfd, 0xfb, 0xf7, 0x06, 0x00, 0xff, 0x01, 0x03, 0x00, 0xfe, 0x08, - 0x04, 0x01, 0xfc, 0xfd, 0xff, 0x05, 0xff, 0xff, 0xe4, 0xfa, 0xfe, 0xfd, 0x05, - 0xfb, 0x00, 0x00, 0x00, 0xfe, 0x02, 0x00, 0x04, 0xfe, 0xfa, 0x01, 0xff, 0xfe, - 0x02, 0x01, 0x03, 0x02, 0x00, 0xfd, 0x00, 0x01, 0xf5, 0xff, 0x00, 0xfd, 0x02, - 0x00, 0x01, 0x03, 0x03, 0x01, 0xfc, 0x03, 0xfe, 0x02, 0x01, 0x05, 0xfc, 0xfe, - 0x03, 0x02, 0x03, 0x01, 0xfd, 0x01, 0xfc, 0xff, 0xfa, 0xff, 0x03, 0xfa, 0xfe, - 0x00, 0x03, 0x02, 0x02, 0xfe, 0xfc, 0x00, 0xfd, 0xfe, 0xfc, 0xff, 0x05, 0xfa, - 0x03, 0xff, 0xf9, 0xfd, 0x04, 0x06, 0xff, 0xff, 0xfe, 0x00, 0xf5, 0x00, 0xff, - 0x03, 0x06, 0xfd, 0xfc, 0x0e, 0xfb, 0xff, 0xf9, 0x03, 0xfe, 0x07, 0xff, 0xff, - 0x01, 0xfc, 0xfe, 0xfa, 0x03, 0xfc, 0xfd, 0xfe, 0xfd, 0xfd, 0x03, 0x03, 0xfc, - 0xfc, 0xfd, 0xff, 0x09, 0xff, 0xef, 0x00, 0x06, 0x02, 0xfa, 0x06, 0x05, 0xfc, - 0xfc, 0x00, 0xfe, 0x06, 0xfe, 0xeb, 0xff, 0xfd, 0xfb, 0xfd, 0x03, 0x01, 0x01, - 0xff, 0x08, 0xfc, 0x04, 0x01, 0x00, 0xff, 0xfd, 0xf8, 0x03, 0xfd, 0x01, 0x04, - 0x02, 0x02, 0x05, 0x05, 0x04, 0xfd, 0xff, 0x02, 0xff, 0x01, 0x02, 0x02, 0x01, - 0x04, 0x02, 0x04, 0xfe, 0x04, 0x03, 0x04, 0x06, 0x02, 0xff, 0xf8, 0x07, 0x02, - 0x05, 0x03, 0xfe, 0x03, 0xfb, 0x01, 0xf9, 0xfe, 0x04, 0xfa, 0xfe, 0x04, 0x05, - 0x04, 0x01, 0xfb, 0xfe, 0xff, 0xff, 0xfc, 0x01, 0xf9, 0x0b, 0x00, 0xff, 0x00, - 0xfb, 0xfc, 0x05, 0x07, 0x01, 0xfd, 0xf8, 0x04, 0xfd, 0x00, 0xfe, 0x08, 0x03, - 0xfe, 0xfc, 0x0c, 0xfa, 0xfe, 0xfc, 0xff, 0xff, 0x04, 0xfe, 0x02, 0xfd, 0xff, - 0xfa, 0xfb, 0x05, 0xfb, 0x01, 0xfd, 0xfa, 0xfe, 0x04, 0x00, 0xfc, 0xfc, 0xfc, - 0xfd, 0xff, 0xff, 0x02, 0x00, 0x04, 0x00, 0xfd, 0x09, 0x02, 0x01, 0xfc, 0x00, - 0xfe, 0x05, 0xff, 0xff, 0x01, 0xfd, 0x00, 0x00, 0x07, 0xfd, 0x00, 0xfc, 0xfd, - 0xfc, 0x02, 0x00, 0xfa, 0xff, 0xfd, 0xf9, 0x05, 0x01, 0xff, 0x03, 0x00, 0x01, - 0xfe, 0x11, 0xfa, 0xfc, 0xfd, 0xfc, 0xe8, 0x07, 0x02, 0xfd, 0x04, 0x01, 0x02, - 0x02, 0xf9, 0x00, 0x02, 0x04, 0x01, 0x04, 0xff, 0xf7, 0x03, 0x03, 0x03, 0x01, - 0xfb, 0x02, 0xfb, 0xff, 0xfa, 0xfd, 0x03, 0xf8, 0xfd, 0x05, 0x05, 0x01, 0x02, - 0xfd, 0xff, 0x00, 0x00, 0xff, 0xfe, 0xfb, 0x06, 0xfc, 0x01, 0xfc, 0xfd, 0xff, - 0x04, 0x04, 0xfd, 0xfd, 0xff, 0xfd, 0x04, 0xfe, 0xfe, 0x01, 0x01, 0x01, 0xfc, - 0x04, 0x05, 0xfe, 0x00, 0xff, 0xff, 0x06, 0xfd, 0xfd, 0x00, 0xfd, 0x00, 0xff, - 0xfb, 0xfe, 0xfe, 0x00, 0xfd, 0xfb, 0xff, 0x04, 0xfc, 0xfe, 0xfc, 0xfd, 0x00, - 0xff, 0x01, 0x05, 0x03, 0x01, 0x00, 0xfc, 0x06, 0x02, 0xff, 0x00, 0x00, 0x07, - 0xff, 0xf0, 0x04, 0xfd, 0x01, 0xfd, 0xfe, 0xfd, 0x01, 0xfc, 0xfb, 0x03, 0xfe, - 0x05, 0x00, 0xfd, 0xfd, 0xfb, 0xf8, 0x00, 0xff, 0x01, 0xf7, 0xfb, 0x03, 0xf2, - 0xfe, 0x03, 0xfc, 0x02, 0xfa, 0x05, 0x02, 0x02, 0x00, 0x01, 0x01, 0x02, 0xfb, - 0x03, 0xec, 0x04, 0x03, 0x05, 0xfe, 0xef, 0x00, 0x02, 0x04, 0x05, 0xff, 0x01, - 0xb3, 0xfe, 0xf9, 0xfd, 0x02, 0xfb, 0xfe, 0xff, 0x05, 0x03, 0x02, 0xfd, 0xfe, - 0xf9, 0xff, 0xff, 0xfd, 0xfc, 0xfc, 0xff, 0xff, 0xfd, 0x02, 0x00, 0x00, 0x01, - 0xfe, 0xff, 0x00, 0xff, 0xfc, 0xff, 0x00, 0x04, 0xfd, 0x02, 0xfe, 0x08, 0xfa, - 0xfd, 0xff, 0x00, 0x01, 0xf9, 0xff, 0x00, 0x00, 0xfd, 0xfd, 0xff, 0x07, 0xff, - 0x03, 0xfe, 0xfc, 0xfe, 0x02, 0x03, 0xff, 0xff, 0xf9, 0xf7, 0x06, 0xfc, 0xff, - 0x03, 0x02, 0x01, 0xfc, 0x07, 0x05, 0xff, 0x00, 0xff, 0x00, 0x04, 0xff, 0x01, - 0xec, 0xfb, 0xfd, 0x00, 0x02, 0xfa, 0x02, 0x00, 0xfd, 0xfd, 0x01, 0x00, 0x03, - 0xfe, 0xfb, 0x02, 0xf9, 0xff, 0x01, 0xff, 0xf6, 0x01, 0x01, 0xf0, 0x00, 0xff, - 0xf3, 0x02, 0xfe, 0x00, 0x02, 0x00, 0xff, 0x02, 0x03, 0x02, 0xfc, 0x04, 0xf7, - 0x01, 0x01, 0x03, 0x00, 0x01, 0x01, 0x01, 0x02, 0x05, 0xfd, 0x02, 0xfd, 0xff, - 0xfd, 0xff, 0x03, 0xf9, 0xfc, 0xff, 0x02, 0x03, 0x02, 0xff, 0xfe, 0x00, 0xfc, - 0xfc, 0xfe, 0xfe, 0x01, 0xfc, 0x02, 0x00, 0xfd, 0xfe, 0x04, 0x04, 0xfd, 0xfe, - 0xff, 0x00, 0xf1, 0xff, 0x01, 0x04, 0x00, 0xfd, 0xfe, 0x03, 0xf6, 0xfd, 0xfb, - 0x00, 0xff, 0x07, 0xfe, 0x01, 0x01, 0xfc, 0x00, 0xfc, 0x04, 0xfe, 0xfe, 0xfe, - 0xfd, 0xfc, 0x03, 0x04, 0xfb, 0xfc, 0x00, 0xfe, 0x05, 0xfe, 0xf8, 0x00, 0x04, - 0x03, 0xfa, 0x0b, 0x03, 0xff, 0xfd, 0xfc, 0xff, 0x05, 0x00, 0xb8, 0x00, 0xfd, - 0xfc, 0xfd, 0x06, 0x00, 0x05, 0xfd, 0x01, 0xf7, 0x04, 0x06, 0xff, 0x00, 0xfc, - 0xf8, 0x04, 0xfe, 0x01, 0x02, 0xff, 0x01, 0xfc, 0x00, 0x01, 0x02, 0xf9, 0x00, - 0xfb, 0xfe, 0x02, 0x06, 0xfa, 0xfe, 0x01, 0x01, 0xfd, 0x02, 0xd9, 0x01, 0x02, - 0x03, 0xff, 0xfd, 0x02, 0x02, 0x01, 0x04, 0xfd, 0x00, 0xa1, 0x01, 0xfa, 0xfe, - 0x01, 0xfa, 0xfd, 0xf3, 0x01, 0x03, 0x03, 0xfd, 0xfc, 0xfe, 0xff, 0xfc, 0x00, - 0xfc, 0x06, 0xfd, 0x04, 0xfe, 0xf9, 0xfa, 0x05, 0x09, 0xfb, 0x00, 0xf8, 0x04, - 0xff, 0x00, 0xfc, 0x08, 0x05, 0xfc, 0xfe, 0x0f, 0xf7, 0xfe, 0xfb, 0xfe, 0x00, - 0x0a, 0xfe, 0x01, 0xfb, 0xff, 0xfa, 0xfa, 0x03, 0xfb, 0x02, 0xfe, 0xfd, 0xff, - 0x04, 0x03, 0xfa, 0xfd, 0xfb, 0xfc, 0x01, 0xff, 0x00, 0xff, 0xf4, 0x01, 0xfd, - 0x03, 0x04, 0xfd, 0xfd, 0x01, 0xfd, 0x04, 0xff, 0xf8, 0x01, 0xfc, 0x02, 0x00, - 0x03, 0xfb, 0x02, 0xf9, 0x00, 0x00, 0x04, 0x03, 0xfc, 0xf9, 0xfd, 0xfb, 0x0a, - 0x01, 0x01, 0x04, 0x02, 0xff, 0x00, 0xf3, 0xfd, 0x00, 0x00, 0xfe, 0xe6, 0x0c, - 0x02, 0x03, 0x01, 0x04, 0x04, 0x02, 0xfa, 0x06, 0xfb, 0x03, 0x03, 0x04, 0xff, - 0x01, 0x05, 0x03, 0x02, 0x03, 0xfb, 0x03, 0xf9, 0xfa, 0xfc, 0xff, 0x02, 0xf5, - 0xfe, 0x00, 0x01, 0x00, 0x02, 0xfa, 0xfd, 0x01, 0xff, 0xfd, 0xfe, 0xfb, 0x06, - 0xfb, 0x01, 0xf6, 0xfc, 0xfb, 0x02, 0x04, 0xfd, 0xfe, 0xfe, 0xfe, 0x08, 0xfe, - 0xfd, 0x02, 0x06, 0x03, 0xfc, 0x10, 0x04, 0x00, 0xfe, 0xfe, 0xfe, 0x06, 0xfd, - 0xf8, 0xff, 0x00, 0x00, 0xfe, 0x01, 0x01, 0x00, 0x00, 0xf9, 0xf8, 0xff, 0x06, - 0x01, 0xfc, 0xfb, 0xf9, 0xf9, 0x00, 0x00, 0x07, 0x06, 0x00, 0x03, 0x0f, 0x04, - 0x04, 0x00, 0xfd, 0x00, 0x08, 0x02, 0x00, 0x05, 0x04, 0x03, 0x04, 0xf9, 0x07, - 0xfc, 0x05, 0x04, 0x04, 0xfd, 0xf8, 0x01, 0x05, 0x08, 0x08, 0xfb, 0x03, 0xe0, - 0xf8, 0xfe, 0xfb, 0x01, 0xf3, 0xfd, 0x06, 0x04, 0x03, 0x06, 0xf9, 0x02, 0xfe, - 0x01, 0x02, 0x03, 0x03, 0xfb, 0x03, 0x00, 0x03, 0x05, 0x06, 0xff, 0x01, 0x02, - 0x01, 0x02, 0x02, 0xfd, 0x03, 0x01, 0xfb, 0xfa, 0xfd, 0x01, 0xf9, 0xfd, 0x01, - 0x05, 0x02, 0x03, 0xfd, 0xff, 0xf4, 0x00, 0xff, 0xfb, 0xff, 0xfa, 0xff, 0x01, - 0xfe, 0x02, 0x03, 0x02, 0x02, 0x01, 0xfd, 0xfe, 0xff, 0xfd, 0xff, 0x01, 0x06, - 0x03, 0x03, 0x01, 0x03, 0xfb, 0x03, 0xfd, 0xfd, 0x00, 0xf5, 0xfb, 0x00, 0x01, - 0xfc, 0xff, 0xff, 0x06, 0xfe, 0x02, 0xff, 0xfa, 0xfb, 0x04, 0x03, 0x00, 0xfe, - 0xfe, 0xf0, 0x08, 0xfa, 0x01, 0x02, 0x03, 0x02, 0xfc, 0x0b, 0x03, 0x00, 0xfc, - 0xfe, 0xfe, 0x04, 0xff, 0x00, 0xe4, 0xf9, 0xfc, 0xfb, 0x04, 0xf4, 0xfe, 0xfa, - 0xfe, 0xfe, 0x01, 0xff, 0x06, 0xfb, 0xfd, 0x01, 0xfa, 0xfe, 0xff, 0x01, 0x01, - 0x01, 0x03, 0xf3, 0xff, 0xf4, 0xf1, 0x01, 0xfd, 0xfe, 0x01, 0x00, 0x01, 0x01, - 0x04, 0x04, 0xfa, 0x04, 0xfb, 0x03, 0x05, 0x03, 0xff, 0xf7, 0x01, 0x02, 0x04, - 0x01, 0xfc, 0x03, 0xf9, 0xfe, 0xfc, 0xfe, 0x04, 0xf9, 0xfd, 0x01, 0x03, 0x03, - 0x02, 0xfe, 0xfd, 0xfe, 0xfa, 0xfe, 0xff, 0xfd, 0x02, 0xf9, 0x02, 0xff, 0xfe, - 0x00, 0x04, 0x04, 0xfb, 0xfa, 0xff, 0x02, 0xe5, 0xfb, 0xff, 0x05, 0x02, 0xfd, - 0x00, 0x0f, 0xf8, 0xff, 0x00, 0x00, 0x01, 0xff, 0xfc, 0x00, 0x00, 0xf8, 0x00, - 0xf8, 0x08, 0xfe, 0xfa, 0xfd, 0xfb, 0xfc, 0x02, 0x03, 0xfc, 0xfd, 0xfd, 0xff, - 0x08, 0xfe, 0xfa, 0x04, 0x09, 0x04, 0xfb, 0x0b, 0x04, 0xf8, 0xfc, 0xfe, 0xfe, - 0x05, 0x02, 0x00, 0xff, 0x01, 0x05, 0xff, 0xfc, 0x03, 0xf9, 0x02, 0x04, 0x05, - 0xfd, 0x00, 0xff, 0x02, 0x04, 0xff, 0xfb, 0x03, 0xf5, 0xfb, 0xf9, 0xfe, 0x02, - 0xf8, 0xfd, 0xff, 0x02, 0x03, 0x02, 0xfd, 0x00, 0xeb, 0x0b, 0xfd, 0x03, 0xfb, - 0xfd, 0x04, 0x05, 0x00, 0x01, 0xfe, 0x02, 0x00, 0x04, 0x01, 0x03, 0x02, 0xfc, - 0x03, 0xf7, 0xf9, 0xff, 0xfb, 0xfe, 0xf0, 0xfe, 0x10, 0x09, 0x00, 0x03, 0xf3, - 0x01, 0x03, 0xfb, 0x02, 0x01, 0x03, 0xfd, 0x03, 0xf3, 0x01, 0x04, 0x02, 0x00, - 0xf3, 0xfe, 0x01, 0x03, 0x02, 0xfd, 0x03, 0xe7, 0xff, 0xfa, 0xfe, 0x02, 0xfb, - 0xfe, 0xf7, 0x00, 0x04, 0x03, 0xfe, 0x01, 0xfd, 0x00, 0x04, 0x03, 0x01, 0xfa, - 0x04, 0xfd, 0x01, 0x04, 0x04, 0xfe, 0x01, 0x05, 0x04, 0x03, 0x03, 0xfe, 0x03, - 0xfb, 0x00, 0xfa, 0xfe, 0x03, 0xf9, 0xfd, 0xfd, 0x01, 0x01, 0x02, 0xfc, 0xfe, - 0x00, 0xf3, 0xff, 0x01, 0xfc, 0x06, 0xfa, 0xf8, 0xfa, 0xfd, 0xff, 0x02, 0x04, - 0xfa, 0xfa, 0xfd, 0x01, 0x02, 0xf9, 0xeb, 0xf9, 0x07, 0x04, 0xfb, 0x04, 0x06, - 0xfc, 0xfb, 0xfe, 0xff, 0xf9, 0xff, 0xf9, 0xfd, 0xfc, 0xff, 0xfc, 0xfa, 0x03, - 0xff, 0x00, 0x01, 0xfd, 0xfe, 0x03, 0xff, 0xfe, 0xfc, 0x01, 0xff, 0xfe, 0x03, - 0x03, 0xfb, 0x03, 0x01, 0x02, 0xfa, 0xfa, 0xf8, 0xff, 0xff, 0xf9, 0x02, 0xff, - 0x03, 0x02, 0x03, 0x02, 0xf7, 0x02, 0x00, 0x03, 0x03, 0x03, 0xfb, 0xfc, 0x03, - 0x03, 0x03, 0x02, 0xfc, 0x02, 0xfd, 0xff, 0xf5, 0xfb, 0x01, 0xf6, 0xfb, 0x02, - 0x01, 0x04, 0x01, 0xfd, 0xfd, 0xf6, 0x02, 0xfe, 0x03, 0xff, 0x07, 0xfd, 0x05, - 0xf6, 0x02, 0xfc, 0x03, 0xff, 0xfe, 0xfa, 0xfe, 0xf3, 0x07, 0x00, 0xfe, 0x08, - 0x00, 0x01, 0x03, 0x02, 0xfe, 0xff, 0xfa, 0x01, 0xe8, 0x0a, 0xfe, 0xfc, 0x01, - 0xff, 0x02, 0xfe, 0x03, 0xfd, 0x02, 0xfb, 0x00, 0xfe, 0x00, 0x03, 0x01, 0xff, - 0xfd, 0xf8, 0x08, 0xff, 0xfd, 0x04, 0x00, 0x03, 0x00, 0x02, 0x01, 0xfc, 0xfc, - 0xfd, 0xf5, 0x04, 0x01, 0xf0, 0x07, 0xff, 0x05, 0xff, 0xff, 0x05, 0x06, 0xfe, - 0xff, 0x03, 0xfd, 0x06, 0x04, 0x02, 0x01, 0xfd, 0xfb, 0x04, 0xfa, 0xfc, 0xf3, - 0xfb, 0x03, 0xef, 0xfb, 0x0d, 0x00, 0xff, 0xfb, 0x01, 0xfd, 0xff, 0x00, 0xfe, - 0xfe, 0xfe, 0x04, 0xff, 0x03, 0xfc, 0xfc, 0xfb, 0x01, 0x02, 0xfc, 0xfc, 0xfc, - 0xfc, 0x05, 0xff, 0xfe, 0x02, 0x03, 0x03, 0xfc, 0x0b, 0x04, 0xff, 0x00, 0xfe, - 0xfd, 0x06, 0x03, 0x09, 0xf7, 0xff, 0xff, 0x03, 0xfd, 0xfb, 0xea, 0x03, 0x01, - 0x03, 0xff, 0x02, 0x06, 0xff, 0x02, 0xfe, 0xfa, 0xff, 0x84, 0x02, 0xf7, 0xfe, - 0x04, 0xff, 0xfd, 0xef, 0xfc, 0x05, 0x00, 0x01, 0xfd, 0x00, 0xfe, 0xfd, 0x00, - 0xfc, 0x06, 0xfb, 0x01, 0xfe, 0xfb, 0xfc, 0x03, 0x04, 0xfd, 0xfe, 0xfa, 0xfb, - 0x03, 0xfc, 0x02, 0x04, 0x00, 0x01, 0xfb, 0x0a, 0x04, 0xff, 0x00, 0xff, 0xfd, - 0x04, 0xfe, 0xfe, 0xec, 0xfe, 0xfe, 0x02, 0x03, 0x00, 0xff, 0x01, 0xfc, 0x00, - 0xfe, 0x01, 0xfc, 0x03, 0xff, 0xfc, 0x00, 0xfc, 0xfe, 0x03, 0x05, 0x02, 0x00, - 0x00, 0x03, 0xfb, 0xff, 0xfd, 0xfe, 0xf2, 0xff, 0xfe, 0xff, 0xfc, 0xfd, 0xfc, - 0x02, 0xfb, 0x03, 0xfe, 0xf9, 0xfc, 0x05, 0x04, 0xfb, 0xfb, 0xfd, 0xfe, 0x07, - 0xfc, 0xfe, 0x01, 0x04, 0x02, 0xf8, 0x0a, 0x04, 0xff, 0xfd, 0xfd, 0xfd, 0x07, - 0x02, 0x00, 0x01, 0x03, 0x03, 0x03, 0xfb, 0x04, 0xf9, 0x03, 0x02, 0x05, 0xfd, - 0xfe, 0x03, 0x02, 0x03, 0x03, 0xfc, 0x02, 0xe5, 0xfa, 0xfa, 0xfe, 0x03, 0xf7, - 0xfd, 0x05, 0x04, 0x04, 0x03, 0xfe, 0x01, 0x02, 0x00, 0x02, 0x02, 0x01, 0xfa, - 0x03, 0xfd, 0x01, 0x03, 0x04, 0xff, 0xf8, 0x01, 0x02, 0x05, 0x02, 0xfc, 0x01, - 0xfa, 0xff, 0xf9, 0xfd, 0x01, 0xf9, 0xfe, 0x02, 0x05, 0x03, 0x01, 0xff, 0x00, - 0xff, 0x03, 0x03, 0x02, 0xff, 0x00, 0x07, 0xfd, 0x03, 0x06, 0x01, 0xfe, 0x00, - 0x04, 0x04, 0x03, 0x03, 0xfd, 0x03, 0xf5, 0xff, 0xf8, 0xff, 0x03, 0xf7, 0xfd, - 0xff, 0x04, 0x00, 0x01, 0xfd, 0x02, 0x06, 0xfe, 0x02, 0x02, 0x02, 0xfd, 0x00, - 0xfc, 0x02, 0x01, 0x03, 0xff, 0x04, 0x02, 0x00, 0x00, 0x01, 0xfb, 0x00, 0xf2, - 0x00, 0xfa, 0xff, 0x02, 0xf9, 0xff, 0xfd, 0x01, 0x03, 0x02, 0xfe, 0x02, 0x04, - 0xfd, 0x01, 0x02, 0x00, 0xfa, 0x04, 0xee, 0x02, 0x02, 0x03, 0xfe, 0xf1, 0x01, - 0x03, 0x04, 0x05, 0xfd, 0x03, 0xea, 0xfe, 0xfa, 0xfe, 0x04, 0xf8, 0xfd, 0xfc, - 0x03, 0x03, 0x03, 0xfe, 0x00, 0x00, 0xf9, 0x01, 0xff, 0xfd, 0x04, 0xfd, 0xfd, - 0xfe, 0xfe, 0xfd, 0x02, 0x06, 0xfc, 0xfa, 0xfd, 0xff, 0x03, 0xfa, 0xf8, 0xf9, - 0x04, 0x03, 0xfc, 0xfe, 0x03, 0xfc, 0xfd, 0xfe, 0xff, 0x00, 0xfe, 0xfd, 0xff, - 0xff, 0x00, 0xfd, 0xfe, 0xff, 0xfd, 0x03, 0x02, 0xfa, 0xff, 0x01, 0x01, 0xf9, - 0xf8, 0xfd, 0x00, 0xff, 0x06, 0x03, 0xfb, 0x03, 0x02, 0x08, 0xfb, 0xfc, 0xfc, - 0xff, 0xfe, 0xfc, 0x03, 0x00, 0x00, 0x00, 0x03, 0x03, 0xfa, 0x03, 0xf4, 0x03, - 0x03, 0x05, 0xff, 0xfd, 0x03, 0x01, 0x02, 0x02, 0xfc, 0x01, 0xf2, 0xfe, 0xfb, - 0xfe, 0x03, 0xf7, 0xfd, 0x02, 0x01, 0x02, 0x02, 0xfc, 0xfd, 0xfe, 0x01, 0xfd, - 0x01, 0xfd, 0x05, 0xfa, 0x02, 0xf6, 0x01, 0xfc, 0x03, 0xfd, 0xfe, 0xfb, 0x01, - 0xf2, 0x04, 0x00, 0x00, 0x05, 0xff, 0x01, 0x05, 0x04, 0xfb, 0xfd, 0xfe, 0xff, - 0xf3, 0x08, 0xfe, 0x01, 0x01, 0x00, 0xfe, 0x02, 0x03, 0xfa, 0x02, 0xfe, 0xfe, - 0xfd, 0x01, 0x00, 0xfd, 0x00, 0x00, 0xfa, 0x03, 0x00, 0xff, 0x03, 0x01, 0x02, - 0xff, 0x05, 0x04, 0xff, 0xfc, 0xff, 0xf7, 0x05, 0x03, 0x06, 0x03, 0x02, 0x01, - 0x03, 0xfd, 0x08, 0x00, 0x08, 0x04, 0x01, 0xfd, 0xf2, 0x06, 0x04, 0x04, 0x07, - 0x00, 0x06, 0xf9, 0xff, 0xfc, 0xfd, 0x05, 0xf6, 0xfe, 0x03, 0x03, 0x04, 0x08, - 0xfa, 0xfe, 0x00, 0x01, 0xff, 0xfd, 0xfe, 0x05, 0xfd, 0x01, 0xfe, 0xfb, 0xfc, - 0x02, 0x03, 0xfd, 0xfe, 0xfc, 0xfd, 0x05, 0x00, 0x00, 0x03, 0x03, 0x00, 0xfb, - 0x07, 0x03, 0xff, 0xfe, 0xfe, 0xff, 0x03, 0x02, 0x04, 0xfe, 0x06, 0x00, 0x01, - 0xfe, 0x03, 0x02, 0xfe, 0x02, 0x01, 0x00, 0xfd, 0x02, 0x02, 0x02, 0x03, 0xfd, - 0x03, 0xef, 0x02, 0xfb, 0xfe, 0x01, 0xfd, 0xff, 0xfd, 0x00, 0x01, 0x00, 0xff, - 0xfe, 0x00, 0x00, 0xfe, 0x01, 0xfe, 0x07, 0xfc, 0x02, 0xff, 0xfb, 0xfe, 0x04, - 0x04, 0xff, 0xfe, 0xf9, 0xfc, 0x05, 0xfe, 0x04, 0x03, 0x04, 0x00, 0xfa, 0x06, - 0x03, 0xff, 0xfd, 0x00, 0xff, 0x05, 0x00, 0x00, 0xea, 0x00, 0x00, 0xff, 0x00, - 0x01, 0x02, 0x00, 0x00, 0xfe, 0xfc, 0x01, 0x03, 0x00, 0xfd, 0xfc, 0x01, 0xfd, - 0x02, 0x02, 0x06, 0x02, 0x02, 0x00, 0x02, 0xff, 0xfd, 0xfe, 0x00, 0xf9, 0xfe, - 0x00, 0x00, 0xfd, 0xfd, 0xff, 0x05, 0xfc, 0x01, 0xff, 0xfc, 0xfc, 0x03, 0x02, - 0xfd, 0xfc, 0xfe, 0xff, 0x03, 0x00, 0xfd, 0x02, 0x04, 0x02, 0xf9, 0x09, 0x04, - 0x00, 0xfe, 0xfd, 0xfe, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x02, 0xfb, 0x00, - 0x00, 0x02, 0x04, 0x01, 0xfe, 0xfd, 0x05, 0x01, 0x03, 0x01, 0xfc, 0x03, 0x02, - 0xfd, 0xf5, 0xff, 0x04, 0xfb, 0xfd, 0x04, 0x05, 0x03, 0x02, 0xfe, 0x02, 0x00, - 0x01, 0x02, 0x03, 0x03, 0xfa, 0x03, 0xfd, 0x05, 0x05, 0x04, 0xfe, 0xfd, 0x02, - 0x03, 0x02, 0x04, 0xfe, 0x03, 0xf8, 0xfd, 0xf9, 0xfd, 0x02, 0xf7, 0xfd, 0x03, - 0x04, 0x02, 0x02, 0xfd, 0x03, 0x06, 0xf8, 0x00, 0x02, 0x00, 0xfe, 0x04, 0xfe, - 0x00, 0x02, 0x03, 0xff, 0xf8, 0x01, 0x00, 0x04, 0x04, 0xfc, 0x03, 0xfa, 0xfe, - 0xf7, 0xff, 0x01, 0xfa, 0x00, 0x00, 0x01, 0x02, 0x05, 0xff, 0x02, 0x00, 0x01, - 0x03, 0x04, 0x02, 0xfc, 0x03, 0x00, 0x01, 0x04, 0x04, 0xfe, 0xfc, 0xfe, 0x02, - 0x01, 0x02, 0xfc, 0x02, 0xfa, 0x00, 0xfa, 0xfc, 0x04, 0xf9, 0xff, 0x02, 0x03, - 0x03, 0x02, 0x00, 0x03, 0x01, 0xfe, 0x02, 0x01, 0xff, 0xfa, 0x03, 0xfd, 0x01, - 0x04, 0x04, 0xfe, 0x02, 0x02, 0x03, 0x02, 0x01, 0xfd, 0x02, 0x00, 0xfe, 0xfd, - 0xfd, 0x00, 0xfa, 0xfe, 0x00, 0x03, 0x02, 0x03, 0xfd, 0xff, 0xff, 0xf8, 0xfe, - 0xfd, 0xff, 0x02, 0xfb, 0xf9, 0xfe, 0x02, 0xfd, 0x00, 0x03, 0x05, 0xfc, 0xfb, - 0x00, 0x02, 0xfb, 0xf9, 0xfa, 0x02, 0x03, 0xfd, 0x03, 0x02, 0x01, 0xfe, 0xff, - 0xff, 0xfe, 0x00, 0xff, 0xff, 0xfe, 0xff, 0xfe, 0xf9, 0x01, 0xfe, 0xff, 0x00, - 0xfd, 0xff, 0x03, 0x03, 0xfe, 0xf9, 0x00, 0x03, 0x00, 0x05, 0x03, 0x00, 0x02, - 0x03, 0xfe, 0xf7, 0xfd, 0xfa, 0xff, 0x00, 0xf9, 0x02, 0xff, 0x01, 0x03, 0x03, - 0x03, 0xfb, 0x03, 0x00, 0x03, 0x01, 0x04, 0xff, 0x02, 0x04, 0x03, 0x01, 0x01, - 0xfe, 0x00, 0x00, 0x00, 0xfd, 0xff, 0x03, 0xfa, 0xfe, 0x01, 0x03, 0x02, 0x01, - 0xfe, 0xfd, 0xfd, 0xff, 0xfc, 0xfe, 0xfd, 0x04, 0xf1, 0x02, 0xf8, 0x01, 0xfc, - 0x03, 0x02, 0xfe, 0xfd, 0x00, 0xf5, 0x05, 0xfe, 0xff, 0x05, 0xff, 0xff, 0x01, - 0x08, 0x00, 0xfd, 0xf9, 0xf8, 0xee, 0x09, 0xfe, 0x01, 0xff, 0xff, 0xff, 0x00, - 0x02, 0xf8, 0x01, 0xff, 0x02, 0xfd, 0xfe, 0x01, 0x00, 0xfe, 0x00, 0xfa, 0x04, - 0xfe, 0x00, 0x02, 0x01, 0x01, 0xfd, 0x00, 0x00, 0xfb, 0xfb, 0xfd, 0xf8, 0x04, - 0x01, 0x03, 0xfc, 0xfe, 0x01, 0xff, 0xfb, 0xfe, 0x02, 0x00, 0x02, 0x04, 0xff, - 0x04, 0x02, 0xfe, 0x00, 0xfb, 0xff, 0x01, 0xfa, 0x03, 0xfb, 0xfe, 0x01, 0xfe, - 0x00, 0xfb, 0x01, 0x03, 0xfe, 0x01, 0xfd, 0x01, 0xff, 0xfd, 0xff, 0xfe, 0x04, - 0xff, 0x01, 0xff, 0xfc, 0xfd, 0x02, 0x01, 0xfe, 0xff, 0xfd, 0xfe, 0x06, 0xfe, - 0x00, 0x03, 0x01, 0x01, 0xfc, 0x08, 0x03, 0xff, 0xfe, 0x00, 0xfd, 0x04, 0x02, - 0x00, 0x03, 0x03, 0x01, 0x04, 0xfd, 0x04, 0x00, 0x03, 0x03, 0xfe, 0xfe, 0xfc, - 0x03, 0x05, 0x02, 0x08, 0xfe, 0x01, 0xf0, 0xfc, 0xfb, 0xff, 0x02, 0xf6, 0xfe, - 0x01, 0x07, 0x01, 0x07, 0xfe, 0xfc, 0x00, 0x00, 0x00, 0xfe, 0xff, 0x04, 0xfd, - 0x03, 0xfc, 0xfc, 0xfc, 0x03, 0x04, 0xfd, 0x00, 0xfe, 0xfd, 0x05, 0xfe, 0x02, - 0x00, 0x02, 0x02, 0xfe, 0x0b, 0x02, 0x01, 0x01, 0xff, 0xfe, 0x05, 0x00, 0x00, - 0xed, 0x02, 0x00, 0xff, 0x03, 0xfe, 0x01, 0x01, 0xff, 0x01, 0xfc, 0x00, 0x00, - 0xff, 0xfb, 0xfb, 0x01, 0xfd, 0x01, 0x00, 0x01, 0x03, 0x02, 0xff, 0x02, 0xfe, - 0xfb, 0xff, 0xfe, 0xfa, 0xff, 0x02, 0xff, 0xff, 0xfb, 0xfd, 0x03, 0xfe, 0x01, - 0xfd, 0xfd, 0xfe, 0x02, 0x05, 0xfc, 0xfc, 0xfd, 0xff, 0x06, 0xfd, 0x01, 0x02, - 0x02, 0x02, 0xfd, 0x04, 0x04, 0xff, 0xfd, 0xff, 0xfe, 0x07, 0x02, 0xfe, 0x02, - 0x01, 0x04, 0x03, 0xfb, 0x06, 0x01, 0x02, 0x02, 0x01, 0xfd, 0xff, 0x03, 0x03, - 0x03, 0x01, 0xff, 0x04, 0xfc, 0xff, 0xf7, 0xfd, 0x03, 0xf9, 0xfe, 0x01, 0xff, - 0x03, 0xff, 0xff, 0x03, 0xfc, 0x01, 0x01, 0x03, 0x03, 0xfb, 0x02, 0x03, 0x01, - 0x04, 0x07, 0xfe, 0xfc, 0x05, 0xff, 0x05, 0x03, 0xfe, 0x02, 0xfe, 0xfe, 0xfa, - 0xfd, 0x03, 0xf6, 0xfc, 0x03, 0x04, 0x00, 0x02, 0xfc, 0x02, 0x09, 0xf5, 0xfe, - 0x02, 0x01, 0x00, 0xfc, 0xf5, 0xff, 0x02, 0x05, 0xfd, 0x03, 0xff, 0x01, 0x01, - 0xfc, 0xfe, 0x00, 0xc6, 0x03, 0xf7, 0xfe, 0x01, 0xfe, 0xfc, 0xeb, 0xfc, 0x05, - 0xff, 0x02, 0x02, 0xf2, 0x06, 0x00, 0x04, 0x02, 0xfa, 0x01, 0x06, 0x03, 0xfe, - 0x03, 0xfd, 0x02, 0x06, 0x01, 0x01, 0x00, 0xf9, 0x03, 0xfa, 0xfc, 0xf9, 0xf8, - 0x07, 0xf5, 0xfd, 0x0a, 0x09, 0x02, 0xff, 0x00, 0x03, 0xfb, 0x04, 0x00, 0x04, - 0x04, 0xfb, 0x01, 0x05, 0x02, 0x05, 0x02, 0xfd, 0xfa, 0x03, 0x02, 0x02, 0x01, - 0xfd, 0x03, 0xff, 0x00, 0xfa, 0xfa, 0x01, 0xf7, 0xfb, 0x09, 0x03, 0x03, 0x01, - 0xfe, 0xfd, 0x01, 0xf3, 0xff, 0x01, 0xfd, 0x05, 0xf9, 0xf6, 0xfe, 0xfe, 0xff, - 0x04, 0x03, 0xfc, 0xfb, 0xfb, 0x00, 0x01, 0xfb, 0xee, 0xf9, 0x05, 0x02, 0xfd, - 0x02, 0x05, 0xfc, 0xfb, 0x00, 0xff, 0xfb, 0x00, 0xfc, 0xfe, 0x03, 0xff, 0xfe, - 0xf1, 0x02, 0xff, 0x02, 0x01, 0xff, 0xff, 0x01, 0x04, 0xfd, 0xfb, 0xff, 0xfd, - 0xff, 0x02, 0x04, 0xfd, 0x02, 0x00, 0xff, 0xf3, 0xfb, 0xff, 0x02, 0x01, 0xfd, - 0x02, 0x01, 0x00, 0x00, 0x03, 0x01, 0xfd, 0x05, 0xfa, 0x02, 0x04, 0x03, 0xfd, - 0xf6, 0x01, 0x03, 0x04, 0x04, 0xfc, 0x02, 0xef, 0xfe, 0xfc, 0xfd, 0x01, 0xf9, - 0xfe, 0xfe, 0x04, 0x03, 0x02, 0xfb, 0xfb, 0xfa, 0x01, 0xfd, 0x00, 0xfd, 0x06, - 0xe1, 0x04, 0xf2, 0xff, 0xf8, 0x02, 0x03, 0xfe, 0xfd, 0xfe, 0xed, 0x06, 0xfc, - 0xfd, 0x08, 0xff, 0x01, 0x03, 0x0c, 0xfc, 0x02, 0xfa, 0xff, 0xd6, 0x08, 0xfd, - 0xfe, 0xff, 0x01, 0x01, 0xfe, 0x08, 0xfb, 0x02, 0xfb, 0xff, 0xfd, 0xfe, 0x03, - 0x00, 0xfd, 0xff, 0xf9, 0x05, 0xfd, 0x00, 0x06, 0xff, 0x03, 0xfd, 0x09, 0x02, - 0xfc, 0xf7, 0xfc, 0xf3, 0x06, 0x02, 0x07, 0xfb, 0x02, 0xff, 0x02, 0xfc, 0x00, - 0xca, 0x02, 0x00, 0x05, 0xfd, 0xf8, 0x02, 0x02, 0x03, 0x05, 0x00, 0x01, 0xa0, - 0x02, 0xfd, 0xfd, 0x01, 0xfd, 0xfe, 0xf4, 0x01, 0x04, 0x05, 0xff, 0xfd, 0x02, - 0x01, 0xfd, 0xfb, 0xfe, 0x05, 0xfa, 0x04, 0x00, 0xfb, 0xfb, 0x01, 0x03, 0xff, - 0xfd, 0xfd, 0xfc, 0x05, 0xfd, 0xff, 0x03, 0x02, 0x04, 0xfb, 0x0a, 0x05, 0xff, - 0xfc, 0xfd, 0xfb, 0x05, 0x01, 0xea, 0x09, 0xff, 0x04, 0xfe, 0xfb, 0x03, 0x03, - 0x03, 0xfc, 0x03, 0xfd, 0x02, 0xfe, 0xff, 0x03, 0x00, 0xfd, 0x05, 0xfa, 0xfc, - 0xff, 0xfd, 0x02, 0xe5, 0xfe, 0x0d, 0x06, 0xff, 0xff, 0xf1, 0xfc, 0x01, 0x01, - 0xff, 0xfe, 0xfd, 0x03, 0xfc, 0x01, 0xfd, 0xf9, 0xfa, 0x03, 0x05, 0xfe, 0xff, - 0xfa, 0xfb, 0x05, 0xfd, 0x01, 0x03, 0x00, 0x02, 0xfd, 0x0b, 0x04, 0x00, 0xfd, - 0xff, 0xff, 0x05, 0x00, 0x00, 0xeb, 0xff, 0x01, 0xff, 0x01, 0xff, 0xfe, 0xff, - 0xfe, 0xfc, 0xfa, 0x00, 0x02, 0x02, 0xff, 0xfa, 0xfe, 0xfd, 0xff, 0x02, 0x04, - 0x02, 0x02, 0x01, 0x04, 0xfa, 0xfd, 0xff, 0x00, 0xf5, 0xff, 0xff, 0x01, 0xfc, - 0xfc, 0xfd, 0x05, 0xfa, 0x00, 0xfd, 0xfb, 0xf9, 0x04, 0x04, 0xfd, 0xfc, 0xfc, - 0xfe, 0x04, 0xfe, 0xff, 0x00, 0x03, 0x03, 0xfb, 0x0c, 0x03, 0xff, 0x00, 0xff, - 0xfd, 0x07, 0x04, 0x02, 0xff, 0x02, 0x02, 0x02, 0xfa, 0x03, 0xf5, 0x05, 0x04, - 0x06, 0xfd, 0xf9, 0x02, 0x03, 0x04, 0x04, 0xfb, 0x02, 0x96, 0xff, 0xfa, 0xfd, - 0x05, 0xf7, 0xfc, 0xfc, 0x02, 0x02, 0x04, 0xfb, 0x3a, 0xff, 0xff, 0xff, 0x00, - 0x00, 0x00, 0x09, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, - 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x04, 0x00, 0x06, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x08, 0x00, 0x04, 0x00, 0x06, - 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x5a, 0x3e, - 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, - 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, - 0x5a, 0x3e, 0x5a, 0x3e, 0x63, 0xdd, 0x9a, 0xcc, 0x36, 0xf9, 0x6a, 0xa4, 0x58, - 0xf1, 0xc8, 0xd3, 0x44, 0xe3, 0x0e, 0xca, 0x94, 0xeb, 0x65, 0xef, 0xed, 0xd1, - 0x12, 0xbf, 0x51, 0xcf, 0x92, 0xe9, 0xb5, 0xcd, 0x46, 0xbc, 0x5a, 0x3e, 0x5a, - 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, - 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, 0x3e, 0x5a, - 0x3e, 0x5a, 0x3e, 0x7a, 0xda, 0xa5, 0xeb, 0x7c, 0xce, 0x6a, 0xf4, 0xb4, 0xc3, - 0xd6, 0xef, 0x8a, 0xd1, 0x9a, 0xe1, 0xfb, 0xbd, 0xfb, 0xed, 0x9e, 0xce, 0xb2, - 0xbb, 0x6b, 0xef, 0xc7, 0xe7, 0xd9, 0xd6, 0xd5, 0xf2, 0x00, 0x00, 0x0e, 0x00, - 0x18, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0c, 0x00, 0x10, 0x00, 0x14, 0x00, 0x0e, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, - 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x30, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, - 0x58, 0xff, 0xff, 0xff, 0x14, 0x00, 0x1c, 0x00, 0x08, 0x00, 0x07, 0x00, 0x0c, - 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x14, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x73, 0x65, - 0x72, 0x76, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x5f, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x31, 0x3a, 0x30, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x04, 0x00, 0x08, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xd5, 0x44, 0xea, 0x3d, 0x04, - 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, -}; - -const int vnr_model_data_len = 11304; \ No newline at end of file diff --git a/modules/lib_vnr/src/inference/model/vnr_model_data.h b/modules/lib_vnr/src/inference/model/vnr_model_data.h deleted file mode 100644 index d6f4fcf32..000000000 --- a/modules/lib_vnr/src/inference/model/vnr_model_data.h +++ /dev/null @@ -1,10 +0,0 @@ -// This is a TensorFlow Lite model file that has been converted into a C data -// array using the convert_tflite_to_c_source() tool. - -#ifndef VNR_H_ -#define VNR_H_ - -extern const unsigned char vnr_model_data[]; -extern const int vnr_model_data_len; - -#endif // VNR_H_ \ No newline at end of file diff --git a/examples/bare-metal/vnr_test/src/wrapper.cpp b/modules/lib_vnr/src/inference/model/wrapper.cpp similarity index 98% rename from examples/bare-metal/vnr_test/src/wrapper.cpp rename to modules/lib_vnr/src/inference/model/wrapper.cpp index 88b0f27ef..35c8925b5 100644 --- a/examples/bare-metal/vnr_test/src/wrapper.cpp +++ b/modules/lib_vnr/src/inference/model/wrapper.cpp @@ -14,4 +14,5 @@ int8_t* vnr_get_output() { void vnr_inference_invoke() { model_invoke(); -} \ No newline at end of file +} + diff --git a/examples/bare-metal/vnr_test/src/wrapper.h b/modules/lib_vnr/src/inference/model/wrapper.h similarity index 96% rename from examples/bare-metal/vnr_test/src/wrapper.h rename to modules/lib_vnr/src/inference/model/wrapper.h index 95a75322d..bd1e4079a 100644 --- a/examples/bare-metal/vnr_test/src/wrapper.h +++ b/modules/lib_vnr/src/inference/model/wrapper.h @@ -10,4 +10,5 @@ extern "C" { void vnr_inference_invoke(); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif + diff --git a/modules/lib_vnr/src/inference/vnr_inference.cc b/modules/lib_vnr/src/inference/vnr_inference.cc index 93a8ae599..64308f1e3 100644 --- a/modules/lib_vnr/src/inference/vnr_inference.cc +++ b/modules/lib_vnr/src/inference/vnr_inference.cc @@ -2,14 +2,11 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include #include -#include "inference_engine.h" -#include "model/vnr_model_data.h" +#include "model/wrapper.h" #include "vnr_inference_api.h" #include "vnr_inference_priv.h" // Allocate all memory required by the inference engine -static struct tflite_micro_objects tflmo; // This structure can only be allocated from a C++ file since tflite_micro_objects definition is only visible in C++ files. -static inference_engine_t ie; static vnr_ie_state_t vnr_ie_state; @@ -17,19 +14,12 @@ static vnr_ie_state_t vnr_ie_state; #pragma stackfunction 1000 int32_t vnr_inference_init() { vnr_ie_state_t *ie_ptr = &vnr_ie_state; - auto *resolver = inference_engine_initialize(&ie, (uint32_t *)&ie_ptr->tensor_arena, TENSOR_ARENA_SIZE_BYTES, (uint32_t *) vnr_model_data, vnr_model_data_len, &tflmo); - // When adding a new operator, refer to lib_tflite_micro/lib_tflite_micro/submodules/tflite-micro/tensorflow/lite/micro/all_ops_resolver.cc for all available add operator functions - // Make sure XTFLM_OPERATORS defined in xtflm_conf.h is the same as the number of operators added - resolver->AddConv2D(); - resolver->AddReshape(); - resolver->AddLogistic(); - resolver->AddCustom(tflite::ops::micro::xcore::Conv2D_V2_OpCode, - tflite::ops::micro::xcore::Register_Conv2D_V2()); - int ret = inference_engine_load_model(&ie, vnr_model_data_len, (uint32_t *) vnr_model_data, 0); + + vnr_init(); // Initialise input quant and output dequant parameters vnr_priv_init_quant_spec(&ie_ptr->quant_spec); - return ret; + return 0; } @@ -37,13 +27,15 @@ int32_t vnr_inference_init() { #pragma stackfunction 1000 void vnr_inference(float_s32_t *vnr_output, bfp_s32_t *features) { vnr_ie_state_t *ie_state = &vnr_ie_state; + int8_t * in_buffer = vnr_get_input(); + int8_t * out_buffer = vnr_get_output(); // Quantise features to 8bit - vnr_priv_feature_quantise((int8_t *) ie.input_buffers[0], features, &ie_state->quant_spec); + vnr_priv_feature_quantise(in_buffer, features, &ie_state->quant_spec); // Inference - interp_invoke(&ie); + vnr_inference_invoke(); // Dequantise inference output - vnr_priv_output_dequantise(vnr_output, (int8_t*)ie.output_buffers[0], &ie_state->quant_spec); + vnr_priv_output_dequantise(vnr_output, out_buffer, &ie_state->quant_spec); } diff --git a/modules/lib_vnr/src/inference/vnr_inference_priv.h b/modules/lib_vnr/src/inference/vnr_inference_priv.h index 4dd3a848f..76a17b3bb 100644 --- a/modules/lib_vnr/src/inference/vnr_inference_priv.h +++ b/modules/lib_vnr/src/inference/vnr_inference_priv.h @@ -16,7 +16,6 @@ typedef struct { }vnr_model_quant_spec_t; typedef struct { - uint64_t tensor_arena[(TENSOR_ARENA_SIZE_BYTES + sizeof(uint64_t) - 1)/sizeof(uint64_t)]; /// Primary memory available to the inference engine vnr_model_quant_spec_t quant_spec; /// VNR model quantisation spec }vnr_ie_state_t; diff --git a/test/lib_vnr/CMakeLists.txt b/test/lib_vnr/CMakeLists.txt index 50ba452e4..33f9d0cd9 100644 --- a/test/lib_vnr/CMakeLists.txt +++ b/test/lib_vnr/CMakeLists.txt @@ -3,26 +3,15 @@ # only link against applications targeting XCORE-AI-EXPLORER which is fine for testing. lib_tflite_micro compilation is dependant on the HW # target which is why we don't build fwk_voice::vnr::inference as a static library in the modules/lib_vnr CMake file. -add_library(fwk_voice_module_lib_vnr_inference_only_for_testing STATIC) -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - target_compile_options(fwk_voice_module_lib_vnr_inference_only_for_testing PRIVATE "-target=XCORE-AI-EXPLORER") -else() - target_compile_options(fwk_voice_module_lib_vnr_inference_only_for_testing PRIVATE "-fPIC") -endif() -set(VNR_MODULE_PATH "${CMAKE_SOURCE_DIR}/modules/lib_vnr") -target_include_directories(fwk_voice_module_lib_vnr_inference_only_for_testing PUBLIC ${VNR_MODULE_PATH}/api/common ${VNR_MODULE_PATH}/api/inference) -target_link_libraries(fwk_voice_module_lib_vnr_inference_only_for_testing PRIVATE fwk_voice::vnr::inference) -target_link_libraries(fwk_voice_module_lib_vnr_inference_only_for_testing PUBLIC core::xs3_math) - -add_library(fwk_voice_calc_vnr_pred_only_for_testing STATIC) -if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-target=XCORE-AI-EXPLORER") -else() - target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-fPIC") -endif() -set(CALC_VNR_PRED_PATH "${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/") -target_include_directories(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC ${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/src) -target_link_libraries(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC fwk_voice::shared::calc_vnr_pred) +#add_library(fwk_voice_calc_vnr_pred_only_for_testing STATIC) +#if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) +# target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-target=XCORE-AI-EXPLORER") +#else() +# target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-fPIC") +#endif() +#set(CALC_VNR_PRED_PATH "${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/") +#target_include_directories(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC ${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/src) +#target_link_libraries(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC fwk_voice::shared::calc_vnr_pred) add_subdirectory(vnr_unit_tests) diff --git a/test/lib_vnr/profile_memory/CMakeLists.txt b/test/lib_vnr/profile_memory/CMakeLists.txt index db18d2941..6b0610070 100644 --- a/test/lib_vnr/profile_memory/CMakeLists.txt +++ b/test/lib_vnr/profile_memory/CMakeLists.txt @@ -8,7 +8,7 @@ set(APP_COMPILER_FLAGS set(APP_NAME fwk_voice_vnr_test_features_memory) add_executable(${APP_NAME}) target_sources(${APP_NAME} PRIVATE src/profile_features.c) -target_link_libraries(${APP_NAME} +target_link_libraries(${APP_NAME} PUBLIC fwk_voice::vnr::features ) @@ -16,7 +16,7 @@ target_compile_options(${APP_NAME} PRIVATE ${APP_COMPILER_FLAGS} "-target=XCORE-AI-EXPLORER") target_link_options(${APP_NAME} PRIVATE - -w + -w "-target=${XCORE_TARGET}" "-report" ) @@ -26,15 +26,15 @@ target_link_options(${APP_NAME} set(APP_NAME fwk_voice_vnr_test_inference_memory) add_executable(${APP_NAME}) target_sources(${APP_NAME} PRIVATE src/profile_inference.c) -target_link_libraries(${APP_NAME} +target_link_libraries(${APP_NAME} PUBLIC - fwk_voice_module_lib_vnr_inference_only_for_testing + fwk_voice::vnr::inference ) target_compile_options(${APP_NAME} PRIVATE ${APP_COMPILER_FLAGS} "-target=XCORE-AI-EXPLORER") target_link_options(${APP_NAME} PRIVATE - -w + -w "-target=${XCORE_TARGET}" "-report" ) @@ -44,16 +44,16 @@ target_link_options(${APP_NAME} set(APP_NAME fwk_voice_vnr_test_full_memory) add_executable(${APP_NAME}) target_sources(${APP_NAME} PRIVATE src/profile_full.c) -target_link_libraries(${APP_NAME} +target_link_libraries(${APP_NAME} PUBLIC fwk_voice::vnr::features - fwk_voice_module_lib_vnr_inference_only_for_testing + fwk_voice::vnr::inference ) target_compile_options(${APP_NAME} PRIVATE ${APP_COMPILER_FLAGS} "-target=XCORE-AI-EXPLORER") target_link_options(${APP_NAME} PRIVATE - -w + -w "-target=${XCORE_TARGET}" "-report" ) diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index 50c8617dc..46d6264c7 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -59,7 +59,7 @@ '../../../../build/test/lib_vnr', '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' ], - libraries=['fwk_voice_module_lib_vnr_inference_only_for_testing', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! + libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/lib_vnr/test_wav_vnr/CMakeLists.txt b/test/lib_vnr/test_wav_vnr/CMakeLists.txt index f65737774..9b2f4a2d1 100644 --- a/test/lib_vnr/test_wav_vnr/CMakeLists.txt +++ b/test/lib_vnr/test_wav_vnr/CMakeLists.txt @@ -10,7 +10,7 @@ target_include_directories(fwk_voice_test_wav_vnr PRIVATE src) target_link_libraries(fwk_voice_test_wav_vnr PUBLIC fwk_voice::vnr::features - fwk_voice_module_lib_vnr_inference_only_for_testing + fwk_voice::vnr::inference fwk_voice::example::fileutils) if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt index 190f59e48..9a118529d 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt @@ -37,7 +37,7 @@ foreach(testfile ${TEST_SOURCES}) if (${testfile} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}/src/test_vnr_extract_features.c ) target_link_libraries(${APP_NAME} PUBLIC - fwk_voice_module_lib_vnr_inference_only_for_testing # test_vnr_extract_features also compares quantised output as an extra step so need to link inference + fwk_voice::vnr::inference # test_vnr_extract_features also compares quantised output as an extra step so need to link inference ) endif() diff --git a/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt index 05d87fe2a..db084bad3 100644 --- a/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt @@ -30,7 +30,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - fwk_voice_module_lib_vnr_inference_only_for_testing + fwk_voice::vnr::inference fwk_voice::vnr::features fwk_voice::example::fileutils) diff --git a/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt index 4e4addc90..5a4877756 100644 --- a/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt @@ -30,7 +30,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - fwk_voice_module_lib_vnr_inference_only_for_testing + fwk_voice::vnr::inference fwk_voice::example::fileutils) if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) From 4856154364a8c249fe1f7e137a13db77b9636f35 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Mon, 5 Sep 2022 17:31:49 +0100 Subject: [PATCH 03/65] moving calc_vnr_pred into IC, appying patch during cmake --- .../pipeline_multi_threaded/CMakeLists.txt | 1 - .../pipeline_multi_threaded/src/pipeline.c | 14 +++-- .../pipeline_single_threaded/CMakeLists.txt | 1 - .../pipeline_single_threaded/src/pipeline.c | 12 ++--- .../src/pipeline_state.h | 3 +- examples/bare-metal/shared_src/CMakeLists.txt | 1 - .../shared_src/calc_vnr_pred/CMakeLists.txt | 19 ------- .../calc_vnr_pred/src/calc_vnr_pred.c | 35 ------------ .../calc_vnr_pred/src/calc_vnr_pred.h | 23 -------- .../shared_src/external_deps/fetch_deps.cmake | 1 + .../external_deps/inference/CMakeLists.txt | 6 ++- modules/lib_ic/CMakeLists.txt | 2 + modules/lib_ic/api/ic_api.h | 4 ++ modules/lib_ic/api/ic_defines.h | 12 +++++ modules/lib_ic/src/ic.c | 35 +++++++++++- modules/lib_ic/src/ic_low_level.h | 53 +++++++++++-------- .../py_c_frame_compare/build_ic_frame_proc.py | 11 +++- .../py_c_frame_compare/extract_state.py | 5 +- test/lib_ic/test_calc_vnr_pred/CMakeLists.txt | 1 - .../src/test_calc_vnr_pred.c | 8 +-- test/lib_vnr/CMakeLists.txt | 14 ----- test/stage_b/build_c_code.py | 5 +- test/stage_b/ic_vnr_test.c | 8 ++- 23 files changed, 121 insertions(+), 153 deletions(-) delete mode 100644 examples/bare-metal/shared_src/calc_vnr_pred/CMakeLists.txt delete mode 100644 examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.c delete mode 100644 examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.h diff --git a/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt b/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt index c08dc3b84..2d13dc311 100644 --- a/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt +++ b/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt @@ -22,7 +22,6 @@ target_link_libraries(fwk_voice_example_pipeline_multi_thread_interface fwk_voice::example::delay_buffer fwk_voice::example::stage_1 fwk_voice::example::fileutils - fwk_voice::shared::calc_vnr_pred core::xs3_math ) diff --git a/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c b/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c index c7bced7b7..ab83fa6cc 100644 --- a/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c +++ b/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c @@ -16,7 +16,6 @@ #include "ic_api.h" #include "ns_api.h" #include "agc_api.h" -#include "calc_vnr_pred.h" #define VNR_AGC_THRESHOLD (0.5) #define PRINT_VNR_PREDICTION (0) @@ -104,10 +103,9 @@ void pipeline_stage_2(chanend_t c_frame_in, chanend_t c_frame_out) { pipeline_metadata_t md; // Initialise IC and VNR ic_state_t DWORD_ALIGNED ic_state; - vnr_pred_state_t DWORD_ALIGNED vnr_pred_state; + float_s32_t input_vnr_pred, output_vnr_pred; float_s32_t agc_vnr_threshold = float_to_float_s32(VNR_AGC_THRESHOLD); ic_init(&ic_state); - init_vnr_pred_state(&vnr_pred_state); int32_t DWORD_ALIGNED frame[AP_MAX_Y_CHANNELS][AP_FRAME_ADVANCE]; while(1) { @@ -133,18 +131,18 @@ void pipeline_stage_2(chanend_t c_frame_in, chanend_t c_frame_out) { // Calculating the ASR channel ic_filter(&ic_state, frame[0], frame[1], frame[0]); // VNR - calc_vnr_pred(&vnr_pred_state, &ic_state.Y_bfp[0], &ic_state.Error_bfp[0]); + ic_calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); #if PRINT_VNR_PREDICTION - printf("VNR OUTPUT PRED: %ld %d\n", vnr_pred_state.output_vnr_pred.mant, vnr_pred_state.output_vnr_pred.exp); - printf("VNR INPUT PRED: %ld %d\n", vnr_pred_state.input_vnr_pred.mant, vnr_pred_state.input_vnr_pred.exp); + printf("VNR OUTPUT PRED: %ld %d\n", output_vnr_pred.mant, output_vnr_pred.exp); + printf("VNR INPUT PRED: %ld %d\n", input_vnr_pred.mant, input_vnr_pred.exp); #endif - md.vnr_pred_flag = float_s32_gt(vnr_pred_state.output_vnr_pred, agc_vnr_threshold); + md.vnr_pred_flag = float_s32_gt(output_vnr_pred, agc_vnr_threshold); // Transferring metadata chan_out_buf_byte(c_frame_out, (uint8_t*)&md, sizeof(pipeline_metadata_t)); // Adapting the IC - ic_adapt(&ic_state, vnr_pred_state.input_vnr_pred); + ic_adapt(&ic_state, input_vnr_pred); // Copy IC output to the other channel for(int v = 0; v < AP_FRAME_ADVANCE; v++){ diff --git a/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt b/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt index 085be4a08..f0c24320e 100644 --- a/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt +++ b/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt @@ -22,7 +22,6 @@ target_link_libraries(fwk_voice_example_pipeline_single_thread_interface fwk_voice::example::delay_buffer fwk_voice::example::stage_1 fwk_voice::example::fileutils - fwk_voice::shared::calc_vnr_pred core::xs3_math ) diff --git a/examples/bare-metal/pipeline_single_threaded/src/pipeline.c b/examples/bare-metal/pipeline_single_threaded/src/pipeline.c index af5ee60ea..d4aa8d59a 100644 --- a/examples/bare-metal/pipeline_single_threaded/src/pipeline.c +++ b/examples/bare-metal/pipeline_single_threaded/src/pipeline.c @@ -9,7 +9,6 @@ #include "pipeline_config.h" #include "pipeline_state.h" #include "stage_1.h" -#include "calc_vnr_pred.h" #define VNR_AGC_THRESHOLD (0.5) #define PRINT_VNR_PREDICTION (0) @@ -60,7 +59,6 @@ void pipeline_tile1_init(pipeline_state_tile1_t *state) { // Initialise IC, VNR ic_init(&state->ic_state); - init_vnr_pred_state(&state->vnr_pred_state); // Initialise NS for(int ch = 0; ch < AP_MAX_Y_CHANNELS; ch++){ @@ -130,15 +128,15 @@ void pipeline_process_frame_tile1(pipeline_state_tile1_t *state, pipeline_metada ic_filter(&state->ic_state, input_data[0], input_data[1], ic_output[0]); // VNR - calc_vnr_pred(&state->vnr_pred_state, &state->ic_state.Y_bfp[0], &state->ic_state.Error_bfp[0]); + ic_calc_vnr_pred(&state->ic_state, &state->input_vnr_pred, &state->output_vnr_pred); #if PRINT_VNR_PREDICTION - printf("VNR OUTPUT PRED: %ld %d\n", state->vnr_pred_state.output_vnr_pred.mant, state->vnr_pred_state.output_vnr_pred.exp); - printf("VNR INPUT PRED: %ld %d\n", state->vnr_pred_state.input_vnr_pred.mant, state->vnr_pred_state.input_vnr_pred.exp); + printf("VNR OUTPUT PRED: %ld %d\n", state->output_vnr_pred.mant, state->output_vnr_pred.exp); + printf("VNR INPUT PRED: %ld %d\n", state->input_vnr_pred.mant, state->input_vnr_pred.exp); #endif float_s32_t agc_vnr_threshold = float_to_float_s32(VNR_AGC_THRESHOLD); - md.vnr_pred_flag = float_s32_gt(state->vnr_pred_state.output_vnr_pred, agc_vnr_threshold); + md.vnr_pred_flag = float_s32_gt(state->output_vnr_pred, agc_vnr_threshold); - ic_adapt(&state->ic_state, state->vnr_pred_state.input_vnr_pred); + ic_adapt(&state->ic_state, state->input_vnr_pred); // Copy IC output to the other channel for(int v = 0; v < AP_FRAME_ADVANCE; v++){ diff --git a/examples/bare-metal/pipeline_single_threaded/src/pipeline_state.h b/examples/bare-metal/pipeline_single_threaded/src/pipeline_state.h index f1641dfcc..cb612c570 100644 --- a/examples/bare-metal/pipeline_single_threaded/src/pipeline_state.h +++ b/examples/bare-metal/pipeline_single_threaded/src/pipeline_state.h @@ -6,7 +6,6 @@ #include "ic_state.h" #include "ns_state.h" #include "agc_api.h" -#include "calc_vnr_pred.h" typedef struct { float_s32_t max_ref_energy; @@ -23,7 +22,7 @@ typedef struct { typedef struct { // IC, VNR ic_state_t DWORD_ALIGNED ic_state; - vnr_pred_state_t DWORD_ALIGNED vnr_pred_state; + float_s32_t input_vnr_pred, output_vnr_pred; // NS ns_state_t DWORD_ALIGNED ns_state[AP_MAX_Y_CHANNELS]; // AGC diff --git a/examples/bare-metal/shared_src/CMakeLists.txt b/examples/bare-metal/shared_src/CMakeLists.txt index c60a12b1d..0097431fd 100644 --- a/examples/bare-metal/shared_src/CMakeLists.txt +++ b/examples/bare-metal/shared_src/CMakeLists.txt @@ -1,6 +1,5 @@ add_subdirectory(external_deps) -add_subdirectory(calc_vnr_pred) ###### add_library(fwk_voice_example_shared_src_aec_1_thread INTERFACE) diff --git a/examples/bare-metal/shared_src/calc_vnr_pred/CMakeLists.txt b/examples/bare-metal/shared_src/calc_vnr_pred/CMakeLists.txt deleted file mode 100644 index 138848e19..000000000 --- a/examples/bare-metal/shared_src/calc_vnr_pred/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ - -set(APP_NAME fwk_voice_shared_src_calc_vnr_pred) - -add_library(${APP_NAME} INTERFACE) -target_sources(${APP_NAME} - INTERFACE - src/calc_vnr_pred.c -) -target_include_directories(${APP_NAME} - INTERFACE - src -) -target_link_libraries(${APP_NAME} - INTERFACE - fwk_voice::vnr::features - fwk_voice::vnr::inference -) - -add_library(fwk_voice::shared::calc_vnr_pred ALIAS ${APP_NAME}) diff --git a/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.c b/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.c deleted file mode 100644 index 49ac5b5a6..000000000 --- a/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.c +++ /dev/null @@ -1,35 +0,0 @@ - -#include "calc_vnr_pred.h" -#include "q_format.h" - -void init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state) -{ - // Initialise vnr_pred_state - vnr_feature_state_init(&vnr_pred_state->feature_state[0]); - vnr_feature_state_init(&vnr_pred_state->feature_state[1]); - - vnr_inference_init(); - vnr_pred_state->pred_alpha_q30 = Q30(0.97); - vnr_pred_state->input_vnr_pred = float_to_float_s32(0.5); - vnr_pred_state->output_vnr_pred = float_to_float_s32(0.5); -} - -void calc_vnr_pred( - vnr_pred_state_t *vnr_state, - const bfp_complex_s32_t *Y, - const bfp_complex_s32_t *Error - ) -{ - bfp_s32_t feature_patch; - int32_t feature_patch_data[VNR_PATCH_WIDTH * VNR_MEL_FILTERS]; - vnr_extract_features(&vnr_state->feature_state[0], &feature_patch, feature_patch_data, Y); - float_s32_t ie_output; - vnr_inference(&ie_output, &feature_patch); - vnr_state->input_vnr_pred = float_s32_ema(vnr_state->input_vnr_pred, ie_output, vnr_state->pred_alpha_q30); - - vnr_extract_features(&vnr_state->feature_state[1], &feature_patch, feature_patch_data, Error); - vnr_inference(&ie_output, &feature_patch); - vnr_state->output_vnr_pred = float_s32_ema(vnr_state->output_vnr_pred, ie_output, vnr_state->pred_alpha_q30); -} - - diff --git a/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.h b/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.h deleted file mode 100644 index 3fb521ebb..000000000 --- a/examples/bare-metal/shared_src/calc_vnr_pred/src/calc_vnr_pred.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef _CALC_VNR_PRED_H_ -#define _CALC_VNR_PRED_H_ - -#include "vnr_features_api.h" -#include "vnr_inference_api.h" -#include "bfp_math.h" - -typedef struct { - vnr_feature_state_t feature_state[2]; - float_s32_t input_vnr_pred; - float_s32_t output_vnr_pred; - fixed_s32_t pred_alpha_q30; -}vnr_pred_state_t; - -void calc_vnr_pred( - vnr_pred_state_t *vnr_state, - const bfp_complex_s32_t *Y, - const bfp_complex_s32_t *Error - ); - -void init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state); -#endif - diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index 6f018b3c7..bb062f18b 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -34,5 +34,6 @@ FetchContent_Declare( GIT_TAG a2dccc68bdef57a3b0ed326ea4d815a475feb39e GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro + PATCH_COMMAND patch -d lib_tflite_micro/submodules/tflite-micro/ -p0 -i ../../../patches/tflite-micro.patch ) FetchContent_Populate(tflite_micro) diff --git a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt index b9116b489..eab6ab65a 100644 --- a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt @@ -4,7 +4,6 @@ include(${TOP_DIR}/cmakefiles/xtflm.cmake) target_sources(xcore_sdk_inferencing_lib_tflite_micro INTERFACE - ${TOP_DIR}/lib_tflite_micro/submodules/flatbuffers/src/util.cpp #link error on x86 ${TFLM_KERNEL_SOURCES} ${TFLITE_SOURCES} ${NN_SOURCES} @@ -21,6 +20,11 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) ${LIB_NN_SOURCES_XCORE_XS3A} ${TFLIB_SOURCES_ASM} ) +else() + target_sources(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + ${TOP_DIR}/lib_tflite_micro/submodules/flatbuffers/src/util.cpp #link error on x86 + ) endif() target_include_directories(xcore_sdk_inferencing_lib_tflite_micro diff --git a/modules/lib_ic/CMakeLists.txt b/modules/lib_ic/CMakeLists.txt index ed19de13d..d0f35cb2b 100644 --- a/modules/lib_ic/CMakeLists.txt +++ b/modules/lib_ic/CMakeLists.txt @@ -23,6 +23,8 @@ target_link_libraries(fwk_voice_module_lib_ic PUBLIC core::xs3_math fwk_voice::aec + fwk_voice::vnr::features + fwk_voice::vnr::inference ) ## Create an alias diff --git a/modules/lib_ic/api/ic_api.h b/modules/lib_ic/api/ic_api.h index 3f3c33a4e..c626577f8 100644 --- a/modules/lib_ic/api/ic_api.h +++ b/modules/lib_ic/api/ic_api.h @@ -54,6 +54,10 @@ void ic_filter(ic_state_t *state, int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); +void ic_calc_vnr_pred(ic_state_t *state, + float_s32_t * input_vnr_pred, + float_s32_t * output_vnr_pred); + /** * @brief Adapts the IC filter according to previous frame's statistics and VNR input * diff --git a/modules/lib_ic/api/ic_defines.h b/modules/lib_ic/api/ic_defines.h index e64047694..f0264b33e 100644 --- a/modules/lib_ic/api/ic_defines.h +++ b/modules/lib_ic/api/ic_defines.h @@ -7,6 +7,8 @@ #include #include #include "bfp_math.h" +#include "vnr_features_api.h" +#include "vnr_inference_api.h" /** * @page page_ic_defines_h ic_defines.h @@ -85,6 +87,16 @@ * @ingroup ic_defines*/ #define IC_INIT_INPUT_VNR_THRESHOLD_LOW 0 // From python model +/** Alpha for EMA VNR prediction calculation. + * @ingroup ic_defines */ +#define IC_INIT_VNR_PRED_ALPHA 0.97 // From python model +/** Initial vaue for the input VNR prediction. + * @ingroup ic_defines */ +#define IC_INIT_INPUT_VNR_PRED 0.5 // From python model +/** Initial vaue for the output VNR prediction. + * @ingroup ic_defines */ +#define IC_INIT_OUTPUT_VNR_PRED 0.5 // From python model + ////////////////////////////////////////////////////////////////////////////////////////////// ///////Parameters below are fixed and are not designed to be configurable - DO NOT EDIT/////// ////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/modules/lib_ic/src/ic.c b/modules/lib_ic/src/ic.c index 044a1a01d..f60c565b4 100644 --- a/modules/lib_ic/src/ic.c +++ b/modules/lib_ic/src/ic.c @@ -8,6 +8,18 @@ void ic_dump_var_2d(ic_state_t *state); void ic_dump_var_3d(ic_state_t *state); +vnr_pred_state_t vnr_pred_state; + +static void ic_init_vnr_pred_state(){ + vnr_feature_state_init(&vnr_pred_state.feature_state[0]); + vnr_feature_state_init(&vnr_pred_state.feature_state[1]); + + vnr_inference_init(); + vnr_pred_state.pred_alpha_q30 = Q30(IC_INIT_VNR_PRED_ALPHA); + vnr_pred_state.input_vnr_pred = float_to_float_s32(IC_INIT_INPUT_VNR_PRED); + vnr_pred_state.output_vnr_pred = float_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); +} + static void ic_init_config(ic_config_params_t *config){ config->sigma_xx_shift = IC_INIT_SIGMA_XX_SHIFT; config->gamma_log2 = IC_INIT_GAMMA_LOG2; @@ -133,7 +145,8 @@ void ic_init(ic_state_t *state){ // Initialise ic core config params and adaption controller ic_init_config(&state->config_params); - ic_init_adaption_controller(&state->ic_adaption_controller_state); + ic_init_adaption_controller(&state->ic_adaption_controller_state); + ic_init_vnr_pred_state(); } void ic_filter( @@ -226,6 +239,26 @@ void ic_filter( } } + +void ic_calc_vnr_pred( + ic_state_t * ic_state, + float_s32_t * input_vnr_pred, + float_s32_t * output_vnr_pred){ + + bfp_s32_t feature_patch; + int32_t feature_patch_data[VNR_PATCH_WIDTH * VNR_MEL_FILTERS]; + vnr_extract_features(&vnr_pred_state.feature_state[0], &feature_patch, feature_patch_data, &ic_state->Y_bfp[0]); + float_s32_t ie_output; + vnr_inference(&ie_output, &feature_patch); + vnr_pred_state.input_vnr_pred = float_s32_ema(vnr_pred_state.input_vnr_pred, ie_output, vnr_pred_state.pred_alpha_q30); + *input_vnr_pred = vnr_pred_state.input_vnr_pred; + + vnr_extract_features(&vnr_pred_state.feature_state[1], &feature_patch, feature_patch_data, &ic_state->Error_bfp[0]); + vnr_inference(&ie_output, &feature_patch); + vnr_pred_state.output_vnr_pred = float_s32_ema(vnr_pred_state.output_vnr_pred, ie_output, vnr_pred_state.pred_alpha_q30); + *output_vnr_pred = vnr_pred_state.output_vnr_pred; +} + void ic_adapt( ic_state_t *state, float_s32_t vnr){ diff --git a/modules/lib_ic/src/ic_low_level.h b/modules/lib_ic/src/ic_low_level.h index 3ab9da4b7..9ac970491 100644 --- a/modules/lib_ic/src/ic_low_level.h +++ b/modules/lib_ic/src/ic_low_level.h @@ -6,37 +6,46 @@ #include "ic_state.h" -///IC Private API -//setup core configuration parameters of the IC +// IC Private API + +// Struct to keep VNR predictions and the EMA alpha +typedef struct { + vnr_feature_state_t feature_state[2]; + float_s32_t input_vnr_pred; + float_s32_t output_vnr_pred; + fixed_s32_t pred_alpha_q30; +}vnr_pred_state_t; + +// Setup core configuration parameters of the IC void ic_priv_init_config_params(ic_config_params_t *config_params); void ic_adaption_controller_init(ic_adaption_controller_state_t *state); -//Sets IC mu and leakage depending on VNR probability +// Sets IC mu and leakage depending on VNR probability void ic_mu_control_system( ic_state_t *state, float_s32_t vnr); -// calculates fast energy +// Calculates fast energy void ic_calc_fast_ratio(ic_adaption_controller_state_t * ad_state); -/// Adapt H_hat +// Adapt H_hat void ic_filter_adapt(ic_state_t *state); -//Some nice doxygen comments +// Some nice doxygen comments void ic_init(ic_state_t *state); -/// Delays y_channel w.r.t. x_channel +// Delays y_channel w.r.t. x_channel void ic_delay_y_input(ic_state_t *state, int32_t y_data[IC_FRAME_ADVANCE]); -/// Sets up IC for processing a new frame +// Sets up IC for processing a new frame void ic_frame_init( ic_state_t *state, int32_t y_data[IC_FRAME_LENGTH+2], int32_t x_data[IC_FRAME_LENGTH+2]); -/// Calculate average energy in time domain +// Calculate average energy in time domain void ic_update_td_ema_energy( float_s32_t *ema_energy, const bfp_s32_t *input, @@ -44,56 +53,56 @@ void ic_update_td_ema_energy( unsigned length, const fixed_s32_t alpha); -/// FFT single channel real input +// FFT single channel real input void ic_fft( bfp_complex_s32_t *output, bfp_s32_t *input); -/// Calculate X energy +// Calculate X energy void ic_update_X_energy( ic_state_t *state, unsigned ch, unsigned recalc_bin); -/// Update X-fifo with the newest X data. Calculate sigmaXX +// Update X-fifo with the newest X data. Calculate sigmaXX void ic_update_X_fifo_and_calc_sigmaXX( ic_state_t *state, unsigned ch); -/// Update the 1d form of X-fifo pointers +// Update the 1d form of X-fifo pointers void ic_update_X_fifo_1d( ic_state_t *state); -/// Calculate filter Error and Y_hat +// Calculate filter Error and Y_hat void ic_calc_Error_and_Y_hat( ic_state_t *state, unsigned ch); -/// Real IFFT to single channel input data +// Real IFFT to single channel input data void ic_ifft( bfp_s32_t *output, bfp_complex_s32_t *input ); -/// Window error. Overlap add to create IC output +// Window error. Overlap add to create IC output void ic_create_output( ic_state_t *state, int32_t output[IC_FRAME_ADVANCE], unsigned ch); -/// Calculate inverse X-energy +// Calculate inverse X-energy void ic_calc_inv_X_energy( ic_state_t *state, unsigned ch); -/// Calculate T (mu * inv_X_energy * Error) +// Calculate T (mu * inv_X_energy * Error) void ic_compute_T( ic_state_t *state, unsigned y_ch, unsigned x_ch); -/// Calculate Error and Y_hat for a channel over a range of bins +// Calculate Error and Y_hat for a channel over a range of bins void ic_l2_calc_Error_and_Y_hat( bfp_complex_s32_t *Error, bfp_complex_s32_t *Y_hat, @@ -104,14 +113,14 @@ void ic_l2_calc_Error_and_Y_hat( unsigned length, int32_t bypass_enabled); -/// Adapt one phase or 2 consecutive phases of H_hat filter +// Adapt one phase or 2 consecutive phases of H_hat filter void ic_l2_adapt_plus_fft_gc( bfp_complex_s32_t *H_hat_ph, const bfp_complex_s32_t *X_fifo_ph, const bfp_complex_s32_t *T_ph ); -/// Unify bfp_complex_s32_t chunks into a single exponent and headroom +// Unify bfp_complex_s32_t chunks into a single exponent and headroom void ic_l2_bfp_complex_s32_unify_exponent( bfp_complex_s32_t *chunks, int *final_exp, @@ -121,7 +130,7 @@ void ic_l2_bfp_complex_s32_unify_exponent( int desired_index, int min_headroom); -/// Unify bfp_s32_t chunks into a single exponent and headroom +// Unify bfp_s32_t chunks into a single exponent and headroom void ic_l2_bfp_s32_unify_exponent( bfp_s32_t *chunks, int *final_exp, diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index aa4de101f..7b7d89dbd 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -19,7 +19,13 @@ INCLUDE_DIRS=[ f"{MODULE_ROOT}/lib_ic/api/", f"{MODULE_ROOT}/lib_ic/src/", - f"{XS3_MATH}/lib_xs3_math/api/", + f"{MODULE_ROOT}/lib_vnr/api/common", + f"{MODULE_ROOT}/lib_vnr/api/features", + f"{MODULE_ROOT}/lib_vnr/src/features", + f"{MODULE_ROOT}/lib_vnr/api/inference", + f"{MODULE_ROOT}/lib_vnr/src/inference/model", + f"{MODULE_ROOT}/lib_vnr/src/inference", + f"{XS3_MATH}/lib_xs3_math/api/", ] SRCS = f"../ic_test.c".split() ffibuilder = FFI() @@ -52,9 +58,10 @@ library_dirs=[ '../../../../build/modules/lib_ic', '../../../../build/modules/lib_aec', + '../../../../build/modules/lib_vnr', '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/lib_ic/py_c_frame_compare/extract_state.py b/test/lib_ic/py_c_frame_compare/extract_state.py index d0b794583..6f2017b43 100644 --- a/test/lib_ic/py_c_frame_compare/extract_state.py +++ b/test/lib_ic/py_c_frame_compare/extract_state.py @@ -9,7 +9,8 @@ xs3_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xs3_math/lib_xs3_math/api" lib_ic_api_dir = "../../../modules/lib_ic/api/" -lib_vnr_api_dir = "../../../modules/lib_vnr/api/features/" +lib_vnr_common_api_dir = "../../../modules/lib_vnr/api/common" +lib_vnr_features_api_dir = "../../../modules/lib_vnr/api/features/" lib_vnr_inference_api_dir = "../../../modules/lib_vnr/api/inference/" lib_vnr_inference_model_dir = "../../../modules/lib_vnr/src/inference/model" lib_vnr_inference_src_dir = "../../../modules/lib_vnr/src/inference/" @@ -48,7 +49,7 @@ def extract_pre_defs(): extract_xs3_math() #Grab just ic_state related lines from the C pre-processed - subprocess.call(f"gcc -E ic_test.c -o ic_test.i -I {lib_ic_api_dir} -I {xs3_math_types_api_dir} -I {lib_vnr_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir}".split()) + subprocess.call(f"gcc -E ic_test.c -o ic_test.i -I {lib_ic_api_dir} -I {xs3_math_types_api_dir} -I {lib_vnr_common_api_dir} -I {lib_vnr_features_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir}".split()) with open("ic_test.i") as pp: end_of_file = False diff --git a/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt b/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt index a240d7f47..9e0ef2243 100644 --- a/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt +++ b/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt @@ -19,7 +19,6 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC fwk_voice::ic - fwk_voice_calc_vnr_pred_only_for_testing fwk_voice::example::fileutils) if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) diff --git a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c index 9f3b7c852..34b07d266 100644 --- a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c +++ b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c @@ -5,7 +5,6 @@ #include #include #include -#include "calc_vnr_pred.h" #include "ic_api.h" static vnr_pred_state_t DWORD_ALIGNED vnr_pred_state; @@ -31,9 +30,10 @@ void test(int32_t *output, int32_t *input) memcpy(ic_state.Error_bfp[0].data, &input[1 + (1 + 2*ic_state.Y_bfp[0].length)], ic_state.Error_bfp[0].length*sizeof(complex_s32_t)); ic_state.Error_bfp[0].hr = bfp_complex_s32_headroom(&ic_state.Error_bfp[0]); - calc_vnr_pred(&vnr_pred_state, &ic_state.Y_bfp[0], &ic_state.Error_bfp[0]); + float_s32_t input_vnr_pred, output_vnr_pred; + calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); // Write to output buffer - memcpy(&output[0], &vnr_pred_state.input_vnr_pred, sizeof(float_s32_t)); - memcpy(&output[2], &vnr_pred_state.output_vnr_pred, sizeof(float_s32_t)); + memcpy(&output[0], &input_vnr_pred, sizeof(float_s32_t)); + memcpy(&output[2], &output_vnr_pred, sizeof(float_s32_t)); } diff --git a/test/lib_vnr/CMakeLists.txt b/test/lib_vnr/CMakeLists.txt index 33f9d0cd9..7f43f3490 100644 --- a/test/lib_vnr/CMakeLists.txt +++ b/test/lib_vnr/CMakeLists.txt @@ -1,18 +1,4 @@ -# Compile VNR inference as a static library only for speeding up tests compilation. Note that it's compiled with target=XCORE-AI-EXPLORER, so will -# only link against applications targeting XCORE-AI-EXPLORER which is fine for testing. lib_tflite_micro compilation is dependant on the HW -# target which is why we don't build fwk_voice::vnr::inference as a static library in the modules/lib_vnr CMake file. - -#add_library(fwk_voice_calc_vnr_pred_only_for_testing STATIC) -#if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) -# target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-target=XCORE-AI-EXPLORER") -#else() -# target_compile_options(fwk_voice_calc_vnr_pred_only_for_testing PRIVATE "-fPIC") -#endif() -#set(CALC_VNR_PRED_PATH "${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/") -#target_include_directories(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC ${CMAKE_SOURCE_DIR}/examples/bare-metal/shared_src/calc_vnr_pred/src) -#target_link_libraries(fwk_voice_calc_vnr_pred_only_for_testing PUBLIC fwk_voice::shared::calc_vnr_pred) - add_subdirectory(vnr_unit_tests) add_subdirectory(test_wav_vnr) diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 990c6508f..a1c6c395c 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -25,7 +25,6 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{MODULE_ROOT}/../examples/bare-metal/shared_src/calc_vnr_pred/src", f"{XS3_MATH}/lib_xs3_math/api/", ] SRCS = f"../ic_vnr_test.c".split() @@ -64,7 +63,6 @@ """ #include "ic_api.h" #include "ic_low_level.h" - #include "calc_vnr_pred.h" void test_init(void); ic_state_t test_get_ic_state(void); void test_filter(int32_t y_data[IC_FRAME_ADVANCE], int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); @@ -77,10 +75,9 @@ '../../../build/modules/lib_ic', '../../../build/modules/lib_aec', '../../../build/modules/lib_vnr', - '../../../build/test/lib_vnr', '../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_calc_vnr_pred_only_for_testing', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/stage_b/ic_vnr_test.c b/test/stage_b/ic_vnr_test.c index 395109466..05f1aa21e 100644 --- a/test/stage_b/ic_vnr_test.c +++ b/test/stage_b/ic_vnr_test.c @@ -1,14 +1,11 @@ #include #include "ic_api.h" #include "ic_low_level.h" -#include "calc_vnr_pred.h" ic_state_t ic_state; -vnr_pred_state_t vnr_pred_state; void test_init(void){ ic_init(&ic_state); - init_vnr_pred_state(&vnr_pred_state); } ic_state_t test_get_ic_state(void){ @@ -28,9 +25,10 @@ void test_adapt(float_s32_t vnr){ float_s32_t test_vnr(){ - calc_vnr_pred(&vnr_pred_state, &ic_state.Y_bfp[0], &ic_state.Error_bfp[0]); + float_s32_t input_vnr_pred, output_vnr_pred; + ic_calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); - return vnr_pred_state.input_vnr_pred; + return input_vnr_pred; } void test_control_system(double vnr_fl, int32_t ad_config, double fast_ratio){ From 09ee99048e0c34741561c7bdfc71188fb93a6151 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Mon, 5 Sep 2022 17:34:08 +0100 Subject: [PATCH 04/65] updating toolchain --- xmos_cmake_toolchain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmos_cmake_toolchain b/xmos_cmake_toolchain index fa4766744..3a19f0284 160000 --- a/xmos_cmake_toolchain +++ b/xmos_cmake_toolchain @@ -1 +1 @@ -Subproject commit fa476674462ecd5e365e2025d3bc0aa43352805e +Subproject commit 3a19f0284c66a92dbb9d5adc9d3d5016aac22646 From 4361a7421d8768c0ec018e7e129dca4f4c4126f1 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Mon, 5 Sep 2022 17:56:31 +0100 Subject: [PATCH 05/65] fixing ic cal_vnr_pred test --- test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c | 1 - 1 file changed, 1 deletion(-) diff --git a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c index 34b07d266..592920423 100644 --- a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c +++ b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c @@ -7,7 +7,6 @@ #include #include "ic_api.h" -static vnr_pred_state_t DWORD_ALIGNED vnr_pred_state; static ic_state_t DWORD_ALIGNED ic_state; void test_init() { From cff43357bbba1b10ebcb821574ecc15c64839765 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Tue, 6 Sep 2022 17:23:01 +0100 Subject: [PATCH 06/65] lib_tflite_micro linked privately, full xcore build works, updated jenkins shared lib --- Jenkinsfile | 2 +- modules/lib_vnr/CMakeLists.txt | 8 ++++++-- test/lib_ic/test_bad_state/CMakeLists.txt | 5 ++--- test/lib_ic/test_bad_state/src/test_bad_state.c | 9 ++++----- test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c | 4 +--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e081fa4a9..33e5bdf73 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,4 +1,4 @@ -@Library('xmos_jenkins_shared_library@v0.19.0') _ +@Library('xmos_jenkins_shared_library@v0.20.0') _ getApproval() pipeline { diff --git a/modules/lib_vnr/CMakeLists.txt b/modules/lib_vnr/CMakeLists.txt index df94d8a0f..de8896788 100644 --- a/modules/lib_vnr/CMakeLists.txt +++ b/modules/lib_vnr/CMakeLists.txt @@ -10,10 +10,14 @@ target_include_directories(fwk_voice_module_lib_vnr_inference PUBLIC api/common target_link_libraries(fwk_voice_module_lib_vnr_inference PUBLIC - sdk::inferencing::lib_tflite_micro core::xs3_math ) +target_link_libraries(fwk_voice_module_lib_vnr_inference + PRIVATE + sdk::inferencing::lib_tflite_micro + ) + add_library(fwk_voice::vnr::inference ALIAS fwk_voice_module_lib_vnr_inference) ## VNR Feature extraction @@ -30,7 +34,7 @@ target_compile_definitions(fwk_voice_module_lib_vnr_features PRIVATE HEADROOM_CH target_compile_options(fwk_voice_module_lib_vnr_features PRIVATE -Os - -g + -g ) target_link_libraries(fwk_voice_module_lib_vnr_features diff --git a/test/lib_ic/test_bad_state/CMakeLists.txt b/test/lib_ic/test_bad_state/CMakeLists.txt index 53f2be96f..15c1821ef 100644 --- a/test/lib_ic/test_bad_state/CMakeLists.txt +++ b/test/lib_ic/test_bad_state/CMakeLists.txt @@ -27,11 +27,10 @@ foreach(testfile ${TEST_SOURCES}) add_executable(${APP_NAME}) target_sources(${APP_NAME} PRIVATE ${COMMON_SOURCES_C} ${testfile}) - + target_link_libraries(${APP_NAME} PUBLIC fwk_voice::ic - fwk_voice_calc_vnr_pred_only_for_testing fwk_voice::example::fileutils) @@ -44,7 +43,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_options(${APP_NAME} PRIVATE -lquadspi - -w + -w "-target=${XCORE_TARGET}" "-report" "${CONFIG_XSCOPE_PATH}/config.xscope") diff --git a/test/lib_ic/test_bad_state/src/test_bad_state.c b/test/lib_ic/test_bad_state/src/test_bad_state.c index ad1e8a2b7..9649175ea 100644 --- a/test/lib_ic/test_bad_state/src/test_bad_state.c +++ b/test/lib_ic/test_bad_state/src/test_bad_state.c @@ -5,14 +5,12 @@ #include #include #include -#include "calc_vnr_pred.h" #include "ic_api.h" -static vnr_pred_state_t DWORD_ALIGNED vnr_pred_state; static ic_state_t DWORD_ALIGNED ic_state; + void test_init(int32_t conf, int32_t * H_data) { - init_vnr_pred_state(&vnr_pred_state); ic_init(&ic_state); ic_state.ic_adaption_controller_state.adaption_controller_config.adaption_config = conf; int indx = 0; @@ -27,7 +25,8 @@ void test_init(int32_t conf, int32_t * H_data) void test(int32_t * output, int32_t * y_frame, int32_t * x_frame) { + float_s32_t input_vnr_pred, output_vnr_pred; ic_filter(&ic_state, y_frame, x_frame, output); - calc_vnr_pred(&vnr_pred_state, &ic_state.Y_bfp[0], &ic_state.Error_bfp[0]); - ic_adapt(&ic_state, vnr_pred_state.input_vnr_pred); + ic_calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); + ic_adapt(&ic_state, input_vnr_pred); } diff --git a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c index 592920423..91402cc28 100644 --- a/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c +++ b/test/lib_ic/test_calc_vnr_pred/src/test_calc_vnr_pred.c @@ -10,9 +10,7 @@ static ic_state_t DWORD_ALIGNED ic_state; void test_init() { - init_vnr_pred_state(&vnr_pred_state); ic_init(&ic_state); - } void test(int32_t *output, int32_t *input) @@ -30,7 +28,7 @@ void test(int32_t *output, int32_t *input) ic_state.Error_bfp[0].hr = bfp_complex_s32_headroom(&ic_state.Error_bfp[0]); float_s32_t input_vnr_pred, output_vnr_pred; - calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); + ic_calc_vnr_pred(&ic_state, &input_vnr_pred, &output_vnr_pred); // Write to output buffer memcpy(&output[0], &input_vnr_pred, sizeof(float_s32_t)); memcpy(&output[2], &output_vnr_pred, sizeof(float_s32_t)); From d32e7f62674f4f5a1ed69a8297543745bf7cac44 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Wed, 7 Sep 2022 15:30:23 +0100 Subject: [PATCH 07/65] full x86 buld works --- .../external_deps/inference/CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt index eab6ab65a..d20566e32 100644 --- a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt @@ -20,11 +20,21 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) ${LIB_NN_SOURCES_XCORE_XS3A} ${TFLIB_SOURCES_ASM} ) + target_compile_options(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + -Wno-xcore-fptrgroup + -mcmodel=large + ) else() target_sources(xcore_sdk_inferencing_lib_tflite_micro INTERFACE ${TOP_DIR}/lib_tflite_micro/submodules/flatbuffers/src/util.cpp #link error on x86 ) + set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) + target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro + INTERFACE + NN_USE_REF + ) endif() target_include_directories(xcore_sdk_inferencing_lib_tflite_micro @@ -36,8 +46,6 @@ target_compile_options(xcore_sdk_inferencing_lib_tflite_micro INTERFACE -Os -g - -mcmodel=large - -Wno-xcore-fptrgroup ) target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro @@ -47,11 +55,4 @@ target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro TF_LITE_STRIP_ERROR_STRINGS __xtflm_conf_h_exists__=1) -if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) - set(CMAKE_CXX_FLAGS "-std=c++11" CACHE STRING "C++ Compiler Base Flags" FORCE) - target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro - INTERFACE - NN_USE_REF) -endif() - add_library(sdk::inferencing::lib_tflite_micro ALIAS xcore_sdk_inferencing_lib_tflite_micro) From ae2a8f0b9cf5ccc98028ab692bf775fb817a25c7 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Wed, 7 Sep 2022 16:40:14 +0100 Subject: [PATCH 08/65] fixed stage_b build, added doc for cal_vnr_pred, cleaned vnr from the old stuff --- examples/bare-metal/vnr/src/vnr_task.c | 7 ++----- modules/lib_ic/api/ic_api.h | 14 +++++++++++++- modules/lib_vnr/api/inference/vnr_inference_api.h | 4 +--- modules/lib_vnr/src/inference/vnr_inference.cc | 10 ++++------ modules/lib_vnr/src/inference/vnr_inference_priv.h | 6 +----- test/lib_vnr/profile_memory/src/profile_full.c | 2 +- .../lib_vnr/profile_memory/src/profile_inference.c | 2 +- test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c | 8 ++------ .../vnr_unit_tests/full/src/test_vnr_full.c | 6 +----- .../inference/src/test_vnr_inference.c | 6 +----- test/stage_b/build_c_code.py | 2 +- 11 files changed, 28 insertions(+), 39 deletions(-) diff --git a/examples/bare-metal/vnr/src/vnr_task.c b/examples/bare-metal/vnr/src/vnr_task.c index dca31118c..b49c20fde 100644 --- a/examples/bare-metal/vnr/src/vnr_task.c +++ b/examples/bare-metal/vnr/src/vnr_task.c @@ -22,12 +22,9 @@ void vnr(chanend_t c_frame_in, chanend_t c_frame_out) prof(0, "start_vnr_init"); vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - int32_t err = vnr_inference_init(); + vnr_inference_init(); prof(1, "end_vnr_init"); - if(err) { - printf("ERROR: vnr_inference_init() returned error %ld\n",err); - assert(0); - } + int framenum = 0; while(1) { diff --git a/modules/lib_ic/api/ic_api.h b/modules/lib_ic/api/ic_api.h index c626577f8..5f18f4084 100644 --- a/modules/lib_ic/api/ic_api.h +++ b/modules/lib_ic/api/ic_api.h @@ -53,7 +53,19 @@ void ic_filter(ic_state_t *state, int32_t y_data[IC_FRAME_ADVANCE], int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); - +/** + * @brief Calculate voice to noise ratio for the input and output of the IC + * + * This function can be called after each call to ic_filter. + * It will calculate voice to noise ratio which can be used to give information + * to ic_adapt and to the AGC. + * + * @param[inout] state pointer to IC state structure + * @param[inout] input_vnr_pred voice to noise estimate of the IC input + * @param[inout] output_vnr_pred voice to noise estimate of the IC output + * + * @ingroup ic_func + */ void ic_calc_vnr_pred(ic_state_t *state, float_s32_t * input_vnr_pred, float_s32_t * output_vnr_pred); diff --git a/modules/lib_vnr/api/inference/vnr_inference_api.h b/modules/lib_vnr/api/inference/vnr_inference_api.h index c96ef60ed..8e54324e1 100644 --- a/modules/lib_vnr/api/inference/vnr_inference_api.h +++ b/modules/lib_vnr/api/inference/vnr_inference_api.h @@ -25,11 +25,9 @@ extern "C" { * It is called once at startup. The memory required for the inference engine object as well as the tensor arena size required for inference * is statically allocated as global buffers in the VNR module. The VNR model is compiled as part of the VNR module. * - * @returns error status. Non zero indicates an error. - * * @ingroup vnr_inference_api */ - int32_t vnr_inference_init(); + void vnr_inference_init(); /** * @brief Run model prediction on a feature patch diff --git a/modules/lib_vnr/src/inference/vnr_inference.cc b/modules/lib_vnr/src/inference/vnr_inference.cc index 64308f1e3..bdc641950 100644 --- a/modules/lib_vnr/src/inference/vnr_inference.cc +++ b/modules/lib_vnr/src/inference/vnr_inference.cc @@ -7,19 +7,17 @@ #include "vnr_inference_priv.h" // Allocate all memory required by the inference engine -static vnr_ie_state_t vnr_ie_state; +static vnr_model_quant_spec_t vnr_quant_state; // TODO: unsure why the stack can not be computed automatically here #pragma stackfunction 1000 -int32_t vnr_inference_init() { - vnr_ie_state_t *ie_ptr = &vnr_ie_state; +void vnr_inference_init() { vnr_init(); // Initialise input quant and output dequant parameters - vnr_priv_init_quant_spec(&ie_ptr->quant_spec); - return 0; + vnr_priv_init_quant_spec(&vnr_quant_state); } @@ -31,7 +29,7 @@ void vnr_inference(float_s32_t *vnr_output, bfp_s32_t *features) { int8_t * out_buffer = vnr_get_output(); // Quantise features to 8bit vnr_priv_feature_quantise(in_buffer, features, &ie_state->quant_spec); - + // Inference vnr_inference_invoke(); diff --git a/modules/lib_vnr/src/inference/vnr_inference_priv.h b/modules/lib_vnr/src/inference/vnr_inference_priv.h index 76a17b3bb..f5fadeb89 100644 --- a/modules/lib_vnr/src/inference/vnr_inference_priv.h +++ b/modules/lib_vnr/src/inference/vnr_inference_priv.h @@ -15,10 +15,6 @@ typedef struct { float_s32_t output_zero_point; }vnr_model_quant_spec_t; -typedef struct { - vnr_model_quant_spec_t quant_spec; /// VNR model quantisation spec -}vnr_ie_state_t; - #ifdef __cplusplus extern "C" { #endif @@ -28,7 +24,7 @@ extern "C" { * @param[in] quant_spec Quantisation spec structure */ void vnr_priv_init_quant_spec(vnr_model_quant_spec_t *quant_spec); - + /** * @brief Quantise VNR features * This function quantises the floating point features according to the specification for TensorFlow Lite's 8-bit quantization scheme. diff --git a/test/lib_vnr/profile_memory/src/profile_full.c b/test/lib_vnr/profile_memory/src/profile_full.c index 6fdfb71b5..b58883a1c 100644 --- a/test/lib_vnr/profile_memory/src/profile_full.c +++ b/test/lib_vnr/profile_memory/src/profile_full.c @@ -10,7 +10,7 @@ int main(int argc, char** argv) { vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - int32_t err = vnr_inference_init(); + vnr_inference_init(); int32_t new_frame[VNR_FRAME_ADVANCE]; complex_s32_t DWORD_ALIGNED input_frame[VNR_FD_FRAME_LENGTH]; diff --git a/test/lib_vnr/profile_memory/src/profile_inference.c b/test/lib_vnr/profile_memory/src/profile_inference.c index 1cbd4eb48..5ced838c6 100644 --- a/test/lib_vnr/profile_memory/src/profile_inference.c +++ b/test/lib_vnr/profile_memory/src/profile_inference.c @@ -3,7 +3,7 @@ #include "vnr_inference_api.h" int main(int argc, char** argv) { - int32_t err = vnr_inference_init(); + vnr_inference_init(); float_s32_t inference_output; bfp_s32_t feature_patch; diff --git a/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c b/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c index d245609a0..aa30e8097 100644 --- a/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c +++ b/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c @@ -64,12 +64,8 @@ void test_wav_vnr(const char *in_filename) vnr_feature_state_t vnr_feature_state; vnr_feature_state_init(&vnr_feature_state); - int32_t err = vnr_inference_init(); - if(err) { - printf("vnr_inference_init() returned error %ld. Exiting.\n", err); - assert(0); - } - + vnr_inference_init(); + uint64_t end_init_cycles = (uint64_t)get_reference_time(); uint32_t vnr_init_cycles = (uint32_t)(end_init_cycles - start_init_cycles); diff --git a/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c b/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c index c624be4fa..ec9050333 100644 --- a/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c +++ b/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c @@ -15,11 +15,7 @@ void test_init() { vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - int32_t ret = vnr_inference_init(); - if(ret) { - printf("vnr_inference_init() returned error %ld\n",ret); - assert(0); - } + vnr_inference_init(); } void test(int32_t *output, int32_t *input) diff --git a/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c b/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c index 2edd724e9..dfc59fd05 100644 --- a/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c +++ b/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c @@ -10,11 +10,7 @@ void test_init() { - int32_t ret = vnr_inference_init(); - if(ret) { - printf("vnr_inference_init() returned error %ld\n",ret); - assert(0); - } + vnr_inference_init(); } void test(int32_t *output, int32_t *input) diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index a1c6c395c..1bd46a74d 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -77,7 +77,7 @@ '../../../build/modules/lib_vnr', '../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) From 4bcb5e042a1b9a275e7db26c0640691d799d3481 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Wed, 7 Sep 2022 16:54:13 +0100 Subject: [PATCH 09/65] fixing build errors --- examples/bare-metal/vnr/src/vnr_task.c | 3 --- examples/bare-metal/vnr/src/with_fileio/vnr_task.c | 6 +----- modules/lib_vnr/src/inference/vnr_inference.cc | 5 ++--- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/examples/bare-metal/vnr/src/vnr_task.c b/examples/bare-metal/vnr/src/vnr_task.c index b49c20fde..9baed566f 100644 --- a/examples/bare-metal/vnr/src/vnr_task.c +++ b/examples/bare-metal/vnr/src/vnr_task.c @@ -11,9 +11,6 @@ static void prof(int n, const char* str) {} static void print_prof(int a, int b, int framenum){} #endif - - - void vnr(chanend_t c_frame_in, chanend_t c_frame_out) { vnr_input_state_t vnr_input_state; diff --git a/examples/bare-metal/vnr/src/with_fileio/vnr_task.c b/examples/bare-metal/vnr/src/with_fileio/vnr_task.c index 90618b626..d77e006fa 100644 --- a/examples/bare-metal/vnr/src/with_fileio/vnr_task.c +++ b/examples/bare-metal/vnr/src/with_fileio/vnr_task.c @@ -19,12 +19,8 @@ void vnr_task(const char* input_filename, const char *output_filename){ prof(0, "start_vnr_init"); vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - int32_t err = vnr_inference_init(); + vnr_inference_init(); prof(1, "end_vnr_init"); - if(err) { - printf("ERROR: vnr_inference_init() returned error %ld\n",err); - assert(0); - } file_t input_file; int ret = file_open(&input_file, input_filename, "rb"); diff --git a/modules/lib_vnr/src/inference/vnr_inference.cc b/modules/lib_vnr/src/inference/vnr_inference.cc index bdc641950..58d4805f7 100644 --- a/modules/lib_vnr/src/inference/vnr_inference.cc +++ b/modules/lib_vnr/src/inference/vnr_inference.cc @@ -24,16 +24,15 @@ void vnr_inference_init() { #pragma stackfunction 1000 void vnr_inference(float_s32_t *vnr_output, bfp_s32_t *features) { - vnr_ie_state_t *ie_state = &vnr_ie_state; int8_t * in_buffer = vnr_get_input(); int8_t * out_buffer = vnr_get_output(); // Quantise features to 8bit - vnr_priv_feature_quantise(in_buffer, features, &ie_state->quant_spec); + vnr_priv_feature_quantise(in_buffer, features, &vnr_quant_state); // Inference vnr_inference_invoke(); // Dequantise inference output - vnr_priv_output_dequantise(vnr_output, out_buffer, &ie_state->quant_spec); + vnr_priv_output_dequantise(vnr_output, out_buffer, &vnr_quant_state); } From f6b634aaa455a1307141acab1b8c01d998a23ef2 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Wed, 7 Sep 2022 17:12:54 +0100 Subject: [PATCH 10/65] fixing vnr cffi test --- .../py_c_feature_compare/build_vnr_feature_extraction.py | 4 ++-- .../py_c_feature_compare/test_vnr_feature_extraction.py | 2 +- test/lib_vnr/py_c_feature_compare/vnr_test.c | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index 46d6264c7..574412140 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -36,7 +36,7 @@ ffibuilder.cdef( predefs + """ - int test_init(void); + void test_init(void); vnr_feature_state_t test_get_feature_state(void); void test_vnr_features(bfp_s32_t *feature_bfp, int32_t *feature_data, const int32_t *new_x_frame); double test_vnr_inference(bfp_s32_t *features); @@ -48,7 +48,7 @@ """ #include "vnr_features_api.h" #include "vnr_inference_api.h" - int test_init(void); + void test_init(void); vnr_feature_state_t test_get_feature_state(void); void test_vnr_features(bfp_s32_t *feature_bfp, int32_t *feature_data, const int32_t *new_x_frame); double test_vnr_inference(bfp_s32_t *features); diff --git a/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py index 9761d8cd5..def469f44 100644 --- a/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py @@ -50,7 +50,7 @@ class vnr_feature_comparison: def __init__(self): self.vnr_obj = vnr.Vnr(model_file=tflite_model) self.x_data = np.zeros(fp.FRAME_LEN, dtype=np.float64) - err = vnr_test_lib.test_init() + vnr_test_lib.test_init() def process_frame(self, new_x_frame): frame_int = pvc.float_to_int32(new_x_frame) diff --git a/test/lib_vnr/py_c_feature_compare/vnr_test.c b/test/lib_vnr/py_c_feature_compare/vnr_test.c index 220bebfc6..bf338cc3c 100644 --- a/test/lib_vnr/py_c_feature_compare/vnr_test.c +++ b/test/lib_vnr/py_c_feature_compare/vnr_test.c @@ -4,13 +4,11 @@ vnr_input_state_t vnr_input_state; vnr_feature_state_t vnr_feature_state; -int32_t vnr_ie_init_err; -int test_init(void){ +void test_init(void){ vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - int err = vnr_inference_init(); - return err; + vnr_inference_init(); } vnr_feature_state_t test_get_feature_state(void){ From 505577f60184b8bfd4210249603bc5585a6cd0ba Mon Sep 17 00:00:00 2001 From: shuchitak <38428600+shuchitak@users.noreply.github.com> Date: Fri, 9 Sep 2022 09:46:22 +0100 Subject: [PATCH 11/65] Increasing kTensorArenaSize in the autogenerated outFile.cpp to see if it fixes the stage_b test --- modules/lib_vnr/src/inference/model/outFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lib_vnr/src/inference/model/outFile.cpp b/modules/lib_vnr/src/inference/model/outFile.cpp index 062a22535..5ac853993 100644 --- a/modules/lib_vnr/src/inference/model/outFile.cpp +++ b/modules/lib_vnr/src/inference/model/outFile.cpp @@ -32,7 +32,7 @@ extern TfLiteRegistration *Register_XC_conv2d_v2(void); namespace { -constexpr int kTensorArenaSize = 1208; +constexpr int kTensorArenaSize = 20000; uint8_t tensor_arena[kTensorArenaSize] ALIGN(8); template struct TfArray { int sz; T elem[SZ]; From 94dd329e062473edde01d79fd64ac934c2b2fd87 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Mon, 12 Sep 2022 10:42:26 +0100 Subject: [PATCH 12/65] bringing original kTensorArenaSize and running stage_b tests separately to run the pipelines tests --- Jenkinsfile | 4 ++-- modules/lib_vnr/src/inference/model/outFile.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 33e5bdf73..5b2db85d5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -422,8 +422,8 @@ pipeline { withVenv { withMounts([["projects", "projects/hydra_audio", "hydra_audio_stage_b_tests"]]) { withEnv(["hydra_audio_PATH=$hydra_audio_stage_b_tests_PATH"]) { - sh "pytest -s --junitxml=pytest_result.xml" - junit "pytest_result.xml" + sh "pytest -k test_frame_compare" + sh "pytest -k test_adaption_controller" } } } diff --git a/modules/lib_vnr/src/inference/model/outFile.cpp b/modules/lib_vnr/src/inference/model/outFile.cpp index 5ac853993..062a22535 100644 --- a/modules/lib_vnr/src/inference/model/outFile.cpp +++ b/modules/lib_vnr/src/inference/model/outFile.cpp @@ -32,7 +32,7 @@ extern TfLiteRegistration *Register_XC_conv2d_v2(void); namespace { -constexpr int kTensorArenaSize = 20000; +constexpr int kTensorArenaSize = 1208; uint8_t tensor_arena[kTensorArenaSize] ALIGN(8); template struct TfArray { int sz; T elem[SZ]; From feda1423ca83107ec36c688033e19269c9d1bba7 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Mon, 12 Sep 2022 16:17:43 +0100 Subject: [PATCH 13/65] updating docs for windows compatibility --- doc/getting_started.rst | 1 + examples/bare-metal/aec_1_thread/README.rst | 1 + examples/bare-metal/aec_2_threads/README.rst | 1 + examples/bare-metal/agc/README.rst | 1 + examples/bare-metal/ic/README.rst | 1 + examples/bare-metal/pipeline_alt_arch/README.rst | 1 + examples/bare-metal/pipeline_multi_threaded/README.rst | 1 + examples/bare-metal/pipeline_single_threaded/README.rst | 1 + modules/lib_ic/api/ic_api.h | 4 ++-- 9 files changed, 10 insertions(+), 2 deletions(-) diff --git a/doc/getting_started.rst b/doc/getting_started.rst index d0f4bb9a4..12ae22624 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -42,6 +42,7 @@ procedure is currently supported on MacOS and Linux only. .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake 4. Running make will then build the Voice Framework libraries and example applications diff --git a/examples/bare-metal/aec_1_thread/README.rst b/examples/bare-metal/aec_1_thread/README.rst index 4cd23defa..5880a1068 100644 --- a/examples/bare-metal/aec_1_thread/README.rst +++ b/examples/bare-metal/aec_1_thread/README.rst @@ -26,6 +26,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_aec_1_thread diff --git a/examples/bare-metal/aec_2_threads/README.rst b/examples/bare-metal/aec_2_threads/README.rst index cadbe8934..4584b2460 100644 --- a/examples/bare-metal/aec_2_threads/README.rst +++ b/examples/bare-metal/aec_2_threads/README.rst @@ -27,6 +27,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_aec_2_thread diff --git a/examples/bare-metal/agc/README.rst b/examples/bare-metal/agc/README.rst index a132d29a1..890523f1b 100644 --- a/examples/bare-metal/agc/README.rst +++ b/examples/bare-metal/agc/README.rst @@ -26,6 +26,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_agc diff --git a/examples/bare-metal/ic/README.rst b/examples/bare-metal/ic/README.rst index 9a460acd3..4ca8258dc 100644 --- a/examples/bare-metal/ic/README.rst +++ b/examples/bare-metal/ic/README.rst @@ -30,6 +30,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_ic diff --git a/examples/bare-metal/pipeline_alt_arch/README.rst b/examples/bare-metal/pipeline_alt_arch/README.rst index 867176244..c3f46233c 100644 --- a/examples/bare-metal/pipeline_alt_arch/README.rst +++ b/examples/bare-metal/pipeline_alt_arch/README.rst @@ -55,6 +55,7 @@ Run the following commands in the fwk_voice/build folder to build the multi-thre .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_pipeline_alt_arch_mt diff --git a/examples/bare-metal/pipeline_multi_threaded/README.rst b/examples/bare-metal/pipeline_multi_threaded/README.rst index be1fa0805..b7fc967ae 100644 --- a/examples/bare-metal/pipeline_multi_threaded/README.rst +++ b/examples/bare-metal/pipeline_multi_threaded/README.rst @@ -57,6 +57,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_pipeline_multi_thread diff --git a/examples/bare-metal/pipeline_single_threaded/README.rst b/examples/bare-metal/pipeline_single_threaded/README.rst index a371c6fac..07c16177e 100644 --- a/examples/bare-metal/pipeline_single_threaded/README.rst +++ b/examples/bare-metal/pipeline_single_threaded/README.rst @@ -54,6 +54,7 @@ Run the following commands in the fwk_voice/build folder to build the firmware f .. code-block:: console + # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake nmake fwk_voice_example_bare_metal_pipeline_single_thread diff --git a/modules/lib_ic/api/ic_api.h b/modules/lib_ic/api/ic_api.h index 5f18f4084..75ef42acb 100644 --- a/modules/lib_ic/api/ic_api.h +++ b/modules/lib_ic/api/ic_api.h @@ -19,7 +19,7 @@ */ /** - * @brief Initialise IC data structures and set parameters according to ic_defines.h + * @brief Initialise IC and VNR data structures and set parameters according to ic_defines.h * * This is the first function that must called after creating an ic_state_t instance. * @@ -54,7 +54,7 @@ void ic_filter(ic_state_t *state, int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); /** - * @brief Calculate voice to noise ratio for the input and output of the IC + * @brief Calculate voice to noise ratio estimation for the input and output of the IC * * This function can be called after each call to ic_filter. * It will calculate voice to noise ratio which can be used to give information From 7e5916a4e71f88acd10e0d46e51b6caf70467092 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Thu, 15 Sep 2022 12:38:01 +0100 Subject: [PATCH 14/65] changing tflite_micro sha after Brennan's force push --- examples/bare-metal/shared_src/external_deps/fetch_deps.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index bb062f18b..f3f620851 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -31,7 +31,7 @@ FetchContent_Populate(lib_nn) FetchContent_Declare( tflite_micro GIT_REPOSITORY https://github.com/xmos/lib_tflite_micro.git - GIT_TAG a2dccc68bdef57a3b0ed326ea4d815a475feb39e + GIT_TAG 6497fd882800b18e5c286700eb81ceb5e5e9eeeb GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro PATCH_COMMAND patch -d lib_tflite_micro/submodules/tflite-micro/ -p0 -i ../../../patches/tflite-micro.patch From 44930ddeabf4f26967e079f564783ca0ff0365f3 Mon Sep 17 00:00:00 2001 From: Pavel Uvarov Date: Fri, 16 Sep 2022 10:56:11 +0100 Subject: [PATCH 15/65] changing to the right hash --- examples/bare-metal/shared_src/external_deps/fetch_deps.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index f3f620851..ca1727270 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -31,7 +31,7 @@ FetchContent_Populate(lib_nn) FetchContent_Declare( tflite_micro GIT_REPOSITORY https://github.com/xmos/lib_tflite_micro.git - GIT_TAG 6497fd882800b18e5c286700eb81ceb5e5e9eeeb + GIT_TAG c59ee18f013f159abaa10ef0faf70b18f80f0315 GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_tflite_micro PATCH_COMMAND patch -d lib_tflite_micro/submodules/tflite-micro/ -p0 -i ../../../patches/tflite-micro.patch From 0fcaa5bcb390695cccb5449334ddf7127122a0c7 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Tue, 20 Sep 2022 16:50:38 +0100 Subject: [PATCH 16/65] Made vnr_pred_state_t a part of ic_state_t --- modules/lib_ic/CMakeLists.txt | 4 ++-- modules/lib_ic/api/ic_state.h | 9 +++++++++ modules/lib_ic/src/ic.c | 28 +++++++++++++--------------- modules/lib_ic/src/ic_low_level.h | 8 -------- 4 files changed, 24 insertions(+), 25 deletions(-) diff --git a/modules/lib_ic/CMakeLists.txt b/modules/lib_ic/CMakeLists.txt index d0f35cb2b..db2d45865 100644 --- a/modules/lib_ic/CMakeLists.txt +++ b/modules/lib_ic/CMakeLists.txt @@ -23,8 +23,8 @@ target_link_libraries(fwk_voice_module_lib_ic PUBLIC core::xs3_math fwk_voice::aec - fwk_voice::vnr::features - fwk_voice::vnr::inference + fwk_voice::vnr::features + fwk_voice::vnr::inference ) ## Create an alias diff --git a/modules/lib_ic/api/ic_state.h b/modules/lib_ic/api/ic_state.h index 64c6ca15b..64c19ea3c 100644 --- a/modules/lib_ic/api/ic_state.h +++ b/modules/lib_ic/api/ic_state.h @@ -140,6 +140,13 @@ typedef struct { ic_adaption_controller_config_t adaption_controller_config; } ic_adaption_controller_state_t; +// Struct to keep VNR predictions and the EMA alpha +typedef struct { + vnr_feature_state_t feature_state[2]; + float_s32_t input_vnr_pred; + float_s32_t output_vnr_pred; + fixed_s32_t pred_alpha_q30; +}vnr_pred_state_t; /** * @brief IC state structure @@ -249,6 +256,8 @@ typedef struct { ic_config_params_t config_params; /** State and configuration parameters for the IC adaption controller. */ ic_adaption_controller_state_t ic_adaption_controller_state; + /** Input and Output VNR Prediction related state*/ + vnr_pred_state_t vnr_pred_state; } ic_state_t; #endif diff --git a/modules/lib_ic/src/ic.c b/modules/lib_ic/src/ic.c index f60c565b4..f11b6174d 100644 --- a/modules/lib_ic/src/ic.c +++ b/modules/lib_ic/src/ic.c @@ -8,16 +8,14 @@ void ic_dump_var_2d(ic_state_t *state); void ic_dump_var_3d(ic_state_t *state); -vnr_pred_state_t vnr_pred_state; - -static void ic_init_vnr_pred_state(){ - vnr_feature_state_init(&vnr_pred_state.feature_state[0]); - vnr_feature_state_init(&vnr_pred_state.feature_state[1]); +static void ic_init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state){ + vnr_feature_state_init(&vnr_pred_state->feature_state[0]); + vnr_feature_state_init(&vnr_pred_state->feature_state[1]); vnr_inference_init(); - vnr_pred_state.pred_alpha_q30 = Q30(IC_INIT_VNR_PRED_ALPHA); - vnr_pred_state.input_vnr_pred = float_to_float_s32(IC_INIT_INPUT_VNR_PRED); - vnr_pred_state.output_vnr_pred = float_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); + vnr_pred_state->pred_alpha_q30 = Q30(IC_INIT_VNR_PRED_ALPHA); + vnr_pred_state->input_vnr_pred = float_to_float_s32(IC_INIT_INPUT_VNR_PRED); + vnr_pred_state->output_vnr_pred = float_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); } static void ic_init_config(ic_config_params_t *config){ @@ -146,7 +144,7 @@ void ic_init(ic_state_t *state){ // Initialise ic core config params and adaption controller ic_init_config(&state->config_params); ic_init_adaption_controller(&state->ic_adaption_controller_state); - ic_init_vnr_pred_state(); + ic_init_vnr_pred_state(&state->vnr_pred_state); } void ic_filter( @@ -247,16 +245,16 @@ void ic_calc_vnr_pred( bfp_s32_t feature_patch; int32_t feature_patch_data[VNR_PATCH_WIDTH * VNR_MEL_FILTERS]; - vnr_extract_features(&vnr_pred_state.feature_state[0], &feature_patch, feature_patch_data, &ic_state->Y_bfp[0]); + vnr_extract_features(&ic_state->vnr_pred_state.feature_state[0], &feature_patch, feature_patch_data, &ic_state->Y_bfp[0]); float_s32_t ie_output; vnr_inference(&ie_output, &feature_patch); - vnr_pred_state.input_vnr_pred = float_s32_ema(vnr_pred_state.input_vnr_pred, ie_output, vnr_pred_state.pred_alpha_q30); - *input_vnr_pred = vnr_pred_state.input_vnr_pred; + ic_state->vnr_pred_state.input_vnr_pred = float_s32_ema(ic_state->vnr_pred_state.input_vnr_pred, ie_output, ic_state->vnr_pred_state.pred_alpha_q30); + *input_vnr_pred = ic_state->vnr_pred_state.input_vnr_pred; - vnr_extract_features(&vnr_pred_state.feature_state[1], &feature_patch, feature_patch_data, &ic_state->Error_bfp[0]); + vnr_extract_features(&ic_state->vnr_pred_state.feature_state[1], &feature_patch, feature_patch_data, &ic_state->Error_bfp[0]); vnr_inference(&ie_output, &feature_patch); - vnr_pred_state.output_vnr_pred = float_s32_ema(vnr_pred_state.output_vnr_pred, ie_output, vnr_pred_state.pred_alpha_q30); - *output_vnr_pred = vnr_pred_state.output_vnr_pred; + ic_state->vnr_pred_state.output_vnr_pred = float_s32_ema(ic_state->vnr_pred_state.output_vnr_pred, ie_output, ic_state->vnr_pred_state.pred_alpha_q30); + *output_vnr_pred = ic_state->vnr_pred_state.output_vnr_pred; } void ic_adapt( diff --git a/modules/lib_ic/src/ic_low_level.h b/modules/lib_ic/src/ic_low_level.h index 9ac970491..5929499e9 100644 --- a/modules/lib_ic/src/ic_low_level.h +++ b/modules/lib_ic/src/ic_low_level.h @@ -8,14 +8,6 @@ // IC Private API -// Struct to keep VNR predictions and the EMA alpha -typedef struct { - vnr_feature_state_t feature_state[2]; - float_s32_t input_vnr_pred; - float_s32_t output_vnr_pred; - fixed_s32_t pred_alpha_q30; -}vnr_pred_state_t; - // Setup core configuration parameters of the IC void ic_priv_init_config_params(ic_config_params_t *config_params); From fdeaf49f5f722f301e3aaf0e27dd704d91a94d2f Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Tue, 20 Sep 2022 18:41:53 +0100 Subject: [PATCH 17/65] return error status from vnr_inference_init() --- examples/bare-metal/vnr/src/vnr_task.c | 6 +++++- examples/bare-metal/vnr/src/with_fileio/vnr_task.c | 6 +++++- modules/lib_ic/api/ic_api.h | 5 +++-- modules/lib_ic/src/ic.c | 10 ++++++---- modules/lib_ic/src/ic_low_level.h | 2 +- modules/lib_vnr/api/inference/vnr_inference_api.h | 2 +- modules/lib_vnr/src/inference/model/wrapper.cpp | 5 +++-- modules/lib_vnr/src/inference/model/wrapper.h | 2 +- modules/lib_vnr/src/inference/vnr_inference.cc | 7 +++---- .../build_vnr_feature_extraction.py | 4 ++-- .../test_vnr_feature_extraction.py | 2 +- test/lib_vnr/py_c_feature_compare/vnr_test.c | 5 +++-- test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c | 6 +++++- test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c | 6 +++++- .../vnr_unit_tests/inference/src/test_vnr_inference.c | 6 +++++- test/stage_b/build_c_code.py | 4 ++-- test/stage_b/ic_vnr_test.c | 5 +++-- test/stage_b/test_stage_b_frame.py | 2 +- 18 files changed, 55 insertions(+), 30 deletions(-) diff --git a/examples/bare-metal/vnr/src/vnr_task.c b/examples/bare-metal/vnr/src/vnr_task.c index 9baed566f..eddef87d2 100644 --- a/examples/bare-metal/vnr/src/vnr_task.c +++ b/examples/bare-metal/vnr/src/vnr_task.c @@ -19,8 +19,12 @@ void vnr(chanend_t c_frame_in, chanend_t c_frame_out) prof(0, "start_vnr_init"); vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - vnr_inference_init(); + int32_t err = vnr_inference_init(); prof(1, "end_vnr_init"); + if(err) { + printf("ERROR: vnr_inference_init() returned error %ld\n",err); + assert(0); + } int framenum = 0; while(1) diff --git a/examples/bare-metal/vnr/src/with_fileio/vnr_task.c b/examples/bare-metal/vnr/src/with_fileio/vnr_task.c index d77e006fa..90618b626 100644 --- a/examples/bare-metal/vnr/src/with_fileio/vnr_task.c +++ b/examples/bare-metal/vnr/src/with_fileio/vnr_task.c @@ -19,8 +19,12 @@ void vnr_task(const char* input_filename, const char *output_filename){ prof(0, "start_vnr_init"); vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - vnr_inference_init(); + int32_t err = vnr_inference_init(); prof(1, "end_vnr_init"); + if(err) { + printf("ERROR: vnr_inference_init() returned error %ld\n",err); + assert(0); + } file_t input_file; int ret = file_open(&input_file, input_filename, "rb"); diff --git a/modules/lib_ic/api/ic_api.h b/modules/lib_ic/api/ic_api.h index 75ef42acb..cc0371d38 100644 --- a/modules/lib_ic/api/ic_api.h +++ b/modules/lib_ic/api/ic_api.h @@ -24,9 +24,10 @@ * This is the first function that must called after creating an ic_state_t instance. * * @param[inout] state pointer to IC state structure - * + * @returns Error status of the VNR inference engine initialisation that is done as part of ic_init. 0 if no error, one of TfLiteStatus error enum values in case of error. * @ingroup ic_func - */void ic_init(ic_state_t *state); + */ +int32_t ic_init(ic_state_t *state); /** diff --git a/modules/lib_ic/src/ic.c b/modules/lib_ic/src/ic.c index f11b6174d..622fa93cf 100644 --- a/modules/lib_ic/src/ic.c +++ b/modules/lib_ic/src/ic.c @@ -8,14 +8,15 @@ void ic_dump_var_2d(ic_state_t *state); void ic_dump_var_3d(ic_state_t *state); -static void ic_init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state){ +static int32_t ic_init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state){ vnr_feature_state_init(&vnr_pred_state->feature_state[0]); vnr_feature_state_init(&vnr_pred_state->feature_state[1]); - vnr_inference_init(); + int32_t ret = vnr_inference_init(); vnr_pred_state->pred_alpha_q30 = Q30(IC_INIT_VNR_PRED_ALPHA); vnr_pred_state->input_vnr_pred = float_to_float_s32(IC_INIT_INPUT_VNR_PRED); vnr_pred_state->output_vnr_pred = float_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); + return ret; } static void ic_init_config(ic_config_params_t *config){ @@ -62,7 +63,7 @@ static void ic_init_adaption_controller(ic_adaption_controller_state_t *ad_state ic_init_adaption_controller_config(&ad_state->adaption_controller_config); } -void ic_init(ic_state_t *state){ +int32_t ic_init(ic_state_t *state){ memset(state, 0, sizeof(ic_state_t)); const exponent_t zero_exp = -1024; @@ -144,7 +145,8 @@ void ic_init(ic_state_t *state){ // Initialise ic core config params and adaption controller ic_init_config(&state->config_params); ic_init_adaption_controller(&state->ic_adaption_controller_state); - ic_init_vnr_pred_state(&state->vnr_pred_state); + int32_t ret = ic_init_vnr_pred_state(&state->vnr_pred_state); + return ret; } void ic_filter( diff --git a/modules/lib_ic/src/ic_low_level.h b/modules/lib_ic/src/ic_low_level.h index 5929499e9..a44c04166 100644 --- a/modules/lib_ic/src/ic_low_level.h +++ b/modules/lib_ic/src/ic_low_level.h @@ -25,7 +25,7 @@ void ic_calc_fast_ratio(ic_adaption_controller_state_t * ad_state); void ic_filter_adapt(ic_state_t *state); // Some nice doxygen comments -void ic_init(ic_state_t *state); +int32_t ic_init(ic_state_t *state); // Delays y_channel w.r.t. x_channel void ic_delay_y_input(ic_state_t *state, diff --git a/modules/lib_vnr/api/inference/vnr_inference_api.h b/modules/lib_vnr/api/inference/vnr_inference_api.h index 8e54324e1..fc9138bcb 100644 --- a/modules/lib_vnr/api/inference/vnr_inference_api.h +++ b/modules/lib_vnr/api/inference/vnr_inference_api.h @@ -27,7 +27,7 @@ extern "C" { * * @ingroup vnr_inference_api */ - void vnr_inference_init(); + int32_t vnr_inference_init(); /** * @brief Run model prediction on a feature patch diff --git a/modules/lib_vnr/src/inference/model/wrapper.cpp b/modules/lib_vnr/src/inference/model/wrapper.cpp index 35c8925b5..6f6d3242b 100644 --- a/modules/lib_vnr/src/inference/model/wrapper.cpp +++ b/modules/lib_vnr/src/inference/model/wrapper.cpp @@ -1,8 +1,9 @@ #include "outFile.cpp.h" #include "wrapper.h" -void vnr_init() { - model_init(NULL); +int32_t vnr_init() { + int32_t ret = model_init(NULL); + return ret; } int8_t* vnr_get_input() { return model_input(0)->data.int8; diff --git a/modules/lib_vnr/src/inference/model/wrapper.h b/modules/lib_vnr/src/inference/model/wrapper.h index bd1e4079a..29f75cad9 100644 --- a/modules/lib_vnr/src/inference/model/wrapper.h +++ b/modules/lib_vnr/src/inference/model/wrapper.h @@ -4,7 +4,7 @@ #ifdef __cplusplus extern "C" { #endif - void vnr_init(); + int32_t vnr_init(); int8_t* vnr_get_input(); int8_t* vnr_get_output(); void vnr_inference_invoke(); diff --git a/modules/lib_vnr/src/inference/vnr_inference.cc b/modules/lib_vnr/src/inference/vnr_inference.cc index 58d4805f7..b898b601a 100644 --- a/modules/lib_vnr/src/inference/vnr_inference.cc +++ b/modules/lib_vnr/src/inference/vnr_inference.cc @@ -12,16 +12,15 @@ static vnr_model_quant_spec_t vnr_quant_state; // TODO: unsure why the stack can not be computed automatically here #pragma stackfunction 1000 -void vnr_inference_init() { +int32_t vnr_inference_init() { - vnr_init(); + int32_t ret = vnr_init(); // Initialise input quant and output dequant parameters vnr_priv_init_quant_spec(&vnr_quant_state); + return ret; } - - #pragma stackfunction 1000 void vnr_inference(float_s32_t *vnr_output, bfp_s32_t *features) { int8_t * in_buffer = vnr_get_input(); diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index 574412140..46d6264c7 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -36,7 +36,7 @@ ffibuilder.cdef( predefs + """ - void test_init(void); + int test_init(void); vnr_feature_state_t test_get_feature_state(void); void test_vnr_features(bfp_s32_t *feature_bfp, int32_t *feature_data, const int32_t *new_x_frame); double test_vnr_inference(bfp_s32_t *features); @@ -48,7 +48,7 @@ """ #include "vnr_features_api.h" #include "vnr_inference_api.h" - void test_init(void); + int test_init(void); vnr_feature_state_t test_get_feature_state(void); void test_vnr_features(bfp_s32_t *feature_bfp, int32_t *feature_data, const int32_t *new_x_frame); double test_vnr_inference(bfp_s32_t *features); diff --git a/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py index def469f44..9761d8cd5 100644 --- a/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/test_vnr_feature_extraction.py @@ -50,7 +50,7 @@ class vnr_feature_comparison: def __init__(self): self.vnr_obj = vnr.Vnr(model_file=tflite_model) self.x_data = np.zeros(fp.FRAME_LEN, dtype=np.float64) - vnr_test_lib.test_init() + err = vnr_test_lib.test_init() def process_frame(self, new_x_frame): frame_int = pvc.float_to_int32(new_x_frame) diff --git a/test/lib_vnr/py_c_feature_compare/vnr_test.c b/test/lib_vnr/py_c_feature_compare/vnr_test.c index bf338cc3c..d2ba11b4d 100644 --- a/test/lib_vnr/py_c_feature_compare/vnr_test.c +++ b/test/lib_vnr/py_c_feature_compare/vnr_test.c @@ -5,10 +5,11 @@ vnr_input_state_t vnr_input_state; vnr_feature_state_t vnr_feature_state; -void test_init(void){ +int test_init(void){ vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - vnr_inference_init(); + int err = vnr_inference_init(); + return err; } vnr_feature_state_t test_get_feature_state(void){ diff --git a/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c b/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c index aa30e8097..390f53576 100644 --- a/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c +++ b/test/lib_vnr/test_wav_vnr/src/test_wav_vnr.c @@ -64,7 +64,11 @@ void test_wav_vnr(const char *in_filename) vnr_feature_state_t vnr_feature_state; vnr_feature_state_init(&vnr_feature_state); - vnr_inference_init(); + int32_t err = vnr_inference_init(); + if(err) { + printf("vnr_inference_init() returned error %ld. Exiting.\n", err); + assert(0); + } uint64_t end_init_cycles = (uint64_t)get_reference_time(); uint32_t vnr_init_cycles = (uint32_t)(end_init_cycles - start_init_cycles); diff --git a/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c b/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c index ec9050333..c624be4fa 100644 --- a/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c +++ b/test/lib_vnr/vnr_unit_tests/full/src/test_vnr_full.c @@ -15,7 +15,11 @@ void test_init() { vnr_input_state_init(&vnr_input_state); vnr_feature_state_init(&vnr_feature_state); - vnr_inference_init(); + int32_t ret = vnr_inference_init(); + if(ret) { + printf("vnr_inference_init() returned error %ld\n",ret); + assert(0); + } } void test(int32_t *output, int32_t *input) diff --git a/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c b/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c index dfc59fd05..2edd724e9 100644 --- a/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c +++ b/test/lib_vnr/vnr_unit_tests/inference/src/test_vnr_inference.c @@ -10,7 +10,11 @@ void test_init() { - vnr_inference_init(); + int32_t ret = vnr_inference_init(); + if(ret) { + printf("vnr_inference_init() returned error %ld\n",ret); + assert(0); + } } void test(int32_t *output, int32_t *input) diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 1bd46a74d..296a8ccdb 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -33,7 +33,7 @@ #Extract all defines and state from lib_ic programatically as CFFI doesn't do that yet predefs = extract_pre_defs() predefs += """ - void test_init(void); + int test_init(void); ic_state_t test_get_ic_state(void); void test_filter(int32_t y_data[IC_FRAME_ADVANCE], int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); void test_adapt(float_s32_t vnr); @@ -63,7 +63,7 @@ """ #include "ic_api.h" #include "ic_low_level.h" - void test_init(void); + int test_init(void); ic_state_t test_get_ic_state(void); void test_filter(int32_t y_data[IC_FRAME_ADVANCE], int32_t x_data[IC_FRAME_ADVANCE], int32_t output[IC_FRAME_ADVANCE]); void test_adapt(float_s32_t vnr); diff --git a/test/stage_b/ic_vnr_test.c b/test/stage_b/ic_vnr_test.c index 05f1aa21e..9b43038c0 100644 --- a/test/stage_b/ic_vnr_test.c +++ b/test/stage_b/ic_vnr_test.c @@ -4,8 +4,9 @@ ic_state_t ic_state; -void test_init(void){ - ic_init(&ic_state); +int test_init(void){ + int ret = ic_init(&ic_state); + return ret; } ic_state_t test_get_ic_state(void){ diff --git a/test/stage_b/test_stage_b_frame.py b/test/stage_b/test_stage_b_frame.py index 63bd2c91c..d09df1401 100644 --- a/test/stage_b/test_stage_b_frame.py +++ b/test/stage_b/test_stage_b_frame.py @@ -56,7 +56,7 @@ def __init__(self, ic_conf): self.x_data = np.zeros(self.proc_frame_length, dtype=np.float64) - ic_vnr_test_lib.test_init() + err = ic_vnr_test_lib.test_init() #Logging self.ic_state = None From 182d031af0b17adebe75c5b2af2cff8ef0c1f004 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 21 Sep 2022 14:03:51 +0100 Subject: [PATCH 18/65] - Updated the xform_model.py script to run the tflite_micro_compiler and autogenerate the .cpp file. - Moved wrapper.cpp and wrapper.h out of src/inference/model since model should only contain autogenerated files --- modules/lib_vnr/CMakeLists.txt | 2 +- .../python/utils/xformer/requirements.txt | 3 ++- .../python/utils/xformer/xform_model.py | 21 ++++++++++++++++++- .../lib_vnr/src/inference/vnr_inference.cc | 2 +- .../src/inference/{model => }/wrapper.cpp | 2 +- .../src/inference/{model => }/wrapper.h | 0 6 files changed, 25 insertions(+), 5 deletions(-) rename modules/lib_vnr/src/inference/{model => }/wrapper.cpp (90%) rename modules/lib_vnr/src/inference/{model => }/wrapper.h (100%) diff --git a/modules/lib_vnr/CMakeLists.txt b/modules/lib_vnr/CMakeLists.txt index de8896788..d3302a067 100644 --- a/modules/lib_vnr/CMakeLists.txt +++ b/modules/lib_vnr/CMakeLists.txt @@ -2,7 +2,7 @@ ## VNR Inference add_library(fwk_voice_module_lib_vnr_inference STATIC) -file(GLOB_RECURSE VNR_INFERENCE_SOURCES src/inference/model/*.cpp src/inference/*.cc) +file(GLOB_RECURSE VNR_INFERENCE_SOURCES src/inference/model/*.cpp src/inference/*.cc src/inference/*.cpp) target_sources(fwk_voice_module_lib_vnr_inference PRIVATE ${VNR_INFERENCE_SOURCES}) diff --git a/modules/lib_vnr/python/utils/xformer/requirements.txt b/modules/lib_vnr/python/utils/xformer/requirements.txt index b2ddb33bc..749d1b12d 100644 --- a/modules/lib_vnr/python/utils/xformer/requirements.txt +++ b/modules/lib_vnr/python/utils/xformer/requirements.txt @@ -1,5 +1,6 @@ xmos-ai-tools==0.1.8 jinja2 -tensorflow==2.8.0 +tensorflow==2.8.0; platform_machine != 'arm64' +tensorflow-macos==2.9.0; sys_platform == 'darwin' and platform_machine == 'arm64' protobuf==3.20.1 # https://github.com/protocolbuffers/protobuf/issues/10051 diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index 9f0dfa6e3..ead05e0bb 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -46,13 +46,32 @@ def get_quant_spec(model): print(f"Keeping a copy of generated files in {test_dir} directory") # Tflite to xcore optimised tflite micro - xcore_opt_model = os.path.join(test_dir, os.path.basename(model).split('.')[0] + "_xcore.tflite") + xcore_opt_model = os.path.abspath(os.path.join(test_dir, os.path.basename(model).split('.')[0] + "_xcore.tflite")) #xf.print_help() #xf.convert(f"{model}", f"{xcore_opt_model}", {"mlir-disable-threading": None, "xcore-reduce-memory": None}) convert_cmd = f"xcore-opt --xcore-thread-count 1 -o {xcore_opt_model} {model}".split() subprocess.run(convert_cmd, check=True) xcore_opt_model_size = os.path.getsize(xcore_opt_model) + + # Run tflite_micro_compiler to get the cpp file that can be compiled as part of the VNR module + compiled_cpp_file = os.path.abspath(os.path.join(test_dir, os.path.basename(xcore_opt_model).split('.')[0] + ".cpp")) + # Build the tflite_micro_compiler + # Check if the directory exists + lib_tflite_micro_path = os.path.join(this_filepath, "../../../../../build/fwk_voice_deps/lib_tflite_micro") + assert os.path.isdir(lib_tflite_micro_path), f"ERROR: lib_tflite_micro doesn't exist in {os.path.abspath(lib_tflite_micro_path)}. Run the fwk_voice cmake command to ensure lib_tflite_repo is fetched." + # Run a make build in the lib_tflite_micro directory which will build the tflite_micro_compiler + save_dir = os.getcwd() + os.chdir(lib_tflite_micro_path) + build_cmd = "make build".split() + subprocess.run(build_cmd, check=True) + # Run the tflite_micro_compiler to generate the micro compiled .cpp file from the optimised tflite model + tflite_micro_compiler_exe = os.path.abspath("tflite_micro_compiler/build/tflite_micro_compiler") + tflite_micro_compiler_cmd = f"{tflite_micro_compiler_exe} {xcore_opt_model} {compiled_cpp_file}".split() + subprocess.run(tflite_micro_compiler_cmd, check=True) + os.chdir(save_dir) + + # Convert tflite micro to .c and .h files that lib_vnr can compile with model_c_file = os.path.join(test_dir, "vnr_model_data.c") model_h_file = os.path.join(test_dir, "vnr_model_data.h") diff --git a/modules/lib_vnr/src/inference/vnr_inference.cc b/modules/lib_vnr/src/inference/vnr_inference.cc index b898b601a..9eca9e48e 100644 --- a/modules/lib_vnr/src/inference/vnr_inference.cc +++ b/modules/lib_vnr/src/inference/vnr_inference.cc @@ -2,7 +2,7 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include #include -#include "model/wrapper.h" +#include "wrapper.h" #include "vnr_inference_api.h" #include "vnr_inference_priv.h" diff --git a/modules/lib_vnr/src/inference/model/wrapper.cpp b/modules/lib_vnr/src/inference/wrapper.cpp similarity index 90% rename from modules/lib_vnr/src/inference/model/wrapper.cpp rename to modules/lib_vnr/src/inference/wrapper.cpp index 6f6d3242b..3057fd3bb 100644 --- a/modules/lib_vnr/src/inference/model/wrapper.cpp +++ b/modules/lib_vnr/src/inference/wrapper.cpp @@ -1,4 +1,4 @@ -#include "outFile.cpp.h" +#include "model/outFile.cpp.h" #include "wrapper.h" int32_t vnr_init() { diff --git a/modules/lib_vnr/src/inference/model/wrapper.h b/modules/lib_vnr/src/inference/wrapper.h similarity index 100% rename from modules/lib_vnr/src/inference/model/wrapper.h rename to modules/lib_vnr/src/inference/wrapper.h From 06ed4535430ca507114f1d096e380bf12efb5abd Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Thu, 22 Sep 2022 11:45:30 +0100 Subject: [PATCH 19/65] Add extra checks in xform_model.py --- .../lib_vnr/python/utils/xformer/xform_model.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index ead05e0bb..8c4747e29 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -8,6 +8,7 @@ from xmos_ai_tools import xformer as xf import pkg_resources import tempfile +import glob this_filepath = os.path.dirname(os.path.abspath(__file__)) @@ -117,8 +118,20 @@ def get_quant_spec(model): # Optionally, copy generated files into the VNR module if args.copy_files: + files_to_add = [os.path.basename(model_c_file), os.path.basename(model_h_file), os.path.basename(xcore_opt_model), "vnr_tensor_arena_size.h", "vnr_quant_spec_defines.h"] + files_to_delete = [] assert(args.module_path != None), "VNR module path --module-path needs to be specified when running with --copy-files" vnr_module_path = os.path.abspath(args.module_path) + current_files = glob.glob(f"{vnr_module_path}/*") # Files currently in vnr_module_path + for f in current_files: + if not os.path.basename(f) in files_to_add: + files_to_delete.append(f) + + print("files to delete\n",files_to_delete) + + # List of files that will be copied + # Check if any files from vnr_module_path would need deleting + print(f"WARNING: Copying files to lib_vnr module {vnr_module_path}. Verify before committing!") # Copy converted model .c and .h files shutil.copy2(model_c_file, vnr_module_path) @@ -129,6 +142,10 @@ def get_quant_spec(model): shutil.copy2(os.path.join(test_dir, "vnr_quant_spec_defines.h"), vnr_module_path) # Copy xcore opt model tflite file to the model's directory shutil.copy2(xcore_opt_model, vnr_module_path) + # Optionally do a git add and git rm as well?? + + + From 7e4b0128a50b7d0e1cdbce70b992008303552cf8 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Thu, 22 Sep 2022 11:47:38 +0100 Subject: [PATCH 20/65] Add extra checks in xform_model.py --- modules/lib_vnr/python/utils/xformer/xform_model.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index 8c4747e29..d84604b6d 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -64,7 +64,7 @@ def get_quant_spec(model): save_dir = os.getcwd() os.chdir(lib_tflite_micro_path) build_cmd = "make build".split() - subprocess.run(build_cmd, check=True) + #subprocess.run(build_cmd, check=True) # Run the tflite_micro_compiler to generate the micro compiled .cpp file from the optimised tflite model tflite_micro_compiler_exe = os.path.abspath("tflite_micro_compiler/build/tflite_micro_compiler") @@ -128,6 +128,7 @@ def get_quant_spec(model): files_to_delete.append(f) print("files to delete\n",files_to_delete) + print("files to copy\n", files_to_add) # List of files that will be copied # Check if any files from vnr_module_path would need deleting @@ -143,6 +144,8 @@ def get_quant_spec(model): # Copy xcore opt model tflite file to the model's directory shutil.copy2(xcore_opt_model, vnr_module_path) # Optionally do a git add and git rm as well?? + + print(f"Adding new files and removing old files in {vnr_module_path} from GIT now") From 344eed4d778b754cf74a4ee22745c674a1d08ddd Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Thu, 22 Sep 2022 11:50:45 +0100 Subject: [PATCH 21/65] commit before testing --- modules/lib_vnr/python/utils/xformer/xform_model.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index d84604b6d..f8b4f2b92 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -146,6 +146,13 @@ def get_quant_spec(model): # Optionally do a git add and git rm as well?? print(f"Adding new files and removing old files in {vnr_module_path} from GIT now") + for f in files_to_delete: + cmd = f"git rm {os.path.join(vnr_module_path, f)}".split() + subprocess.run(cmd, check=True) + for f in files_to_add: + cmd = f"git add {os.path.join(vnr_module_path, f)}".split() + subprocess.run(cmd, check=True) + From 676a4df661ad3f862bdd6008b7e38dae44fc22a5 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Thu, 22 Sep 2022 12:46:59 +0100 Subject: [PATCH 22/65] Modified xform_model.py to have some prints in the end listing the next steps that need to be done manually --- .../python/utils/xformer/xform_model.py | 30 ++++++++++++------- .../{outFile.cpp => trained_model_xcore.cpp} | 3 +- ...utFile.cpp.h => trained_model_xcore.cpp.h} | 3 +- modules/lib_vnr/src/inference/wrapper.cpp | 2 +- 4 files changed, 22 insertions(+), 16 deletions(-) rename modules/lib_vnr/src/inference/model/{outFile.cpp => trained_model_xcore.cpp} (99%) rename modules/lib_vnr/src/inference/model/{outFile.cpp.h => trained_model_xcore.cpp.h} (97%) diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index f8b4f2b92..6215e7853 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -56,6 +56,7 @@ def get_quant_spec(model): # Run tflite_micro_compiler to get the cpp file that can be compiled as part of the VNR module compiled_cpp_file = os.path.abspath(os.path.join(test_dir, os.path.basename(xcore_opt_model).split('.')[0] + ".cpp")) + compiled_h_file = os.path.abspath(os.path.join(test_dir, os.path.basename(xcore_opt_model).split('.')[0] + ".cpp.h")) # Build the tflite_micro_compiler # Check if the directory exists lib_tflite_micro_path = os.path.join(this_filepath, "../../../../../build/fwk_voice_deps/lib_tflite_micro") @@ -64,9 +65,9 @@ def get_quant_spec(model): save_dir = os.getcwd() os.chdir(lib_tflite_micro_path) build_cmd = "make build".split() - #subprocess.run(build_cmd, check=True) - # Run the tflite_micro_compiler to generate the micro compiled .cpp file from the optimised tflite model + subprocess.run(build_cmd, check=True) + # Run the tflite_micro_compiler to generate the micro compiled .cpp file from the optimised tflite model tflite_micro_compiler_exe = os.path.abspath("tflite_micro_compiler/build/tflite_micro_compiler") tflite_micro_compiler_cmd = f"{tflite_micro_compiler_exe} {xcore_opt_model} {compiled_cpp_file}".split() subprocess.run(tflite_micro_compiler_cmd, check=True) @@ -118,7 +119,7 @@ def get_quant_spec(model): # Optionally, copy generated files into the VNR module if args.copy_files: - files_to_add = [os.path.basename(model_c_file), os.path.basename(model_h_file), os.path.basename(xcore_opt_model), "vnr_tensor_arena_size.h", "vnr_quant_spec_defines.h"] + files_to_add = [os.path.basename(model_c_file), os.path.basename(model_h_file), os.path.basename(xcore_opt_model), os.path.basename(compiled_cpp_file), os.path.basename(compiled_h_file), "vnr_tensor_arena_size.h", "vnr_quant_spec_defines.h"] files_to_delete = [] assert(args.module_path != None), "VNR module path --module-path needs to be specified when running with --copy-files" vnr_module_path = os.path.abspath(args.module_path) @@ -143,15 +144,22 @@ def get_quant_spec(model): shutil.copy2(os.path.join(test_dir, "vnr_quant_spec_defines.h"), vnr_module_path) # Copy xcore opt model tflite file to the model's directory shutil.copy2(xcore_opt_model, vnr_module_path) - # Optionally do a git add and git rm as well?? - - print(f"Adding new files and removing old files in {vnr_module_path} from GIT now") - for f in files_to_delete: - cmd = f"git rm {os.path.join(vnr_module_path, f)}".split() - subprocess.run(cmd, check=True) + # Copy the tflite_micro_compiler output .cpp file + shutil.copy2(compiled_cpp_file, vnr_module_path) + # Copy the tflite_micro_compiler output .h file + shutil.copy2(compiled_h_file, vnr_module_path) + # Do a git add and git rm as well? + + print(f"\nNext steps that need to be done manually:") + if len(files_to_delete): + print(f"\n1. From {vnr_module_path}, git rm the following files:") + for f in files_to_delete: + print(f"\t{f}") + print(f"\n2. To {vnr_module_path}, git add the following files:") for f in files_to_add: - cmd = f"git add {os.path.join(vnr_module_path, f)}".split() - subprocess.run(cmd, check=True) + print(f"\t{f}") + print(f"\n3. Make sure that {vnr_module_path}/../wrapper.cpp includes model/{os.path.basename(compiled_h_file)} file\n") + diff --git a/modules/lib_vnr/src/inference/model/outFile.cpp b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp similarity index 99% rename from modules/lib_vnr/src/inference/model/outFile.cpp rename to modules/lib_vnr/src/inference/model/trained_model_xcore.cpp index 062a22535..525d5dcac 100644 --- a/modules/lib_vnr/src/inference/model/outFile.cpp +++ b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp @@ -1,5 +1,5 @@ // This file is generated. Do not edit. -// Generated on: 30.08.2022 11:36:14 +// Generated on: 22.09.2022 12:40:23 #include "../../api/xcore_config.h" @@ -1121,4 +1121,3 @@ TfLiteStatus model_invoke() { thread_destroy(&xc_config.thread_info); return kTfLiteOk; } - diff --git a/modules/lib_vnr/src/inference/model/outFile.cpp.h b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h similarity index 97% rename from modules/lib_vnr/src/inference/model/outFile.cpp.h rename to modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h index 8e30e370b..adf385282 100644 --- a/modules/lib_vnr/src/inference/model/outFile.cpp.h +++ b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h @@ -1,5 +1,5 @@ // This file is generated. Do not edit. -// Generated on: 30.08.2022 11:36:14 +// Generated on: 22.09.2022 12:40:23 #ifndef model_GEN_H #define model_GEN_H @@ -51,4 +51,3 @@ inline int *model_output_dims(int index) { } #endif - diff --git a/modules/lib_vnr/src/inference/wrapper.cpp b/modules/lib_vnr/src/inference/wrapper.cpp index 3057fd3bb..a88b8d6bc 100644 --- a/modules/lib_vnr/src/inference/wrapper.cpp +++ b/modules/lib_vnr/src/inference/wrapper.cpp @@ -1,4 +1,4 @@ -#include "model/outFile.cpp.h" +#include "model/trained_model_xcore.cpp.h" #include "wrapper.h" int32_t vnr_init() { From 5ac2668d320534184074dac98c3bb4d05be56cd0 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Thu, 22 Sep 2022 12:48:03 +0100 Subject: [PATCH 23/65] Disable cleanWs() for debugging --- Jenkinsfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 5b2db85d5..86b930610 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -648,9 +648,9 @@ pipeline { archiveArtifacts artifacts: "${REPO}/test/pipeline/keyword_input_*/*.wav", fingerprint: true archiveArtifacts artifacts: "${REPO}/test/pipeline/keyword_input_*/*.npy", fingerprint: true, allowEmptyArchive: true } - cleanup { - cleanWs() - } + //cleanup { + // cleanWs() + //} } }// stage xcore.ai Verification stage('Update view files') { From f83a03f33f64654a656dbff6a7c5bde0f2d4323d Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 11:16:05 +0100 Subject: [PATCH 24/65] - Added code in VNR to ensure model_init() for a given model happens only once. Reinitialising VNR modue should not call model_init() - Cleaned up xform_model.py to remove tensor scratch arena file generation --- .../python/utils/xformer/xform_model.py | 47 ++----------------- modules/lib_vnr/src/inference/wrapper.cpp | 17 ++++++- 2 files changed, 20 insertions(+), 44 deletions(-) diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index 6215e7853..569e15bf3 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -72,36 +72,6 @@ def get_quant_spec(model): tflite_micro_compiler_cmd = f"{tflite_micro_compiler_exe} {xcore_opt_model} {compiled_cpp_file}".split() subprocess.run(tflite_micro_compiler_cmd, check=True) os.chdir(save_dir) - - - # Convert tflite micro to .c and .h files that lib_vnr can compile with - model_c_file = os.path.join(test_dir, "vnr_model_data.c") - model_h_file = os.path.join(test_dir, "vnr_model_data.h") - tflite_to_c_script = os.path.join(this_filepath, "convert_tflite_to_c_source.py") - cmd = f"{tflite_to_c_script} --input {xcore_opt_model} --header {model_h_file} --source {model_c_file} --variable-name vnr".split() - subprocess.run(cmd, check=True) - ## Double check model size against vnr_model_data_len printed in the vnr_model_data.c - with open(model_c_file, "r") as fp: - lines = fp.read().splitlines() - for l in lines: - if "vnr_model_data_len" in l: - model_data_len = (l.split()[-1])[:-1] #TODO use re - assert(xcore_opt_model_size == int(model_data_len)), "model_data_len doesn't match xcore_opt tflite file size" - - # Create Tensor arena size define file - ie = xcore_tflm_host_interpreter() - ie.set_model(model_path=xcore_opt_model, secondary_memory = False, flash = False) - print(f"Tensor arena size = {ie.tensor_arena_size()} bytes") - - str_index = os.path.realpath(__file__).find('fwk_voice/') - assert(str_index != -1) - with open(os.path.join(test_dir, "vnr_tensor_arena_size.h"), "w") as fp: - fp.write(f"// Autogenerated from {os.path.realpath(__file__)[str_index:]}. Do not modify\n") - fp.write(f"// Generated using xmos-ai-tools version {ai_tools_version}\n") - fp.write("#ifndef VNR_TENSOR_ARENA_SIZE_H\n") - fp.write("#define VNR_TENSOR_ARENA_SIZE_H\n\n") - fp.write(f"#define TENSOR_ARENA_SIZE_BYTES ({ie.tensor_arena_size()} - {xcore_opt_model_size}) // Remove model size from the tensor_arena_size returned by the python xcore_tflm_host_interpreter \n") - fp.write("\n#endif") # Create Quant dequant spec defines file input_scale, input_zero_point, output_scale, output_zero_point = get_quant_spec(model) @@ -119,27 +89,21 @@ def get_quant_spec(model): # Optionally, copy generated files into the VNR module if args.copy_files: - files_to_add = [os.path.basename(model_c_file), os.path.basename(model_h_file), os.path.basename(xcore_opt_model), os.path.basename(compiled_cpp_file), os.path.basename(compiled_h_file), "vnr_tensor_arena_size.h", "vnr_quant_spec_defines.h"] + files_to_add = [os.path.basename(xcore_opt_model), os.path.basename(compiled_cpp_file), os.path.basename(compiled_h_file), "vnr_quant_spec_defines.h"] files_to_delete = [] assert(args.module_path != None), "VNR module path --module-path needs to be specified when running with --copy-files" + + # Check if any files from vnr_module_path would need deleting vnr_module_path = os.path.abspath(args.module_path) current_files = glob.glob(f"{vnr_module_path}/*") # Files currently in vnr_module_path for f in current_files: if not os.path.basename(f) in files_to_add: files_to_delete.append(f) - + print("files to delete\n",files_to_delete) print("files to copy\n", files_to_add) - - # List of files that will be copied - # Check if any files from vnr_module_path would need deleting - + print(f"WARNING: Copying files to lib_vnr module {vnr_module_path}. Verify before committing!") - # Copy converted model .c and .h files - shutil.copy2(model_c_file, vnr_module_path) - shutil.copy2(model_h_file, vnr_module_path) - # Copy tensor arena size defines file - shutil.copy2(os.path.join(test_dir, "vnr_tensor_arena_size.h"), vnr_module_path) # Copy quant dequant spec defines file shutil.copy2(os.path.join(test_dir, "vnr_quant_spec_defines.h"), vnr_module_path) # Copy xcore opt model tflite file to the model's directory @@ -148,7 +112,6 @@ def get_quant_spec(model): shutil.copy2(compiled_cpp_file, vnr_module_path) # Copy the tflite_micro_compiler output .h file shutil.copy2(compiled_h_file, vnr_module_path) - # Do a git add and git rm as well? print(f"\nNext steps that need to be done manually:") if len(files_to_delete): diff --git a/modules/lib_vnr/src/inference/wrapper.cpp b/modules/lib_vnr/src/inference/wrapper.cpp index a88b8d6bc..b148878a8 100644 --- a/modules/lib_vnr/src/inference/wrapper.cpp +++ b/modules/lib_vnr/src/inference/wrapper.cpp @@ -1,10 +1,23 @@ #include "model/trained_model_xcore.cpp.h" #include "wrapper.h" +// Flag to make sure a given model is initilised only once. This is needed because the model/trained_model_xcore.cpp file have one time initialised non-const global +// values which will not be reset to their original values in subsequent calls to model_init() causing the initialisation to go wrong. +static int32_t model_initialised = 0; + int32_t vnr_init() { - int32_t ret = model_init(NULL); - return ret; + if(!model_initialised) + { + model_initialised = 1; + int32_t ret = model_init(NULL); + return ret; + } + else + { + return 0; + } } + int8_t* vnr_get_input() { return model_input(0)->data.int8; } From bcb70da7acb50d97342ac7c445dbb9e93bf31e5c Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 12:10:01 +0100 Subject: [PATCH 25/65] - Go back to running stage_b CFFI test with usual pytest -n1 - Cleaned up unused files from the VNR module. - Change cmake command to disable fetch contents update. This is done mostly so I can remember the option to add when annoying update failures due to previously patched tflite_micro show up. --- Jenkinsfile | 9 +- .../api/inference/vnr_inference_state.h | 4 - .../xformer/convert_tflite_to_c_source.py | 120 ------------------ .../python/utils/xformer/requirements.txt | 1 - .../templates/model_data_header.jinja2 | 10 -- .../templates/model_data_source.jinja2 | 12 -- .../templates/model_runner_header.jinja2 | 28 ---- .../templates/model_runner_source.jinja2 | 81 ------------ .../python/utils/xformer/xform_model.py | 2 + .../inference/model/trained_model_xcore.cpp | 2 +- .../inference/model/trained_model_xcore.cpp.h | 2 +- .../inference/model/vnr_tensor_arena_size.h | 8 -- .../src/inference/vnr_inference_priv.h | 1 - 13 files changed, 8 insertions(+), 272 deletions(-) delete mode 100644 modules/lib_vnr/api/inference/vnr_inference_state.h delete mode 100755 modules/lib_vnr/python/utils/xformer/convert_tflite_to_c_source.py delete mode 100644 modules/lib_vnr/python/utils/xformer/templates/model_data_header.jinja2 delete mode 100644 modules/lib_vnr/python/utils/xformer/templates/model_data_source.jinja2 delete mode 100644 modules/lib_vnr/python/utils/xformer/templates/model_runner_header.jinja2 delete mode 100644 modules/lib_vnr/python/utils/xformer/templates/model_runner_source.jinja2 delete mode 100644 modules/lib_vnr/src/inference/model/vnr_tensor_arena_size.h diff --git a/Jenkinsfile b/Jenkinsfile index 86b930610..8eadbc4d3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -59,10 +59,10 @@ pipeline { withVenv { script { if (env.FULL_TEST == "1") { - sh 'cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -DPython3_VIRTUALENV_FIND="ONLY" -DFWK_VOICE_BUILD_TESTS=ON' + sh 'cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -DPython3_VIRTUALENV_FIND="ONLY" -DFWK_VOICE_BUILD_TESTS=ON -DFETCHCONTENT_UPDATES_DISCONNECTED=ON' } else { - sh 'cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -DPython3_VIRTUALENV_FIND="ONLY" -DTEST_SPEEDUP_FACTOR=4 -DFWK_VOICE_BUILD_TESTS=ON' + sh 'cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -DPython3_VIRTUALENV_FIND="ONLY" -DTEST_SPEEDUP_FACTOR=4 -DFWK_VOICE_BUILD_TESTS=ON -DFETCHCONTENT_UPDATES_DISCONNECTED=ON' } } sh "make -j8" @@ -114,7 +114,7 @@ pipeline { viewEnv() { withVenv { sh "cmake --version" - sh 'cmake -S.. -DPython3_FIND_VIRTUALENV="ONLY" -DTEST_WAV_ADEC_BUILD_CONFIG="1 2 2 10 5" -DFWK_VOICE_BUILD_TESTS=ON' + sh 'cmake -S.. -DPython3_FIND_VIRTUALENV="ONLY" -DTEST_WAV_ADEC_BUILD_CONFIG="1 2 2 10 5" -DFWK_VOICE_BUILD_TESTS=ON -DFETCHCONTENT_UPDATES_DISCONNECTED=ON' sh "make -j8" // We need to put this here because it is not fetched until we build @@ -422,8 +422,7 @@ pipeline { withVenv { withMounts([["projects", "projects/hydra_audio", "hydra_audio_stage_b_tests"]]) { withEnv(["hydra_audio_PATH=$hydra_audio_stage_b_tests_PATH"]) { - sh "pytest -k test_frame_compare" - sh "pytest -k test_adaption_controller" + sh "pytest -n1" } } } diff --git a/modules/lib_vnr/api/inference/vnr_inference_state.h b/modules/lib_vnr/api/inference/vnr_inference_state.h deleted file mode 100644 index a798e11fa..000000000 --- a/modules/lib_vnr/api/inference/vnr_inference_state.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __VNR_INFERENCE_STATE_H__ -#define __VNR_INFERENCE_STATE_H__ - -#endif diff --git a/modules/lib_vnr/python/utils/xformer/convert_tflite_to_c_source.py b/modules/lib_vnr/python/utils/xformer/convert_tflite_to_c_source.py deleted file mode 100755 index 26045b571..000000000 --- a/modules/lib_vnr/python/utils/xformer/convert_tflite_to_c_source.py +++ /dev/null @@ -1,120 +0,0 @@ -#!/usr/bin/env python -# Copyright 2021 XMOS LIMITED. -# This Software is subject to the terms of the XMOS Public Licence: Version 1. - -from __future__ import print_function - -import sys -import argparse -from pathlib import Path - -import jinja2 - - -def get_template(filename): - jinja_env = jinja2.Environment( - loader=jinja2.FileSystemLoader( - searchpath=str(Path(__file__).parent / "templates") - ) - ) - - return jinja_env.get_template(filename) - - -def convert_bytes_to_c_source(data, array_name, max_line_width, include_guard): - """Returns strings representing a C constant array containing `data`. - """ - - def data_to_array_values(data): - starting_pad = " " - array_lines = [] - array_line = starting_pad - for value in bytearray(data): - if (len(array_line) + 4) > max_line_width: - array_lines.append(array_line + "\n") - array_line = starting_pad - array_line += " 0x%02x," % (value) - if len(array_line) > len(starting_pad): - array_lines.append(array_line + "\n") - return "".join(array_lines) - - source_template = get_template("model_data_source.jinja2") - source_text = source_template.render( - { - "array_name": array_name, - "array_length": len(data), - "array_values": data_to_array_values(data), - } - ) - - header_template = get_template("model_data_header.jinja2") - header_text = header_template.render( - { - "include_guard": include_guard, - "array_name": array_name, - "array_length": len(data), - } - ) - - return source_text, header_text - - -if __name__ == "__main__": - parser = argparse.ArgumentParser( - description=( - "Command line tool to convert .tflite file to C source code files." - ) - ) - - parser.add_argument( - "--input", - help="Full filepath of the input TensorFlow Lite file.", - required=True, - ) - - parser.add_argument( - "--variable-name", help="Name to use for the C data array variable.", - ) - - parser.add_argument( - "--source", help="Full filepath of the output C source file.", - ) - - parser.add_argument( - "--header", help="Full filepath of the output C header file.", - ) - - parser.add_argument( - "--include-guard", help="Name to use for the C header include guard." - ) - - parser.add_argument( - "--line-width", type=int, help="Width to use for formatting.", default=80 - ) - - args = parser.parse_args() - - # setup defaults - variable_name = args.variable_name or "tflite_model" - source_file = args.source or "{variable_name}.c".format(variable_name=variable_name) - header_file = args.header or "{variable_name}.h".format(variable_name=variable_name) - include_guard = ( - args.include_guard - or "{variable_name}_H_".format(variable_name=variable_name).upper() - ) - - with open(args.input, "rb") as input_fd: - input_data = input_fd.read() - - source, header = convert_bytes_to_c_source( - data=input_data, - array_name=variable_name, - max_line_width=args.line_width, - include_guard=include_guard, - ) - - with open(source_file, "w") as source_fd: - source_fd.write(source) - - with open(args.header, "w") as header_fd: - header_fd.write(header) diff --git a/modules/lib_vnr/python/utils/xformer/requirements.txt b/modules/lib_vnr/python/utils/xformer/requirements.txt index 749d1b12d..18a1b8269 100644 --- a/modules/lib_vnr/python/utils/xformer/requirements.txt +++ b/modules/lib_vnr/python/utils/xformer/requirements.txt @@ -1,5 +1,4 @@ xmos-ai-tools==0.1.8 -jinja2 tensorflow==2.8.0; platform_machine != 'arm64' tensorflow-macos==2.9.0; sys_platform == 'darwin' and platform_machine == 'arm64' protobuf==3.20.1 # https://github.com/protocolbuffers/protobuf/issues/10051 diff --git a/modules/lib_vnr/python/utils/xformer/templates/model_data_header.jinja2 b/modules/lib_vnr/python/utils/xformer/templates/model_data_header.jinja2 deleted file mode 100644 index 17bf57ae2..000000000 --- a/modules/lib_vnr/python/utils/xformer/templates/model_data_header.jinja2 +++ /dev/null @@ -1,10 +0,0 @@ -// This is a TensorFlow Lite model file that has been converted into a C data -// array using the convert_tflite_to_c_source() tool. - -#ifndef {{include_guard}} -#define {{include_guard}} - -extern const unsigned char {{array_name}}_model_data[]; -extern const int {{array_name}}_model_data_len; - -#endif // {{include_guard}} diff --git a/modules/lib_vnr/python/utils/xformer/templates/model_data_source.jinja2 b/modules/lib_vnr/python/utils/xformer/templates/model_data_source.jinja2 deleted file mode 100644 index 08801f319..000000000 --- a/modules/lib_vnr/python/utils/xformer/templates/model_data_source.jinja2 +++ /dev/null @@ -1,12 +0,0 @@ -// This is a TensorFlow Lite model file that has been converted into a C data -// array using the convert_tflite_to_c_source() tool. - -#if( USE_SWMEM == 1) -__attribute__((section(".SwMem_data"))) -#elif( USE_EXTMEM == 1) -__attribute__((section(".ExtMem_data"))) -#endif -const unsigned char {{array_name}}_model_data[] __attribute__((aligned(4))) = { -{{array_values}}}; - -const int {{array_name}}_model_data_len = {{array_length}}; diff --git a/modules/lib_vnr/python/utils/xformer/templates/model_runner_header.jinja2 b/modules/lib_vnr/python/utils/xformer/templates/model_runner_header.jinja2 deleted file mode 100644 index f6c9e45e4..000000000 --- a/modules/lib_vnr/python/utils/xformer/templates/model_runner_header.jinja2 +++ /dev/null @@ -1,28 +0,0 @@ -// This is a TensorFlow Lite model runner interface that has been -// generated using the generate_model_runner tool. - -#ifndef {{include_guard}} -#define {{include_guard}} - -#include "model_runner.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Create a {{name}} model runner. - * - * @param[out] ctx Model runner context - * @param[in] buffer Buffer for interpreter. If NULL, will be allocated with - * malloc. The caller is responsible for freeing the memory - * if needed. To determine the size at run time call: - * - * size_t size = model_runner_buffer_size_get(); - */ -void {{name}}_model_runner_create(model_runner_t *ctx, void *buffer); - -#ifdef __cplusplus -}; -#endif - -#endif // {{include_guard}} diff --git a/modules/lib_vnr/python/utils/xformer/templates/model_runner_source.jinja2 b/modules/lib_vnr/python/utils/xformer/templates/model_runner_source.jinja2 deleted file mode 100644 index 621b3406a..000000000 --- a/modules/lib_vnr/python/utils/xformer/templates/model_runner_source.jinja2 +++ /dev/null @@ -1,81 +0,0 @@ -// This is a TensorFlow Lite model runner interface that has been -// generated using the generate_model_runner tool. - -#include "{{header_file}}" - -#include "model_runner_profiler.h" -#include "tensorflow/lite/micro/kernels/xcore/xcore_interpreter.h" -#include "tensorflow/lite/micro/kernels/xcore/xcore_ops.h" - -typedef tflite::MicroMutableOpResolver<{{builtin_operators|length + custom_operators|length}}> resolver_t; -typedef xcore::ModelRunnerProfiler<{{layer_count}}> profiler_t; - -static resolver_t resolver_s; -static resolver_t *resolver = nullptr; - -static profiler_t *profiler = nullptr; - -__attribute__((fptrgroup("model_runner_resolver_get_fptr_grp"))) -void {{name}}_resolver_get(void **v_resolver) -{ - // Set up op resolver - // This pulls in all the operation implementations we need. - if (resolver == nullptr) { - resolver = &resolver_s; - {%- for builtin_operator in builtin_operators %} - resolver->Add{{builtin_operator}}(); - {%- endfor %} - {%- for custom_operator in custom_operators %} - resolver->AddCustom(tflite::ops::micro::xcore::{{custom_operator[0]}}, tflite::ops::micro::xcore::{{custom_operator[1]}}()); - {%- endfor %} - {%- for unknown_operator in unknown_operators %} - // Unable to generate registration code for {{unknown_operator}} - {%- endfor %} - } - - *v_resolver = static_cast(resolver); -} - -#ifndef NDEBUG - -__attribute__((fptrgroup("model_runner_profiler_get_fptr_grp"))) -void {{name}}_profiler_get(void **v_profiler) { - if (profiler == nullptr) { - // Set up profiling - static profiler_t profiler_s; - - profiler = &profiler_s; - } - - *v_profiler = static_cast(profiler); -} - -__attribute__((fptrgroup("model_runner_profiler_reset_fptr_grp"))) -void {{name}}_profiler_reset() { - if (profiler) { - profiler->ClearEvents(); - } -} - -__attribute__((fptrgroup("model_runner_profiler_durations_get_fptr_grp"))) -void {{name}}_profiler_durations_get(uint32_t *count, const uint32_t **durations) { - if (profiler) { - *count = profiler->GetNumEvents(); - *durations = profiler->GetEventDurations(); - } -} - -#endif - -//******************************** -// Create a {{name}} model runner. -//******************************** -void {{name}}_model_runner_create(model_runner_t *ctx, void *buffer) { - ctx->hInterpreter = buffer; // NOTE: buffer can be NULL - ctx->resolver_get_fun = &{{name}}_resolver_get; -#ifndef NDEBUG - ctx->profiler_get_fun = &{{name}}_profiler_get; - ctx->profiler_reset_fun = &{{name}}_profiler_reset; - ctx->profiler_durations_get_fun = &{{name}}_profiler_durations_get; -#endif -} diff --git a/modules/lib_vnr/python/utils/xformer/xform_model.py b/modules/lib_vnr/python/utils/xformer/xform_model.py index 569e15bf3..dfaae27e7 100644 --- a/modules/lib_vnr/python/utils/xformer/xform_model.py +++ b/modules/lib_vnr/python/utils/xformer/xform_model.py @@ -74,6 +74,8 @@ def get_quant_spec(model): os.chdir(save_dir) # Create Quant dequant spec defines file + str_index = os.path.realpath(__file__).find('fwk_voice/') + assert(str_index != -1) input_scale, input_zero_point, output_scale, output_zero_point = get_quant_spec(model) print(f"input_scale {input_scale}, input_zero_point {input_zero_point}, output_scale {output_scale}, output_zero_point {output_zero_point}") with open(os.path.join(test_dir, "vnr_quant_spec_defines.h"), "w") as fp: diff --git a/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp index 525d5dcac..168052cc1 100644 --- a/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp +++ b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp @@ -1,5 +1,5 @@ // This file is generated. Do not edit. -// Generated on: 22.09.2022 12:40:23 +// Generated on: 23.09.2022 11:48:04 #include "../../api/xcore_config.h" diff --git a/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h index adf385282..ddd166001 100644 --- a/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h +++ b/modules/lib_vnr/src/inference/model/trained_model_xcore.cpp.h @@ -1,5 +1,5 @@ // This file is generated. Do not edit. -// Generated on: 22.09.2022 12:40:23 +// Generated on: 23.09.2022 11:48:04 #ifndef model_GEN_H #define model_GEN_H diff --git a/modules/lib_vnr/src/inference/model/vnr_tensor_arena_size.h b/modules/lib_vnr/src/inference/model/vnr_tensor_arena_size.h deleted file mode 100644 index 1063f55e5..000000000 --- a/modules/lib_vnr/src/inference/model/vnr_tensor_arena_size.h +++ /dev/null @@ -1,8 +0,0 @@ -// Autogenerated from fwk_voice/modules/lib_vnr/python/utils/xformer/xform_model.py. Do not modify -// Generated using xmos-ai-tools version 0.1.8 -#ifndef VNR_TENSOR_ARENA_SIZE_H -#define VNR_TENSOR_ARENA_SIZE_H - -#define TENSOR_ARENA_SIZE_BYTES (19928 - 11304) // Remove model size from the tensor_arena_size returned by the python xcore_tflm_host_interpreter - -#endif \ No newline at end of file diff --git a/modules/lib_vnr/src/inference/vnr_inference_priv.h b/modules/lib_vnr/src/inference/vnr_inference_priv.h index f5fadeb89..4a90dd7c2 100644 --- a/modules/lib_vnr/src/inference/vnr_inference_priv.h +++ b/modules/lib_vnr/src/inference/vnr_inference_priv.h @@ -1,7 +1,6 @@ #ifndef __VNR_INFERENCE_PRIV_H__ #define __VNR_INFERENCE_PRIV_H__ -#include "model/vnr_tensor_arena_size.h" #include "bfp_math.h" /** Quantisation spec used to quantise the VNR input features and dequantise the VNR output according to the specification for TensorFlow Lite's 8-bit quantization scheme From 57f517c3f2603a17c272fb5ea7b50439eb37fbbe Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 12:24:56 +0100 Subject: [PATCH 26/65] Bring back cleanWs() stage in Jenkins. Removed xtflm_conf.h --- Jenkinsfile | 6 +++--- modules/lib_vnr/api/inference/xtflm_conf.h | 18 ------------------ 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 modules/lib_vnr/api/inference/xtflm_conf.h diff --git a/Jenkinsfile b/Jenkinsfile index 8eadbc4d3..91b4b4a0d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -647,9 +647,9 @@ pipeline { archiveArtifacts artifacts: "${REPO}/test/pipeline/keyword_input_*/*.wav", fingerprint: true archiveArtifacts artifacts: "${REPO}/test/pipeline/keyword_input_*/*.npy", fingerprint: true, allowEmptyArchive: true } - //cleanup { - // cleanWs() - //} + cleanup { + cleanWs() + } } }// stage xcore.ai Verification stage('Update view files') { diff --git a/modules/lib_vnr/api/inference/xtflm_conf.h b/modules/lib_vnr/api/inference/xtflm_conf.h deleted file mode 100644 index ef5fabdef..000000000 --- a/modules/lib_vnr/api/inference/xtflm_conf.h +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2020-2021 XMOS LIMITED. -// This Software is subject to the terms of the XMOS Public Licence: Version 1. - -#ifndef XTFLM_CONF_h_ -#define XTFLM_CONF_h_ - -// The currenly used model lib_vnr/python/model/model_output/model_qaware_xcore.tflite uses 4 operators; AddConv2D, Reshape, Logistic and Conv2D_V2_OpCode -// When adding a new model, open the tflite file in netron.app, check the number of operators and change XTFLM_OPERATORS if needed -#define XTFLM_OPERATORS (4) - -#define NUM_OUTPUT_TENSORS (1) -#define NUM_INPUT_TENSORS (1) - -#define NETWORK_NUM_THREADS (1) -#define AISRV_GPIO_LENGTH (4) -#define MAX_DEBUG_LOG_LENGTH (256) - -#endif // XTFLM_CONF_h_ From ce94eb4a01a8c0d117853b41777a9c89b679044f Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 12:47:39 +0100 Subject: [PATCH 27/65] Documentation updates --- .../lib_vnr/python/utils/xformer/README.rst | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/modules/lib_vnr/python/utils/xformer/README.rst b/modules/lib_vnr/python/utils/xformer/README.rst index bb4932760..cb4778393 100644 --- a/modules/lib_vnr/python/utils/xformer/README.rst +++ b/modules/lib_vnr/python/utils/xformer/README.rst @@ -6,17 +6,13 @@ This document describes the process for integrating a TensorFlow Lite model into 1. Use the xformer to optimise the model for XCORE architecture. -2. Generate C source files `vnr_model_data.c `_ and `vnr_model_data.h `_ that contains the optimised model as a char array. +2. Run the tflite_micro_compiler on the XCORE optimised model to generate the compiled .cpp and .h files that can be integrated in the VNR module. -3. Update the tensor arena scratch memory requirement for the new model in `vnr_tensor_arena_size.h `_. +3. Update the TensorFlow Lite 8-bit quantization spec for the new model in `vnr_quant_spec_defines.h `_. -4. Update the TensorFlow Lite 8-bit quantization spec for the new model in `vnr_quant_spec_defines.h `_. +The `xform_model.py `_ script automates the above steps. It creates the files mentioned in steps 1-3 above and copies them to the VNR module directory. In addition to that, it also lists down the steps that the user is expected to do manually post running this script. +These steps include things making sure any old model files if present are deleted and the new files are added to git and all changes are committed. The script does provide a list of files that need removing and adding to git before committing to make this manual step easier. -5. Call lib_tflite_micro functions to register all required operators with the lib_tflite_micro MicroOpResolver. - -6. Update defines in `xtflm_conf.h `_ - -The `xform_model.py `_ script automates the first 4 steps. It creates the files mentioned in steps 1-4 above and copies them to the VNR module directory. Ensure you have installed Python 3 and the python requirements listed in `requirements.txt `_ in order to run the script. To use the script, run, .. code-block:: console @@ -31,18 +27,8 @@ For example, to run it for the existing model that we have, run, $ python xform_model.py fwk_voice/modules/lib_vnr/python/model/model_output/trained_model.tflite --copy-files --module-path=fwk_voice/modules/lib_vnr/src/inference/model/ -For step number 5. and 6., - -- Open the optimised model TensorFlow Lite file in netron.app and check the number and types of operators. Also check the number of input and output tensors. For example, the current optimised model `model_qaware_xcore.tflite `_ uses 1 input and output tensor each and 4 operators; ``Conv2D``, ``Reshape``, ``Logistic`` and ``XC_conv2d_v2``. - -- Add resolver->Addxxx functions in `vnr_inference.cc `_, ``vnr_inference_init()`` to add all the operators to the TFLite operator resolver. - -- In `xtflm_conf.h `_, update XTFLM_OPERATORS to indicate the correct number of operators. - -- In `xtflm_conf.h `_, update NUM_OUTPUT_TENSORS and NUM_INPUT_TENSORS to indicate the correct numbers to input and output operators. - -The process described above only generates optimised model to run on a single core. +The process described above only generates an optimised model that would run on a single core. Also worth mentioning is, since the feature extraction code is fixed and compiled as part of the VNR module, any new models replacing the existing one should have the same set of input features, input and output size and data types as the existing model. From 473437a73f526fbc95a56c04172e6f3a730994ac Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 13:05:17 +0100 Subject: [PATCH 28/65] Update the quick start guide to mention FETCHCONTENT_UPDATES_DISCONNECTED option for cmake --- doc/getting_started.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/getting_started.rst b/doc/getting_started.rst index 12ae22624..31c9ff01f 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -45,6 +45,9 @@ procedure is currently supported on MacOS and Linux only. # make sure you have the patch command available cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake +As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors +related to not being able to apply a patch to an already patched library. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. + 4. Running make will then build the Voice Framework libraries and example applications .. tab:: Linux and Mac From 3553b693e956a8d67a74b70e868aa3cf55d52c6d Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 13:28:45 +0100 Subject: [PATCH 29/65] typo --- doc/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/getting_started.rst b/doc/getting_started.rst index 31c9ff01f..e05968b3a 100644 --- a/doc/getting_started.rst +++ b/doc/getting_started.rst @@ -46,7 +46,7 @@ procedure is currently supported on MacOS and Linux only. cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors -related to not being able to apply a patch to an already patched library. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. +related to not being able to apply a patch to an already patched library are seen. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. 4. Running make will then build the Voice Framework libraries and example applications From 59d8b9b3b83f8de27d59d8785a0835fd16d7ce22 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Fri, 23 Sep 2022 14:07:42 +0100 Subject: [PATCH 30/65] Removed __xtflm_conf_h_exists__=1 compile option for tflite_micro --- .../shared_src/external_deps/inference/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt index d20566e32..80e6680af 100644 --- a/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/inference/CMakeLists.txt @@ -52,7 +52,6 @@ target_compile_definitions(xcore_sdk_inferencing_lib_tflite_micro INTERFACE NO_INTERPRETER TF_LITE_STATIC_MEMORY=1 - TF_LITE_STRIP_ERROR_STRINGS - __xtflm_conf_h_exists__=1) + TF_LITE_STRIP_ERROR_STRINGS) add_library(sdk::inferencing::lib_tflite_micro ALIAS xcore_sdk_inferencing_lib_tflite_micro) From 72dddb41de2f852e3729135fd4f5762894d363ae Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 10:16:28 -0400 Subject: [PATCH 31/65] updated to lib_xcore_math v2.1.0 --- .../bare-metal/aec_1_thread/CMakeLists.txt | 2 +- examples/bare-metal/agc/CMakeLists.txt | 2 +- .../pipeline_multi_threaded/CMakeLists.txt | 2 +- .../pipeline_single_threaded/CMakeLists.txt | 2 +- examples/bare-metal/shared_src/CMakeLists.txt | 2 +- .../shared_src/external_deps/CMakeLists.txt | 2 +- .../shared_src/external_deps/fetch_deps.cmake | 10 +-- .../lib_xcore_math/CMakeLists.txt | 3 + .../external_deps/lib_xs3_math/CMakeLists.txt | 78 ------------------- modules/lib_adec/CMakeLists.txt | 2 +- modules/lib_adec/api/adec_state.h | 13 ++-- modules/lib_adec/src/adec_impl.c | 14 ++-- modules/lib_adec/src/adec_priv.h | 12 +-- modules/lib_adec/src/adec_priv_impl.c | 20 ++--- modules/lib_aec/CMakeLists.txt | 2 +- modules/lib_aec/api/aec_api.h | 3 +- modules/lib_aec/api/aec_state.h | 6 +- modules/lib_aec/src/aec_priv.h | 3 +- modules/lib_aec/src/aec_priv_impl.c | 72 ++++++++--------- modules/lib_agc/CMakeLists.txt | 2 +- modules/lib_agc/api/agc_api.h | 2 +- modules/lib_agc/api/agc_profiles.h | 2 +- modules/lib_agc/src/agc_defines.h | 2 +- modules/lib_agc/src/agc_impl.c | 20 ++--- modules/lib_ic/CMakeLists.txt | 2 +- modules/lib_ic/api/ic_defines.h | 2 +- modules/lib_ic/api/ic_state.h | 6 +- modules/lib_ic/src/ic.c | 24 +++--- modules/lib_ic/src/ic_low_level.c | 10 +-- modules/lib_ic/src/ic_low_level.h | 2 +- modules/lib_ns/CMakeLists.txt | 2 +- modules/lib_ns/api/ns_state.h | 2 +- modules/lib_ns/src/ns_impl.c | 16 ++-- modules/lib_ns/src/ns_low_level.c | 2 +- modules/lib_ns/src/ns_priv.h | 2 +- modules/lib_vnr/CMakeLists.txt | 4 +- .../lib_vnr/api/features/vnr_features_state.h | 5 +- .../lib_vnr/api/inference/vnr_inference_api.h | 2 +- .../python/utils/mel/gen_mel_filters.py | 2 +- .../src/features/mel_filter_512_24_compact.h | 4 +- modules/lib_vnr/src/features/vnr_features.c | 2 +- .../lib_vnr/src/features/vnr_features_priv.c | 14 ++-- .../lib_vnr/src/features/vnr_features_priv.h | 10 +-- .../src/inference/vnr_inference_priv.cc | 9 ++- .../src/inference/vnr_inference_priv.h | 2 +- test/lib_ic/test_bad_state/CMakeLists.txt | 2 +- test/lib_ic/test_calc_vnr_pred/CMakeLists.txt | 2 +- .../feature_extraction/CMakeLists.txt | 2 +- .../test_vnr_priv_make_slice.py | 2 +- .../vnr_unit_tests/full/CMakeLists.txt | 2 +- .../vnr_unit_tests/inference/CMakeLists.txt | 2 +- test/test_hpf/CMakeLists.txt | 2 +- 52 files changed, 170 insertions(+), 246 deletions(-) create mode 100644 examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt delete mode 100644 examples/bare-metal/shared_src/external_deps/lib_xs3_math/CMakeLists.txt diff --git a/examples/bare-metal/aec_1_thread/CMakeLists.txt b/examples/bare-metal/aec_1_thread/CMakeLists.txt index e2bf2a81c..7f796c317 100644 --- a/examples/bare-metal/aec_1_thread/CMakeLists.txt +++ b/examples/bare-metal/aec_1_thread/CMakeLists.txt @@ -16,7 +16,7 @@ target_include_directories(fwk_voice_example_bare_metal_aec_1_thread target_link_libraries(fwk_voice_example_bare_metal_aec_1_thread PUBLIC fwk_voice::example::aec1thread - core::xs3_math + lib_xcore_math fwk_voice::example::fileutils ) diff --git a/examples/bare-metal/agc/CMakeLists.txt b/examples/bare-metal/agc/CMakeLists.txt index ed6be3c36..8013fd560 100644 --- a/examples/bare-metal/agc/CMakeLists.txt +++ b/examples/bare-metal/agc/CMakeLists.txt @@ -13,7 +13,7 @@ target_include_directories(fwk_voice_example_bare_metal_agc target_link_libraries(fwk_voice_example_bare_metal_agc PUBLIC fwk_voice::agc - core::xs3_math + lib_xcore_math fwk_voice::example::fileutils) if(${CMAKE_SYSTEM_NAME} STREQUAL XCORE_XS3A) diff --git a/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt b/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt index 2d13dc311..ea2097dcd 100644 --- a/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt +++ b/examples/bare-metal/pipeline_multi_threaded/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries(fwk_voice_example_pipeline_multi_thread_interface fwk_voice::example::delay_buffer fwk_voice::example::stage_1 fwk_voice::example::fileutils - core::xs3_math + lib_xcore_math ) target_compile_definitions(fwk_voice_example_pipeline_multi_thread_interface diff --git a/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt b/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt index f0c24320e..ec62bc8a6 100644 --- a/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt +++ b/examples/bare-metal/pipeline_single_threaded/CMakeLists.txt @@ -22,7 +22,7 @@ target_link_libraries(fwk_voice_example_pipeline_single_thread_interface fwk_voice::example::delay_buffer fwk_voice::example::stage_1 fwk_voice::example::fileutils - core::xs3_math + lib_xcore_math ) target_compile_definitions(fwk_voice_example_pipeline_single_thread_interface diff --git a/examples/bare-metal/shared_src/CMakeLists.txt b/examples/bare-metal/shared_src/CMakeLists.txt index 0097431fd..57cc4c2d0 100644 --- a/examples/bare-metal/shared_src/CMakeLists.txt +++ b/examples/bare-metal/shared_src/CMakeLists.txt @@ -102,7 +102,7 @@ target_include_directories(fwk_voice_example_shared_src_hpf ) target_link_libraries(fwk_voice_example_shared_src_hpf INTERFACE - core::xs3_math + lib_xcore_math ) add_library(fwk_voice::example::hpf ALIAS fwk_voice_example_shared_src_hpf) diff --git a/examples/bare-metal/shared_src/external_deps/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/CMakeLists.txt index eeb322146..64fe79530 100644 --- a/examples/bare-metal/shared_src/external_deps/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/CMakeLists.txt @@ -1,4 +1,4 @@ include(fetch_deps.cmake) -add_subdirectory(lib_xs3_math) +add_subdirectory(lib_xcore_math) add_subdirectory(xscope_fileio) add_subdirectory(inference) diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index ca1727270..151ef4bf1 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -2,13 +2,13 @@ include(FetchContent) FetchContent_Declare( - xs3_math - GIT_REPOSITORY https://github.com/xmos/lib_xs3_math.git - GIT_TAG 881cf848a5899f4ecb9182e7f50fd3705e5b68ef + xcore_math + GIT_REPOSITORY https://github.com/xmos/lib_xcore_math.git + GIT_TAG v2.1.0 GIT_SHALLOW FALSE - SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_xs3_math + SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_xcore_math ) -FetchContent_Populate(xs3_math) +FetchContent_Populate(xcore_math) FetchContent_Declare( xscope_fileio diff --git a/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt new file mode 100644 index 000000000..1069df38d --- /dev/null +++ b/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt @@ -0,0 +1,3 @@ +set(XCORE_MATH_PATH ${CMAKE_BINARY_DIR}/fwk_voice_deps) + +add_subdirectory(${XCORE_MATH_PATH}/lib_xcore_math/lib_xcore_math ${XCORE_MATH_PATH}/build) diff --git a/examples/bare-metal/shared_src/external_deps/lib_xs3_math/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/lib_xs3_math/CMakeLists.txt deleted file mode 100644 index 23d1f10a5..000000000 --- a/examples/bare-metal/shared_src/external_deps/lib_xs3_math/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ - -set(XS3_MATH_PATH ${CMAKE_BINARY_DIR}/fwk_voice_deps) -## Source files -file(GLOB_RECURSE LIB_C_SOURCES - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/bfp/*.c - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/vect/*.c - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/scalar/*.c -) -file(GLOB_RECURSE LIB_CXX_SOURCES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/*.cc) -file(GLOB_RECURSE LIB_XC_SOURCES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/*.xc) -file(GLOB_RECURSE LIB_ASM_SOURCES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/*.S ) -list(APPEND LIB_C_SOURCES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/etc/xs3_fft_lut/xs3_fft_lut.c) - -## cmake doesn't recognize .S files as assembly by default -set_source_files_properties(LIB_ASM_SOURCES PROPERTIES LANGUAGE ASM) - -## Assume all asm is XS3A for now -set(XCORE_XS3A_SOURCES ${LIB_ASM_SOURCES}) -list(APPEND XCORE_XS3A_SOURCES ${LIB_XC_SOURCES}) - -## Set any local library compile options -set(LIB_COMPILE_FLAGS "-Os" "-g") -if(PROJECT_IS_TOP_LEVEL) - if(NOT CMAKE_SYSTEM_NAME STREQUAL XCORE_XS3A) - ## Needed for CFFI tests - list(APPEND LIB_COMPILE_FLAGS "-fPIC") - endif() -endif() - -## Includes files -set(LIB_PUBLIC_INCLUDES - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/api - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/api/bfp - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/api/scalar - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/api/vect - ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/etc/xs3_fft_lut -) -set(LIB_PRIVATE_INCLUDES lib_xs3_math/lib_xs3_math/src) - -## Gather library sources -set(LIB_PUBLIC_SOURCES "") -set(LIB_PRIVATE_SOURCES ${LIB_C_SOURCES} ${LIB_CXX_SOURCES}) - -## Append platform specific sources -if(CMAKE_SYSTEM_NAME STREQUAL XCORE_XS3A) - list(APPEND LIB_PRIVATE_SOURCES ${XCORE_XS3A_SOURCES}) - list(APPEND LIB_PUBLIC_INCLUDES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/arch/xcore) -else() - file(GLOB_RECURSE X86_SOURCES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/arch/ref/*.c) - list(APPEND LIB_PRIVATE_SOURCES ${X86_SOURCES}) - list(APPEND LIB_PUBLIC_INCLUDES ${XS3_MATH_PATH}/lib_xs3_math/lib_xs3_math/src/arch/ref) -endif() - -## Create library target -add_library(fwk_voice_deps_lib_xs3_math STATIC) -target_sources(fwk_voice_deps_lib_xs3_math - PUBLIC - ${LIB_PUBLIC_SOURCES} - PRIVATE - ${LIB_PRIVATE_SOURCES} -) -target_include_directories(fwk_voice_deps_lib_xs3_math - PUBLIC - ${LIB_PUBLIC_INCLUDES} - PRIVATE - ${LIB_PRIVATE_INCLUDES} -) -target_compile_options(fwk_voice_deps_lib_xs3_math - PRIVATE - ${LIB_COMPILE_FLAGS} -) -#target_link_libraries(fwk_voice_deps_lib_xs3_math -# PUBLIC -# sdk::legacy_compat -#) - -## Create an alias -add_library(core::xs3_math ALIAS fwk_voice_deps_lib_xs3_math) diff --git a/modules/lib_adec/CMakeLists.txt b/modules/lib_adec/CMakeLists.txt index 4f253b8a9..eb06f1094 100644 --- a/modules/lib_adec/CMakeLists.txt +++ b/modules/lib_adec/CMakeLists.txt @@ -22,7 +22,7 @@ target_compile_options(fwk_voice_module_lib_adec target_link_libraries(fwk_voice_module_lib_adec PUBLIC - core::xs3_math + lib_xcore_math fwk_voice::aec ) diff --git a/modules/lib_adec/api/adec_state.h b/modules/lib_adec/api/adec_state.h index 670d6e278..aa8c28681 100644 --- a/modules/lib_adec/api/adec_state.h +++ b/modules/lib_adec/api/adec_state.h @@ -2,8 +2,7 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #ifndef __ADEC_TYPES_H__ #define __ADEC_TYPES_H__ -#include "bfp_math.h" -#include "xs3_math.h" +#include "xmath/xmath.h" #include "aec_defines.h" #include "adec_defines.h" @@ -127,11 +126,11 @@ typedef struct { float_s32_t peak_power_history[ADEC_PEAK_LINREG_HISTORY_SIZE]; ///< Last ADEC_PEAK_LINREG_HISTORY_SIZE frames peak phase power float_s32_t aec_peak_to_average_good_aec_threshold; ///< Threshold was considering peak to average ratio as good - fixed_s32_t agm_q24; ///< AEC goodness metric indicating a measure of how well AEC filter is performing - fixed_s32_t erle_bad_bits_q24; ///< log2 of threshold below which AEC output's measured ERLE is considered bad - fixed_s32_t erle_good_bits_q24; ///< log2 of threshold above which AEC output's measured ERLE is considered good - fixed_s32_t peak_phase_energy_trend_gain_q24; ///< Multiplier used for scaling agm's sensitivity to peak phase energy trend - fixed_s32_t erle_bad_gain_q24; ///< Multiplier determining how steeply we reduce aec's goodness when measured erle falls below the bad erle threshold + q8_24 agm_q24; ///< AEC goodness metric indicating a measure of how well AEC filter is performing + q8_24 erle_bad_bits_q24; ///< log2 of threshold below which AEC output's measured ERLE is considered bad + q8_24 erle_good_bits_q24; ///< log2 of threshold above which AEC output's measured ERLE is considered good + q8_24 peak_phase_energy_trend_gain_q24; ///< Multiplier used for scaling agm's sensitivity to peak phase energy trend + q8_24 erle_bad_gain_q24; ///< Multiplier determining how steeply we reduce aec's goodness when measured erle falls below the bad erle threshold adec_mode_t mode; ///< ADEC's mode of operation. Can be operating in normal AEC or delay estimation mode int32_t peak_to_average_ratio_valid_flag; diff --git a/modules/lib_adec/src/adec_impl.c b/modules/lib_adec/src/adec_impl.c index 8c9296259..bc556ff2d 100644 --- a/modules/lib_adec/src/adec_impl.c +++ b/modules/lib_adec/src/adec_impl.c @@ -18,7 +18,7 @@ void adec_init(adec_state_t *adec_state, adec_config_t *config){ adec_state->erle_bad_gain_q24 = FLOAT_TO_Q24(ADEC_ERLE_BAD_GAIN); adec_state->peak_to_average_ratio_valid_flag = 0; - adec_state->max_peak_to_average_ratio_since_reset = double_to_float_s32(1.0); + adec_state->max_peak_to_average_ratio_since_reset = f64_to_float_s32(1.0); float_s32_t v = ADEC_PEAK_TO_AVERAGE_GOOD_AEC; adec_state->aec_peak_to_average_good_aec_threshold = v; @@ -28,7 +28,7 @@ void adec_init(adec_state_t *adec_state, adec_config_t *config){ adec_state->last_measured_delay = 0; for (int i = 0; i < ADEC_PEAK_LINREG_HISTORY_SIZE; i++){ - adec_state->peak_power_history[i] = double_to_float_s32(0.0); + adec_state->peak_power_history[i] = f64_to_float_s32(0.0); } adec_state->peak_power_history_idx = 0; adec_state->peak_power_history_valid = 0; @@ -80,12 +80,12 @@ void adec_process_frame( } state->peak_to_average_ratio_history[0] = adec_in->from_de.peak_to_average_ratio; - float_s32_t last_n_total = double_to_float_s32(0.0); + float_s32_t last_n_total = f64_to_float_s32(0.0); for(int i = 0; i < ADEC_PEAK_TO_AVERAGE_HISTORY_DEPTH; i++){ last_n_total = float_s32_add(last_n_total, state->peak_to_average_ratio_history[i]); } - float_s32_t penultimate_n_total = double_to_float_s32(0.0); + float_s32_t penultimate_n_total = f64_to_float_s32(0.0); for(int i = 1; i < ADEC_PEAK_TO_AVERAGE_HISTORY_DEPTH + 1; i++){ penultimate_n_total = float_s32_add(penultimate_n_total, state->peak_to_average_ratio_history[i]); } @@ -116,7 +116,7 @@ void adec_process_frame( get_decimated_peak_power_history(peak_power_decimated, state); float_s32_t decimate_ratio = {ADEC_PEAK_LINREG_DECIMATE_RATIO, 0}; float_s32_t decimate_norm_product = float_s32_mul(decimate_ratio, peak_power_decimated[ADEC_PEAK_LINREG_HISTORY_DECIMATED_SIZE - 1]); - float_s32_t peak_power_slope = double_to_float_s32(0.0); + float_s32_t peak_power_slope = f64_to_float_s32(0.0); // Only calculate slope from linear regression if the history is valid if (state->peak_power_history_valid){ peak_power_slope= linear_regression_get_slope(peak_power_decimated, ADEC_PEAK_LINREG_HISTORY_DECIMATED_SIZE, decimate_norm_product); @@ -129,10 +129,10 @@ void adec_process_frame( erle_ratio = float_s32_div(adec_in->from_aec.y_ema_energy_ch0, denom); } else { - erle_ratio = double_to_float_s32(1.0); + erle_ratio = f64_to_float_s32(1.0); } //printf("erle_ratio = %f\n",float_s32_to_float(erle_ratio)); - fixed_s32_t log2erle_q24 = float_to_frac_bits(erle_ratio); + q8_24 log2erle_q24 = float_to_frac_bits(erle_ratio); switch(state->mode){ case(ADEC_NORMAL_AEC_MODE): diff --git a/modules/lib_adec/src/adec_priv.h b/modules/lib_adec/src/adec_priv.h index 40ee4d85e..9f77b40eb 100644 --- a/modules/lib_adec/src/adec_priv.h +++ b/modules/lib_adec/src/adec_priv.h @@ -10,9 +10,9 @@ #define ADEC_ERLE_GOOD_BITS 2.0 //6dB #define ADEC_ERLE_BAD_GAIN 0.0625 //When ERLE goes below the threshold, how steep is the curve that reduces goodness #define ADEC_PEAK_PHASE_ENERGY_TREND_GAIN 3.0 //How sensitve we are to the peak phase energy trend, multiplier -#define ADEC_PEAK_TO_AVERAGE_GOOD_AEC float_to_float_s32(4.0)//Denormalised 4.0 - AEC only has 10 phases so pk:ave -#define ADEC_PEAK_TO_AVERAGE_GOOD_DE float_to_float_s32(8.0)//Denormalised 8.0 - With 30 phases, it's easier to get a strong pk -#define ADEC_PEAK_TO_AVERAGE_RUINED_AEC float_to_float_s32(2.0)//Denormalised 2.0 - Used with watchdog. +#define ADEC_PEAK_TO_AVERAGE_GOOD_AEC f32_to_float_s32(4.0)//Denormalised 4.0 - AEC only has 10 phases so pk:ave +#define ADEC_PEAK_TO_AVERAGE_GOOD_DE f32_to_float_s32(8.0)//Denormalised 8.0 - With 30 phases, it's easier to get a strong pk +#define ADEC_PEAK_TO_AVERAGE_RUINED_AEC f32_to_float_s32(2.0)//Denormalised 2.0 - Used with watchdog. #define ADEC_PK_AVE_POOR_WATCHDOG_SECONDS 30 //How long before we trigger DE mode if we haven't reached a good state after AEC reset @@ -38,7 +38,7 @@ #define Q24_FRAC_BITS 24 -#define FLOAT_TO_Q24(f) (fixed_s32_t)((float)f * (float)(1 << Q24_FRAC_BITS)) +#define FLOAT_TO_Q24(f) (q8_24)((float)f * (float)(1 << Q24_FRAC_BITS)) //Fast log2 defines #define LOG2_LOOKUP_TABLE_SIZE_BITS 8 @@ -58,10 +58,10 @@ void init_pk_ave_ratio_history(adec_state_t *adec_state); void reset_stuff_on_AEC_mode_start(adec_state_t *adec_state, unsigned set_toggle); void set_delay_params_from_signed_delay(int32_t measured_delay, int32_t *mic_delay_samples, int32_t *requested_delay_debug); -fixed_s32_t float_to_frac_bits(float_s32_t value); +q8_24 float_to_frac_bits(float_s32_t value); void push_peak_power_into_history(adec_state_t *adec_state, float_s32_t peak_phase_power); void get_decimated_peak_power_history(float_s32_t peak_power_decimated[ADEC_PEAK_LINREG_HISTORY_DECIMATED_SIZE], adec_state_t *adec_state); float_s32_t linear_regression_get_slope(float_s32_t pk_energies[], unsigned n, float_s32_t scale_factor); -fixed_s32_t calculate_aec_goodness_metric(adec_state_t *state, fixed_s32_t log2erle_q24, float_s32_t peak_power_slope, fixed_s32_t agm_q24); +q8_24 calculate_aec_goodness_metric(adec_state_t *state, q8_24 log2erle_q24, float_s32_t peak_power_slope, q8_24 agm_q24); #endif diff --git a/modules/lib_adec/src/adec_priv_impl.c b/modules/lib_adec/src/adec_priv_impl.c index 4da4f1a8f..f21120c3f 100644 --- a/modules/lib_adec/src/adec_priv_impl.c +++ b/modules/lib_adec/src/adec_priv_impl.c @@ -41,7 +41,7 @@ void reset_stuff_on_AEC_mode_start(adec_state_t *adec_state, unsigned set_toggle adec_state->peak_power_history_valid = 0; adec_state->peak_to_average_ratio_valid_flag = 0; - adec_state->max_peak_to_average_ratio_since_reset = double_to_float_s32(1.0); + adec_state->max_peak_to_average_ratio_since_reset = f64_to_float_s32(1.0); adec_state->gated_milliseconds_since_mode_change = 0; @@ -80,7 +80,7 @@ void set_delay_params_from_signed_delay(int32_t measured_delay, int32_t *mic_del //This takes about 68 cycles compared with dsp_math_log that takes 12650 //See unit test for const array generation and test. Accuracy is better than 0.06dB with this table & config -fixed_s32_t float_to_frac_bits(float_s32_t value){ +int32_t float_to_frac_bits(float_s32_t value){ const LOG2_LOOKUP_TYPE log2_lookup[LOG2_LOOKUP_TABLE_SIZE] = { 0x0, 0x0, 0x1, 0x2, 0x2, 0x3, 0x4, 0x4, 0x5, 0x6, 0x7, 0x7, 0x8, 0x9, 0x9, 0xa, 0xb, 0xb, 0xc, 0xd, 0xd, 0xe, 0xf, 0xf, 0x10, 0x11, 0x11, 0x12, 0x13, 0x13, 0x14, 0x15, 0x15, 0x16, 0x17, 0x17, 0x18, 0x18, 0x19, 0x1a, 0x1a, @@ -123,7 +123,7 @@ fixed_s32_t float_to_frac_bits(float_s32_t value){ number_of_bits += ((uint32_t)log2_lookup[top_n_bits] << (shift_threshold - LOG2_LOOKUP_TYPE_BITS)); } - return (fixed_s32_t)number_of_bits; + return (int32_t)number_of_bits; } void push_peak_power_into_history(adec_state_t *adec_state, float_s32_t peak_phase_power){ @@ -152,7 +152,7 @@ void get_decimated_peak_power_history(float_s32_t peak_power_decimated[ADEC_PEAK //and so the slope is relative rather than absolute. This normalises it which is important when mag(H) is unknown float_s32_t linear_regression_get_slope(float_s32_t pk_energies[], unsigned n, float_s32_t scale_factor){ float_s32_t sumx, sumxsq, sumy, sumxy; - float_s32_t zero = double_to_float_s32(0.0); + float_s32_t zero = f64_to_float_s32(0.0); sumx = zero; sumxsq = zero; sumy = zero; @@ -201,13 +201,13 @@ float_s32_t linear_regression_get_slope(float_s32_t pk_energies[], unsigned n, f } -static inline fixed_s32_t multiply_q24_no_saturation(fixed_s32_t a_q24, fixed_s32_t b_q24){ +static inline q8_24 multiply_q24_no_saturation(q8_24 a_q24, q8_24 b_q24){ int64_t result_ll = (int64_t)a_q24 * (int64_t)b_q24; - return (fixed_s32_t)(result_ll >> 24); + return (q8_24)(result_ll >> 24); } //This function modifies the agm (AEC Goodness Metric) according to state of ERLE and the peak power slope -fixed_s32_t calculate_aec_goodness_metric(adec_state_t *state, fixed_s32_t log2erle_q24, float_s32_t peak_power_slope, fixed_s32_t agm_q24){ +q8_24 calculate_aec_goodness_metric(adec_state_t *state, q8_24 log2erle_q24, float_s32_t peak_power_slope, q8_24 agm_q24){ //All good if ERLE is high if (log2erle_q24 >= state->erle_good_bits_q24){ @@ -217,7 +217,7 @@ fixed_s32_t calculate_aec_goodness_metric(adec_state_t *state, fixed_s32_t log2e return ADEC_AGM_ONE; } - fixed_s32_t erle_agm_delta_q24 = 0; + q8_24 erle_agm_delta_q24 = 0; if (log2erle_q24 < state->erle_bad_bits_q24){ //This value will be negative when dB ERLE is less than 0 (ratio <1). Note it is in Q7.24 format erle_agm_delta_q24 = (log2erle_q24 - state->erle_bad_bits_q24); @@ -230,10 +230,10 @@ fixed_s32_t calculate_aec_goodness_metric(adec_state_t *state, fixed_s32_t log2e bfp_s32_init(&temp, &peak_power_slope.mant, peak_power_slope.exp, 1, 1); bfp_s32_use_exponent(&temp, -Q24_FRAC_BITS); peak_power_slope.exp = temp.exp; - fixed_s32_t peak_slope_q24 = peak_power_slope.mant; //now in 8.24 format + q8_24 peak_slope_q24 = peak_power_slope.mant; //now in 8.24 format peak_slope_q24 = multiply_q24_no_saturation(peak_slope_q24, state->peak_phase_energy_trend_gain_q24); - fixed_s32_t new_agm_q24 = (agm_q24 + erle_agm_delta_q24 + peak_slope_q24); + q8_24 new_agm_q24 = (agm_q24 + erle_agm_delta_q24 + peak_slope_q24); //Clip positive - negative will be captured by mode change logic if (new_agm_q24 > ADEC_AGM_ONE){ diff --git a/modules/lib_aec/CMakeLists.txt b/modules/lib_aec/CMakeLists.txt index d8a7bae4f..11a9c5a7b 100644 --- a/modules/lib_aec/CMakeLists.txt +++ b/modules/lib_aec/CMakeLists.txt @@ -25,7 +25,7 @@ target_compile_options(fwk_voice_module_lib_aec target_link_libraries(fwk_voice_module_lib_aec PUBLIC - core::xs3_math + lib_xcore_math ) ## Create an alias diff --git a/modules/lib_aec/api/aec_api.h b/modules/lib_aec/api/aec_api.h index 3ff7f974e..5d787582b 100644 --- a/modules/lib_aec/api/aec_api.h +++ b/modules/lib_aec/api/aec_api.h @@ -5,8 +5,7 @@ #include #include -#include "bfp_math.h" -#include "xs3_math.h" +#include "xmath/xmath.h" #include "aec_state.h" /** diff --git a/modules/lib_aec/api/aec_state.h b/modules/lib_aec/api/aec_state.h index 381c9c79e..ceae7eb42 100644 --- a/modules/lib_aec/api/aec_state.h +++ b/modules/lib_aec/api/aec_state.h @@ -6,8 +6,8 @@ #include #include #include "aec_defines.h" -#include "bfp_math.h" -#include "xs3_math.h" +#include "xmath/xmath.h" + /** * @page page_aec_state_h aec_state.h @@ -116,7 +116,7 @@ typedef struct { /** coefficient index used to track H_hat index when sending H_hat values over the host control interface.*/ uint32_t coeff_index; /** alpha used while calculating y_ema_energy, x_ema_energy and error_ema_energy.*/ - fixed_s32_t ema_alpha_q30; + uq2_30 ema_alpha_q30; }aec_core_config_params_t; /** diff --git a/modules/lib_aec/src/aec_priv.h b/modules/lib_aec/src/aec_priv.h index b635751bf..74c0c69ba 100644 --- a/modules/lib_aec/src/aec_priv.h +++ b/modules/lib_aec/src/aec_priv.h @@ -5,8 +5,7 @@ #include #include -#include "bfp_math.h" -#include "xs3_math.h" +#include "xmath/xmath.h" //private AEC functions and defines diff --git a/modules/lib_aec/src/aec_priv_impl.c b/modules/lib_aec/src/aec_priv_impl.c index d1abe8d05..a4663a262 100644 --- a/modules/lib_aec/src/aec_priv_impl.c +++ b/modules/lib_aec/src/aec_priv_impl.c @@ -6,7 +6,7 @@ #include "aec_defines.h" #include "aec_api.h" #include "aec_priv.h" -#include "q_format.h" +#include "xmath/xmath.h" void aec_priv_main_init( aec_state_t *state, @@ -108,7 +108,7 @@ void aec_priv_main_init( state->shared_state->x_ema_energy[ch].exp = AEC_ZEROVAL_EXP; } //fractional regularisation scalefactor - state->delta_scale = double_to_float_s32((double)1e-5); + state->delta_scale = f64_to_float_s32((double)1e-5); //Initialise aec config params aec_priv_init_config_params(&state->shared_state->config_params); @@ -116,8 +116,8 @@ void aec_priv_main_init( //Initialise coherence mu params coherence_mu_params_t *coh_params = state->shared_state->coh_mu_state; for(unsigned ch=0; cherror_ema_energy[ch].exp = AEC_ZEROVAL_EXP; } //fractional regularisation scalefactor - state->delta_scale = double_to_float_s32((double)1e-3); + state->delta_scale = f64_to_float_s32((double)1e-3); } void aec_priv_bfp_complex_s32_copy( @@ -435,19 +435,19 @@ void aec_priv_calc_coherence_mu( if(coh_mu_state[ch].mu_shad_count >= 1) { for(unsigned x_ch=0; x_ch 0) { for(unsigned x_ch=0; x_chadaption_config == AEC_ADAPTION_FORCE_OFF){ for(unsigned y_ch=0; y_chcoh_alpha); float_s32_t t1 = float_s32_mul(coh_conf->coh_alpha, coh_mu_state->coh); float_s32_t t2 = float_s32_mul(one_minus_alpha, this_coh); @@ -728,14 +728,14 @@ float_s32_t aec_priv_calc_corr_factor(bfp_s32_t *y, bfp_s32_t *yhat) { } // Hanning window structure used in the windowing operation done to remove discontinuities from the filter error -static const fixed_s32_t WOLA_window_q31[AEC_UNUSED_TAPS_PER_PHASE*2] = { +static const uq1_31 WOLA_window_q31[AEC_UNUSED_TAPS_PER_PHASE*2] = { 4861986, 19403913, 43494088, 76914346, 119362028, 170452721, 229723740, 296638317, 370590464, 450910459, 536870911, 627693349, 722555272, 820597594, 920932429, 1022651130, 1124832516, 1226551217, 1326886052, 1424928374, 1519790297, 1610612735, 1696573187, 1776893182, 1850845329, 1917759906, 1977030925, 2028121618, 2070569300, 2103989558, 2128079733, 2142621660 }; -static const fixed_s32_t WOLA_window_flpd_q31[AEC_UNUSED_TAPS_PER_PHASE*2] = { +static const uq1_31 WOLA_window_flpd_q31[AEC_UNUSED_TAPS_PER_PHASE*2] = { 2142621660, 2128079733, 2103989558, 2070569300, 2028121618, 1977030925, 1917759906, 1850845329, 1776893182, 1696573187, 1610612735, 1519790297, 1424928374, 1326886052, 1226551217, 1124832516, 1022651130, 920932429, 820597594, 722555272, 627693349, 536870911, 450910459, 370590464, @@ -805,7 +805,7 @@ void aec_priv_calc_inverse( bfp_s32_inverse(input, input); #else //36323 cycles. 2 x-channels, single thread - int32_t min_element = xs3_vect_s32_min( + int32_t min_element = vect_s32_min( input->data, input->length); @@ -826,21 +826,21 @@ void bfp_new_add_scalar( const bfp_s32_t* b, const float_s32_t c) { -#if (XS3_BFP_DEBUG_CHECK_LENGTHS) // See xs3_math_conf.h +#if (BFP_DEBUG_CHECK_LENGTHS) assert(b->length == a->length); assert(b->length != 0); #endif right_shift_t b_shr, c_shr; - xs3_vect_s32_add_scalar_prepare(&a->exp, &b_shr, &c_shr, b->exp, c.exp, + vect_s32_add_scalar_prepare(&a->exp, &b_shr, &c_shr, b->exp, c.exp, b->hr, HR_S32(c.mant)); int32_t cc = 0; if (c_shr < 32) cc = (c_shr >= 0)? (c.mant >> c_shr) : (c.mant << -c_shr); - a->hr = xs3_vect_s32_add_scalar(a->data, b->data, cc, b->length, + a->hr = vect_s32_add_scalar(a->data, b->data, cc, b->length, b_shr); } @@ -871,12 +871,12 @@ void aec_priv_calc_inv_X_energy_denom( bfp_s32_add(&norm_denom, &sigma_times_gamma, &temp); //self.taps = [0.5, 1, 1, 1, 0.5] - fixed_s32_t taps_q30[5] = {0x20000000, 0x40000000, 0x40000000, 0x40000000, 0x20000000}; + uq2_30 taps_q30[5] = {0x20000000, 0x40000000, 0x40000000, 0x40000000, 0x20000000}; for(int i=0; i<5; i++) { taps_q30[i] = taps_q30[i] >> 2;//This is equivalent to a divide by 4 } - bfp_s32_convolve_same(inv_X_energy_denom, &norm_denom, &taps_q30[0], 5, PAD_MODE_REFLECT); + bfp_s32_convolve_same(inv_X_energy_denom, &norm_denom, (const int32_t *) &taps_q30[0], 5, PAD_MODE_REFLECT); //bfp_s32_add_scalar(inv_X_energy_denom, inv_X_energy_denom, delta); bfp_new_add_scalar(inv_X_energy_denom, inv_X_energy_denom, delta); @@ -975,7 +975,7 @@ void aec_priv_compute_T( void aec_priv_init_config_params( aec_config_params_t *config_params) { - //TODO profile double_to_float_s32() calls + //TODO profile f64_to_float_s32() calls //aec_core_config_params_t aec_core_config_params_t *core_conf = &config_params->aec_core_conf; core_conf->sigma_xx_shift = 6; @@ -983,32 +983,32 @@ void aec_priv_init_config_params( core_conf->gamma_log2 = 5; core_conf->delta_adaption_force_on.mant = (unsigned)UINT_MAX >> 1; core_conf->delta_adaption_force_on.exp = -32 - 6 + 1; //extra +1 to account for shr of 1 to the mant in order to store it as a signed number - core_conf->delta_min = double_to_float_s32((double)1e-20); + core_conf->delta_min = f64_to_float_s32((double)1e-20); core_conf->bypass = 0; core_conf->coeff_index = 0; //shadow_filt_config_params_t shadow_filt_config_params_t *shadow_cfg = &config_params->shadow_filt_conf; - shadow_cfg->shadow_sigma_thresh = double_to_float_s32(0.6); //# threshold for resetting sigma_xx - shadow_cfg->shadow_copy_thresh = double_to_float_s32(0.5); //# threshold for copying shadow filter - shadow_cfg->shadow_reset_thresh = double_to_float_s32(1.5); - shadow_cfg->shadow_delay_thresh = double_to_float_s32(0.5); //# will not reset if reference delay is large - shadow_cfg->x_energy_thresh = double_to_float_s32(pow(10, -40/10.0)); + shadow_cfg->shadow_sigma_thresh = f64_to_float_s32(0.6); //# threshold for resetting sigma_xx + shadow_cfg->shadow_copy_thresh = f64_to_float_s32(0.5); //# threshold for copying shadow filter + shadow_cfg->shadow_reset_thresh = f64_to_float_s32(1.5); + shadow_cfg->shadow_delay_thresh = f64_to_float_s32(0.5); //# will not reset if reference delay is large + shadow_cfg->x_energy_thresh = f64_to_float_s32(pow(10, -40/10.0)); shadow_cfg->shadow_better_thresh = 5; //# how many times better before copying shadow_cfg->shadow_zero_thresh = 5;//# zero shadow filter every n resets shadow_cfg->shadow_reset_timer = 20; //# number of frames between zeroing resets - shadow_cfg->shadow_mu = double_to_float_s32(1.0); + shadow_cfg->shadow_mu = f64_to_float_s32(1.0); //coherence_mu_config_params_t coherence_mu_config_params_t *coh_cfg = &config_params->coh_mu_conf; - coh_cfg->coh_alpha = double_to_float_s32(0.0); - coh_cfg->coh_slow_alpha = double_to_float_s32(0.99); - coh_cfg->coh_thresh_slow = double_to_float_s32(0.9); - coh_cfg->coh_thresh_abs = double_to_float_s32(0.65); - coh_cfg->mu_scalar = double_to_float_s32(1.0); - coh_cfg->eps = double_to_float_s32((double)1e-100); - coh_cfg->thresh_minus20dB = double_to_float_s32(pow(10, -20/10.0)); - coh_cfg->x_energy_thresh = double_to_float_s32(pow(10, -40/10.0)); + coh_cfg->coh_alpha = f64_to_float_s32(0.0); + coh_cfg->coh_slow_alpha = f64_to_float_s32(0.99); + coh_cfg->coh_thresh_slow = f64_to_float_s32(0.9); + coh_cfg->coh_thresh_abs = f64_to_float_s32(0.65); + coh_cfg->mu_scalar = f64_to_float_s32(1.0); + coh_cfg->eps = f64_to_float_s32((double)1e-100); + coh_cfg->thresh_minus20dB = f64_to_float_s32(pow(10, -20/10.0)); + coh_cfg->x_energy_thresh = f64_to_float_s32(pow(10, -40/10.0)); coh_cfg->mu_coh_time = 2; coh_cfg->mu_shad_time = 5; diff --git a/modules/lib_agc/CMakeLists.txt b/modules/lib_agc/CMakeLists.txt index ffcbd22c0..e07109db8 100644 --- a/modules/lib_agc/CMakeLists.txt +++ b/modules/lib_agc/CMakeLists.txt @@ -20,7 +20,7 @@ target_compile_options(fwk_voice_module_lib_agc target_link_libraries(fwk_voice_module_lib_agc PUBLIC - core::xs3_math + lib_xcore_math ) diff --git a/modules/lib_agc/api/agc_api.h b/modules/lib_agc/api/agc_api.h index d0c717ef8..34f4116c1 100644 --- a/modules/lib_agc/api/agc_api.h +++ b/modules/lib_agc/api/agc_api.h @@ -3,7 +3,7 @@ #ifndef AGC_API_H #define AGC_API_H -#include +#include "xmath/xmath.h" #include /** diff --git a/modules/lib_agc/api/agc_profiles.h b/modules/lib_agc/api/agc_profiles.h index 0cfeef6fc..8917347ba 100644 --- a/modules/lib_agc/api/agc_profiles.h +++ b/modules/lib_agc/api/agc_profiles.h @@ -3,7 +3,7 @@ #ifndef AGC_PROFILES_H #define AGC_PROFILES_H -#include +#include "xmath/xmath.h" /** * @page page_agc_profiles_h agc_profiles.h diff --git a/modules/lib_agc/src/agc_defines.h b/modules/lib_agc/src/agc_defines.h index 80aaefaa9..5ae34e052 100644 --- a/modules/lib_agc/src/agc_defines.h +++ b/modules/lib_agc/src/agc_defines.h @@ -3,7 +3,7 @@ #ifndef AGC_DEFINES_H #define AGC_DEFINES_H -#include +#include "xmath/xmath.h" // The input and output frame data format is Q1.31 #define FRAME_EXP -31 diff --git a/modules/lib_agc/src/agc_impl.c b/modules/lib_agc/src/agc_impl.c index cbc6ea6e0..277f98fee 100644 --- a/modules/lib_agc/src/agc_impl.c +++ b/modules/lib_agc/src/agc_impl.c @@ -2,26 +2,26 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include #include "agc_defines.h" -#include +#include "xmath/xmath.h" #include void agc_init(agc_state_t *agc, agc_config_t *config) { agc->config = *config; - agc->x_slow = float_to_float_s32(0); - agc->x_fast = float_to_float_s32(0); - agc->x_peak = float_to_float_s32(0); + agc->x_slow = f32_to_float_s32(0); + agc->x_fast = f32_to_float_s32(0); + agc->x_peak = f32_to_float_s32(0); agc->lc_t_far = 0; agc->lc_t_near = 0; - agc->lc_near_power_est = float_to_float_s32(0.00001F); - agc->lc_far_power_est = float_to_float_s32(0.01F); - agc->lc_near_bg_power_est = float_to_float_s32(0.01F); - agc->lc_gain = float_to_float_s32(1); - agc->lc_far_bg_power_est = float_to_float_s32(0.01F); - agc->lc_corr_val = float_to_float_s32(0); + agc->lc_near_power_est = f32_to_float_s32(0.00001F); + agc->lc_far_power_est = f32_to_float_s32(0.01F); + agc->lc_near_bg_power_est = f32_to_float_s32(0.01F); + agc->lc_gain = f32_to_float_s32(1); + agc->lc_far_bg_power_est = f32_to_float_s32(0.01F); + agc->lc_corr_val = f32_to_float_s32(0); } // Returns the mantissa for the input float shifted to an exponent of parameter exp diff --git a/modules/lib_ic/CMakeLists.txt b/modules/lib_ic/CMakeLists.txt index db2d45865..932d6d811 100644 --- a/modules/lib_ic/CMakeLists.txt +++ b/modules/lib_ic/CMakeLists.txt @@ -21,7 +21,7 @@ target_compile_options(fwk_voice_module_lib_ic target_link_libraries(fwk_voice_module_lib_ic PUBLIC - core::xs3_math + lib_xcore_math fwk_voice::aec fwk_voice::vnr::features fwk_voice::vnr::inference diff --git a/modules/lib_ic/api/ic_defines.h b/modules/lib_ic/api/ic_defines.h index f0264b33e..39d5683ff 100644 --- a/modules/lib_ic/api/ic_defines.h +++ b/modules/lib_ic/api/ic_defines.h @@ -6,7 +6,7 @@ #include #include #include -#include "bfp_math.h" +#include "xmath/xmath.h" #include "vnr_features_api.h" #include "vnr_inference_api.h" diff --git a/modules/lib_ic/api/ic_state.h b/modules/lib_ic/api/ic_state.h index 64c19ea3c..19a248199 100644 --- a/modules/lib_ic/api/ic_state.h +++ b/modules/lib_ic/api/ic_state.h @@ -62,7 +62,7 @@ typedef struct { /** Down scaling factor for X energy for used for normalisation. */ uint32_t sigma_xx_shift; /** Alpha used for calculating error_ema_energy in adapt. */ - fixed_s32_t ema_alpha_q30; + q2_30 ema_alpha_q30; /** Delta value used in denominator to avoid large values when calculating inverse * X energy. */ float_s32_t delta; @@ -83,7 +83,7 @@ typedef struct { typedef struct { /** Alpha for EMA input/output energy calculation. */ - fixed_s32_t energy_alpha_q30; + q2_30 energy_alpha_q30; /** Fast ratio threshold to detect instability. */ float_s32_t fast_ratio_threshold; @@ -145,7 +145,7 @@ typedef struct { vnr_feature_state_t feature_state[2]; float_s32_t input_vnr_pred; float_s32_t output_vnr_pred; - fixed_s32_t pred_alpha_q30; + q2_30 pred_alpha_q30; }vnr_pred_state_t; /** diff --git a/modules/lib_ic/src/ic.c b/modules/lib_ic/src/ic.c index 622fa93cf..7d6de8c42 100644 --- a/modules/lib_ic/src/ic.c +++ b/modules/lib_ic/src/ic.c @@ -2,7 +2,7 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "ic_low_level.h" -#include "q_format.h" +#include "xmath/xmath.h" // For use when dumping variables for debug void ic_dump_var_2d(ic_state_t *state); @@ -14,8 +14,8 @@ static int32_t ic_init_vnr_pred_state(vnr_pred_state_t *vnr_pred_state){ int32_t ret = vnr_inference_init(); vnr_pred_state->pred_alpha_q30 = Q30(IC_INIT_VNR_PRED_ALPHA); - vnr_pred_state->input_vnr_pred = float_to_float_s32(IC_INIT_INPUT_VNR_PRED); - vnr_pred_state->output_vnr_pred = float_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); + vnr_pred_state->input_vnr_pred = f32_to_float_s32(IC_INIT_INPUT_VNR_PRED); + vnr_pred_state->output_vnr_pred = f32_to_float_s32(IC_INIT_OUTPUT_VNR_PRED); return ret; } @@ -24,7 +24,7 @@ static void ic_init_config(ic_config_params_t *config){ config->gamma_log2 = IC_INIT_GAMMA_LOG2; config->ema_alpha_q30 = Q30(IC_INIT_EMA_ALPHA); config->bypass = 0; - config->delta = double_to_float_s32(IC_INIT_DELTA); + config->delta = f64_to_float_s32(IC_INIT_DELTA); } @@ -32,13 +32,13 @@ static void ic_init_adaption_controller_config(ic_adaption_controller_config_t * ad_config->energy_alpha_q30 = Q30(IC_INIT_ENERGY_ALPHA); - ad_config->fast_ratio_threshold = double_to_float_s32(IC_INIT_FAST_RATIO_THRESHOLD); - ad_config->high_input_vnr_hold_leakage_alpha = double_to_float_s32(IC_INIT_HIGH_INPUT_VNR_HOLD_LEAKAGE_ALPHA); - ad_config->instability_recovery_leakage_alpha = double_to_float_s32(IC_INIT_INSTABILITY_RECOVERY_LEAKAGE_ALPHA); + ad_config->fast_ratio_threshold = f64_to_float_s32(IC_INIT_FAST_RATIO_THRESHOLD); + ad_config->high_input_vnr_hold_leakage_alpha = f64_to_float_s32(IC_INIT_HIGH_INPUT_VNR_HOLD_LEAKAGE_ALPHA); + ad_config->instability_recovery_leakage_alpha = f64_to_float_s32(IC_INIT_INSTABILITY_RECOVERY_LEAKAGE_ALPHA); - ad_config->input_vnr_threshold = double_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD); - ad_config->input_vnr_threshold_high = double_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD_HIGH); - ad_config->input_vnr_threshold_low = double_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD_LOW); + ad_config->input_vnr_threshold = f64_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD); + ad_config->input_vnr_threshold_high = f64_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD_HIGH); + ad_config->input_vnr_threshold_low = f64_to_float_s32(IC_INIT_INPUT_VNR_THRESHOLD_LOW); ad_config->adapt_counter_limit = IC_INIT_ADAPT_COUNTER_LIMIT; @@ -136,11 +136,11 @@ int32_t ic_init(ic_state_t *state){ // mu for(unsigned ych=0; ychmu[ych][xch] = double_to_float_s32(IC_INIT_MU); + state->mu[ych][xch] = f64_to_float_s32(IC_INIT_MU); } } - state->leakage_alpha = double_to_float_s32(IC_INIT_LEAKAGE_ALPHA); + state->leakage_alpha = f64_to_float_s32(IC_INIT_LEAKAGE_ALPHA); // Initialise ic core config params and adaption controller ic_init_config(&state->config_params); diff --git a/modules/lib_ic/src/ic_low_level.c b/modules/lib_ic/src/ic_low_level.c index 61160c38b..48b5bc5b9 100644 --- a/modules/lib_ic/src/ic_low_level.c +++ b/modules/lib_ic/src/ic_low_level.c @@ -104,7 +104,7 @@ void ic_update_td_ema_energy( const bfp_s32_t *input, unsigned start_offset, unsigned length, - const fixed_s32_t alpha){ + const int32_t alpha){ if(!length) { return; @@ -306,8 +306,8 @@ void ic_mu_control_system(ic_state_t * state, float_s32_t vnr){ ic_adaption_controller_state_t *ad_state = &state->ic_adaption_controller_state; ic_adaption_controller_config_t *ad_config = &state->ic_adaption_controller_state.adaption_controller_config; - const float_s32_t one = float_to_float_s32(1.0); - const float_s32_t zero = float_to_float_s32(0.0); + const float_s32_t one = f32_to_float_s32(1.0); + const float_s32_t zero = f32_to_float_s32(0.0); if(ad_config->adaption_config == IC_ADAPTION_FORCE_ON){ ad_state->control_flag = FORCE_ADAPT; @@ -337,7 +337,7 @@ void ic_mu_control_system(ic_state_t * state, float_s32_t vnr){ ad_state->control_flag = ADAPT; } else{ - ic_set_mu(state, float_to_float_s32(0.1)); + ic_set_mu(state, f32_to_float_s32(0.1)); ad_state->control_flag = ADAPT_SLOW; } state->leakage_alpha = one; @@ -345,7 +345,7 @@ void ic_mu_control_system(ic_state_t * state, float_s32_t vnr){ } if(float_s32_gt(ad_state->fast_ratio, ad_config->fast_ratio_threshold)){ - ic_set_mu(state, float_to_float_s32(0.9)); + ic_set_mu(state, f32_to_float_s32(0.9)); state->leakage_alpha = ad_config->instability_recovery_leakage_alpha; ad_state->control_flag = UNSTABLE; } diff --git a/modules/lib_ic/src/ic_low_level.h b/modules/lib_ic/src/ic_low_level.h index a44c04166..8e695cc92 100644 --- a/modules/lib_ic/src/ic_low_level.h +++ b/modules/lib_ic/src/ic_low_level.h @@ -43,7 +43,7 @@ void ic_update_td_ema_energy( const bfp_s32_t *input, unsigned start_offset, unsigned length, - const fixed_s32_t alpha); + const int32_t alpha); // FFT single channel real input void ic_fft( diff --git a/modules/lib_ns/CMakeLists.txt b/modules/lib_ns/CMakeLists.txt index 9ae7d33fa..bab2f6312 100644 --- a/modules/lib_ns/CMakeLists.txt +++ b/modules/lib_ns/CMakeLists.txt @@ -22,7 +22,7 @@ target_compile_options(fwk_voice_module_lib_ns target_link_libraries(fwk_voice_module_lib_ns PUBLIC - core::xs3_math + lib_xcore_math ) ## Create an alias diff --git a/modules/lib_ns/api/ns_state.h b/modules/lib_ns/api/ns_state.h index 8ef57fdb1..977d34fc8 100644 --- a/modules/lib_ns/api/ns_state.h +++ b/modules/lib_ns/api/ns_state.h @@ -3,7 +3,7 @@ #ifndef NS_STATE_H #define NS_STATE_H -#include +#include "xmath/xmath.h" /** * @page page_ns_state_h ns_state.h diff --git a/modules/lib_ns/src/ns_impl.c b/modules/lib_ns/src/ns_impl.c index 102546163..a4ff27e76 100644 --- a/modules/lib_ns/src/ns_impl.c +++ b/modules/lib_ns/src/ns_impl.c @@ -2,7 +2,7 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include #include -#include +#include "xmath/xmath.h" #include "ns_priv.h" #include @@ -160,10 +160,10 @@ void ns_priv_rescale_vector_old(bfp_complex_s32_t * Y, bfp_s32_t * new_mag, bfp_ //bfp_s32_inverse(orig_mag, orig_mag); //bfp_s32_mul(orig_mag, orig_mag, new_mag); - xs3_vect_s32_shl(new_mag->data, new_mag->data, NS_PROC_FRAME_BINS, new_mag->hr); + vect_s32_shl(new_mag->data, new_mag->data, NS_PROC_FRAME_BINS, new_mag->hr); new_mag->exp -= new_mag->hr; new_mag->hr = 0; - xs3_vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, orig_mag->hr); + vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, orig_mag->hr); orig_mag->exp -= orig_mag->hr; orig_mag->hr = 0; int max_exp = INT_MIN; @@ -196,7 +196,7 @@ void ns_priv_rescale_vector_old(bfp_complex_s32_t * Y, bfp_s32_t * new_mag, bfp_ // setting a headroom to be 1 to get the maximum precision and avoid overflow left_shift_t shl = bfp_s32_headroom(orig_mag) - 1; - xs3_vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, shl); + vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, shl); orig_mag->exp -= shl; orig_mag->hr = 1; bfp_complex_s32_real_mul(Y, Y, orig_mag); @@ -226,15 +226,15 @@ void ns_priv_rescale_vector(bfp_complex_s32_t * Y, bfp_s32_t * new_mag, bfp_s32_ // preparing input data left_shift_t lsh = new_mag->hr; - xs3_vect_s32_shl(new_mag->data, new_mag->data, NS_PROC_FRAME_BINS, lsh); + vect_s32_shl(new_mag->data, new_mag->data, NS_PROC_FRAME_BINS, lsh); new_mag->exp -= lsh; lsh = orig_mag->hr; - xs3_vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, lsh); + vect_s32_shl(orig_mag->data, orig_mag->data, NS_PROC_FRAME_BINS, lsh); orig_mag->exp -= lsh; lsh = Y->hr - 2; - xs3_vect_complex_s32_shl(Y->data, Y->data, NS_PROC_FRAME_BINS, lsh); + vect_complex_s32_shl(Y->data, Y->data, NS_PROC_FRAME_BINS, lsh); Y->exp -= lsh; // modify the exponent @@ -266,7 +266,7 @@ void ns_process_frame(ns_state_t * ns, ns_priv_apply_window(&curr_frame, &ns->wind, &ns->rev_wind, NS_PROC_FRAME_LENGTH, NS_WINDOW_LENGTH); bfp_complex_s32_t *curr_fft = bfp_fft_forward_mono(&curr_frame); - curr_fft->hr = bfp_complex_s32_headroom(curr_fft); // TODO Workaround till https://github.com/xmos/lib_xs3_math/issues/96 is fixed + curr_fft->hr = bfp_complex_s32_headroom(curr_fft); // TODO Workaround till https://github.com/xmos/lib_xcore_math/issues/96 is fixed bfp_fft_unpack_mono(curr_fft); bfp_complex_s32_mag(&abs_Y_suppressed, curr_fft); diff --git a/modules/lib_ns/src/ns_low_level.c b/modules/lib_ns/src/ns_low_level.c index 42a51c496..5a14aa4da 100644 --- a/modules/lib_ns/src/ns_low_level.c +++ b/modules/lib_ns/src/ns_low_level.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include -#include +#include "xmath/xmath.h" #include "ns_priv.h" #include diff --git a/modules/lib_ns/src/ns_priv.h b/modules/lib_ns/src/ns_priv.h index 035982998..bd8e44f72 100644 --- a/modules/lib_ns/src/ns_priv.h +++ b/modules/lib_ns/src/ns_priv.h @@ -4,7 +4,7 @@ #define _NS_PRIV_H #include -#include +#include "xmath/xmath.h" void ns_priv_rescale_vector(bfp_complex_s32_t * Y, bfp_s32_t * new_mag, bfp_s32_t * orig_mag); diff --git a/modules/lib_vnr/CMakeLists.txt b/modules/lib_vnr/CMakeLists.txt index d3302a067..d02e1247a 100644 --- a/modules/lib_vnr/CMakeLists.txt +++ b/modules/lib_vnr/CMakeLists.txt @@ -10,7 +10,7 @@ target_include_directories(fwk_voice_module_lib_vnr_inference PUBLIC api/common target_link_libraries(fwk_voice_module_lib_vnr_inference PUBLIC - core::xs3_math + lib_xcore_math ) target_link_libraries(fwk_voice_module_lib_vnr_inference @@ -39,7 +39,7 @@ target_compile_options(fwk_voice_module_lib_vnr_features target_link_libraries(fwk_voice_module_lib_vnr_features PUBLIC - core::xs3_math + lib_xcore_math ) add_library(fwk_voice::vnr::features ALIAS fwk_voice_module_lib_vnr_features) diff --git a/modules/lib_vnr/api/features/vnr_features_state.h b/modules/lib_vnr/api/features/vnr_features_state.h index 7e290d51c..d1b3777a5 100644 --- a/modules/lib_vnr/api/features/vnr_features_state.h +++ b/modules/lib_vnr/api/features/vnr_features_state.h @@ -2,7 +2,8 @@ #define __VNR_FEATURES_STATE_H__ #include "vnr_defines.h" -#include "bfp_math.h" +#include "xmath/xmath.h" + /** * @page page_vnr_features_state_h vnr_features_state.h * @@ -64,7 +65,7 @@ typedef struct { */ typedef struct { /** Feature buffer containing the most recent VNR_MEL_FILTERS frames' MEL frequency spectrum. */ - fixed_s32_t DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; + int32_t DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; vnr_feature_config_t config; }vnr_feature_state_t; #endif diff --git a/modules/lib_vnr/api/inference/vnr_inference_api.h b/modules/lib_vnr/api/inference/vnr_inference_api.h index fc9138bcb..399550c3a 100644 --- a/modules/lib_vnr/api/inference/vnr_inference_api.h +++ b/modules/lib_vnr/api/inference/vnr_inference_api.h @@ -16,7 +16,7 @@ #ifdef __cplusplus extern "C" { #endif - #include "bfp_math.h" + #include "xmath/xmath.h" /** * @brief Initialise the inference_engine object and load the VNR model into the inference engine. diff --git a/modules/lib_vnr/python/utils/mel/gen_mel_filters.py b/modules/lib_vnr/python/utils/mel/gen_mel_filters.py index 794bdf523..f07f9566f 100644 --- a/modules/lib_vnr/python/utils/mel/gen_mel_filters.py +++ b/modules/lib_vnr/python/utils/mel/gen_mel_filters.py @@ -197,7 +197,7 @@ def gen_c_src(self, var_name): c_text += f"#define AUDIO_FEATURES_MEL_HEADROOM_BITS {self.headroom_bits}\n"; c_text += f"#define AUDIO_FEATURES_MEL_ARRAY_NAME {array_name}\n"; c_text += "\n" - c_text += f"fixed_s32_t {array_name}[{len(self.flattened_fbank)}] = {{\n" + c_text += f"uq1_31 {array_name}[{len(self.flattened_fbank)}] = {{\n" for line in self.compact_mel: c_text += "\t" + gen_c_line(line, mel_max) c_text = c_text[:-2] + "};\n" #chop off comma and space first diff --git a/modules/lib_vnr/src/features/mel_filter_512_24_compact.h b/modules/lib_vnr/src/features/mel_filter_512_24_compact.h index 81dec63ba..f6a3acce0 100644 --- a/modules/lib_vnr/src/features/mel_filter_512_24_compact.h +++ b/modules/lib_vnr/src/features/mel_filter_512_24_compact.h @@ -3,14 +3,14 @@ #define _mel_filter_512_24_compact_h_ #include -#include +#include "xmath/xmath.h" #define AUDIO_FEATURES_NUM_MELS 24 #define AUDIO_FEATURES_NUM_BINS 257 #define AUDIO_FEATURES_MEL_MAX 2147483647 #define AUDIO_FEATURES_MEL_HEADROOM_BITS 0 #define AUDIO_FEATURES_MEL_ARRAY_NAME mel_filter_512_24_compact_q31 -fixed_s32_t mel_filter_512_24_compact_q31[257] = { +uq1_31 mel_filter_512_24_compact_q31[257] = { 0, 1073741823, 2147483647, 1431655764, 715827882, 0, 1073741823, 2147483647, 1610612735, 1073741823, 536870911, 0, 715827882, 1431655764, 2147483647, 1610612735, 1073741823, 536870911, diff --git a/modules/lib_vnr/src/features/vnr_features.c b/modules/lib_vnr/src/features/vnr_features.c index 2e81f42ec..4a97df3e9 100644 --- a/modules/lib_vnr/src/features/vnr_features.c +++ b/modules/lib_vnr/src/features/vnr_features.c @@ -33,7 +33,7 @@ void vnr_extract_features(vnr_feature_state_t *vnr_feature_state, int32_t feature_patch_data[VNR_PATCH_WIDTH * VNR_MEL_FILTERS], const bfp_complex_s32_t *X) { - fixed_s32_t new_slice[VNR_MEL_FILTERS]; + uq8_24 new_slice[VNR_MEL_FILTERS]; vnr_priv_make_slice(new_slice, X, vnr_feature_state->config.enable_highpass); vnr_priv_add_new_slice(vnr_feature_state->feature_buffers, new_slice); vnr_priv_normalise_patch(feature_patch, feature_patch_data, (const vnr_feature_state_t*)vnr_feature_state); diff --git a/modules/lib_vnr/src/features/vnr_features_priv.c b/modules/lib_vnr/src/features/vnr_features_priv.c index 05a071bd3..348a2b571 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.c +++ b/modules/lib_vnr/src/features/vnr_features_priv.c @@ -24,7 +24,7 @@ void vnr_priv_forward_fft(bfp_complex_s32_t *X, int32_t *x_data) { memcpy(X, temp, sizeof(bfp_complex_s32_t)); } -void vnr_priv_make_slice(fixed_s32_t *new_slice, const bfp_complex_s32_t *X, int32_t hp) { +void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t hp) { // MEL float_s32_t mel_output[VNR_MEL_FILTERS]; // out_spect = np.abs(X_spect)**2 @@ -39,7 +39,7 @@ void vnr_priv_make_slice(fixed_s32_t *new_slice, const bfp_complex_s32_t *X, int vnr_priv_log2(new_slice, mel_output, VNR_MEL_FILTERS); //Calculate new_slice in state->scratch_data } -void vnr_priv_add_new_slice(fixed_s32_t (*feature_buffers)[VNR_MEL_FILTERS], const fixed_s32_t *new_slice) +void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice) { // Roll the patch buffer to get rid of oldest slice // self.feature_buffers[buffer_number] = np.roll(self.feature_buffers[buffer_number], -1, axis=0) @@ -100,11 +100,11 @@ void vnr_priv_mel_compute(float_s32_t *filter_output, const bfp_complex_s32_t *X unsigned filter_length = mel_filter_512_24_compact_start_bins[2*(i+1)] - filter_start; // Create input spectrum subset BFP structure bfp_s32_t spect_subset; - bfp_s32_init(&spect_subset, &squared_mag.data[filter_start], squared_mag.exp, filter_length, 1); + bfp_s32_init(&spect_subset, (int32_t *) &squared_mag.data[filter_start], squared_mag.exp, filter_length, 1); // Create MEL filter BFP structure bfp_s32_t filter_subset; - bfp_s32_init(&filter_subset, &mel_filter_512_24_compact_q31[filter_start], filter_exp, filter_length, 0); + bfp_s32_init(&filter_subset, (int32_t *) &mel_filter_512_24_compact_q31[filter_start], filter_exp, filter_length, 0); filter_subset.hr = filter_hr; // Dot product @@ -112,7 +112,7 @@ void vnr_priv_mel_compute(float_s32_t *filter_output, const bfp_complex_s32_t *X } bfp_s32_t filter; - bfp_s32_init(&filter, &mel_filter_512_24_compact_q31[0], filter_exp, AUDIO_FEATURES_NUM_BINS, 0); + bfp_s32_init(&filter, (int32_t *) &mel_filter_512_24_compact_q31[0], filter_exp, AUDIO_FEATURES_NUM_BINS, 0); // Generate odd band filters int32_t odd_band_filters_data[AUDIO_FEATURES_NUM_BINS]; // Memory for storing odd filters @@ -139,7 +139,7 @@ void vnr_priv_mel_compute(float_s32_t *filter_output, const bfp_complex_s32_t *X } } -void vnr_priv_log2(fixed_s32_t *output_q24, const float_s32_t *input, unsigned length) { +void vnr_priv_log2(uq8_24 *output_q24, const float_s32_t *input, unsigned length) { for(unsigned i=0; i> (mask_bits - (MEL_PRECISION - LOOKUP_PRECISION)); } -fixed_s32_t vnr_priv_float_s32_to_fixed_q24_log2(float_s32_t x) { +uq8_24 vnr_priv_float_s32_to_fixed_q24_log2(float_s32_t x) { headroom_t hr = HR_S32(x.mant); hr = hr + 1; uint32_t x_mant = 0; diff --git a/modules/lib_vnr/src/features/vnr_features_priv.h b/modules/lib_vnr/src/features/vnr_features_priv.h index 253052846..9f3d1527a 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.h +++ b/modules/lib_vnr/src/features/vnr_features_priv.h @@ -20,7 +20,7 @@ /** * @brief Gain applied to the first mel filtered bin when highpass filtering of MEL output is enabled */ -#define VNR_MEL_HP_GAIN (float_to_float_s32((float)0.01)) +#define VNR_MEL_HP_GAIN (f32_to_float_s32((float)0.01)) // Matching with python names /** @@ -34,7 +34,7 @@ * * This function name matches with the corresponding function in py_vnr python model. */ -void vnr_priv_make_slice(fixed_s32_t *new_slice, const bfp_complex_s32_t *X, int32_t hp); +void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t hp); /** * @brief roll a buffer and add a new slice to the end @@ -46,7 +46,7 @@ void vnr_priv_make_slice(fixed_s32_t *new_slice, const bfp_complex_s32_t *X, int * * This function name matches with the corresponding function in py_vnr python model. */ -void vnr_priv_add_new_slice(fixed_s32_t (*feature_buffers)[VNR_MEL_FILTERS], const fixed_s32_t *new_slice); +void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice); /** * @brief Normalise a patch by subtracting the max. @@ -102,12 +102,12 @@ void vnr_priv_mel_compute(float_s32_t *filter_output, const bfp_complex_s32_t *X * @param[input] input float_s32_t values * @param[input] length length of the input array */ -void vnr_priv_log2(fixed_s32_t *output_q24, const float_s32_t *input, unsigned length); +void vnr_priv_log2(uq8_24 *output_q24, const float_s32_t *input, unsigned length); /** * @brief log2 of a single value * This function calculates output = log2(input) for a single float_s32_t input value. log2 output format is fixed to Q8.24 */ -fixed_s32_t vnr_priv_float_s32_to_fixed_q24_log2(float_s32_t x); +uq8_24 vnr_priv_float_s32_to_fixed_q24_log2(float_s32_t x); #endif diff --git a/modules/lib_vnr/src/inference/vnr_inference_priv.cc b/modules/lib_vnr/src/inference/vnr_inference_priv.cc index 879658e02..bc888e664 100644 --- a/modules/lib_vnr/src/inference/vnr_inference_priv.cc +++ b/modules/lib_vnr/src/inference/vnr_inference_priv.cc @@ -5,14 +5,15 @@ #include "vnr_defines.h" #include "vnr_inference_priv.h" #include "model/vnr_quant_spec_defines.h" +#include "xmath/xmath.h" void vnr_priv_init_quant_spec(vnr_model_quant_spec_t *quant_spec) { - quant_spec->input_scale_inv = double_to_float_s32(VNR_INPUT_SCALE_INV); //from interpreter_tflite.get_input_details()[0] call in python - quant_spec->input_zero_point = double_to_float_s32(VNR_INPUT_ZERO_POINT); + quant_spec->input_scale_inv = f64_to_float_s32(VNR_INPUT_SCALE_INV); //from interpreter_tflite.get_input_details()[0] call in python + quant_spec->input_zero_point = f64_to_float_s32(VNR_INPUT_ZERO_POINT); - quant_spec->output_scale = double_to_float_s32(VNR_OUTPUT_SCALE); //from interpreter_tflite.get_output_details()[0] call in python - quant_spec->output_zero_point = double_to_float_s32(VNR_OUTPUT_ZERO_POINT); + quant_spec->output_scale = f64_to_float_s32(VNR_OUTPUT_SCALE); //from interpreter_tflite.get_output_details()[0] call in python + quant_spec->output_zero_point = f64_to_float_s32(VNR_OUTPUT_ZERO_POINT); } #define Q24_EXP (-24) diff --git a/modules/lib_vnr/src/inference/vnr_inference_priv.h b/modules/lib_vnr/src/inference/vnr_inference_priv.h index 4a90dd7c2..1569db845 100644 --- a/modules/lib_vnr/src/inference/vnr_inference_priv.h +++ b/modules/lib_vnr/src/inference/vnr_inference_priv.h @@ -1,7 +1,7 @@ #ifndef __VNR_INFERENCE_PRIV_H__ #define __VNR_INFERENCE_PRIV_H__ -#include "bfp_math.h" +#include "xmath/xmath.h" /** Quantisation spec used to quantise the VNR input features and dequantise the VNR output according to the specification for TensorFlow Lite's 8-bit quantization scheme * Quantisation: q = f/input_scale + input_zero_point diff --git a/test/lib_ic/test_bad_state/CMakeLists.txt b/test/lib_ic/test_bad_state/CMakeLists.txt index 15c1821ef..f64f437ce 100644 --- a/test/lib_ic/test_bad_state/CMakeLists.txt +++ b/test/lib_ic/test_bad_state/CMakeLists.txt @@ -64,7 +64,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - core::xs3_math) + lib_xcore_math) target_link_libraries(${APP_NAME} PRIVATE "-lpthread") target_link_libraries(${APP_NAME} PRIVATE m) diff --git a/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt b/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt index 9e0ef2243..93bec6a81 100644 --- a/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt +++ b/test/lib_ic/test_calc_vnr_pred/CMakeLists.txt @@ -44,7 +44,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - core::xs3_math) + lib_xcore_math) target_link_libraries(${APP_NAME} PRIVATE "-lpthread") target_link_libraries(${APP_NAME} PRIVATE m) diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt index 9a118529d..02cbc0720 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/CMakeLists.txt @@ -71,7 +71,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - core::xs3_math) + lib_xcore_math) target_link_libraries(${APP_NAME} PRIVATE "-lpthread") target_link_libraries(${APP_NAME} PRIVATE m) diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py index f3e2acfbd..d6f330066 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py @@ -15,7 +15,7 @@ def test_vnr_priv_make_slice(target, tflite_model): input_data = np.empty(0, dtype=np.int32) input_words_per_frame = fp.FRAME_ADVANCE + 1 #No. of int32 values sent to dut as input per frame - output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS fixed_s32_t values. Exponent fixed to -24 + output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS int32_t values. Exponent fixed to -24 fd_frame_len = int(fp.NFFT/2 + 1) input_data = np.append(input_data, np.array([input_words_per_frame, output_words_per_frame], dtype=np.int32)) diff --git a/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt index db084bad3..0d71ac5c1 100644 --- a/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/full/CMakeLists.txt @@ -64,7 +64,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - core::xs3_math) + lib_xcore_math) target_link_libraries(${APP_NAME} PRIVATE "-lpthread") target_link_libraries(${APP_NAME} PRIVATE m) diff --git a/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt b/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt index 5a4877756..43b7fadbb 100644 --- a/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt +++ b/test/lib_vnr/vnr_unit_tests/inference/CMakeLists.txt @@ -63,7 +63,7 @@ foreach(testfile ${TEST_SOURCES}) target_link_libraries(${APP_NAME} PUBLIC - core::xs3_math) + lib_xcore_math) target_link_libraries(${APP_NAME} PRIVATE "-lpthread") target_link_libraries(${APP_NAME} PRIVATE m) diff --git a/test/test_hpf/CMakeLists.txt b/test/test_hpf/CMakeLists.txt index 662e15863..2c5ea6c84 100644 --- a/test/test_hpf/CMakeLists.txt +++ b/test/test_hpf/CMakeLists.txt @@ -63,7 +63,7 @@ foreach( testfile ${TEST_SOURCES} ) target_link_libraries(fwk_voice_${TESTNAME} PUBLIC - core::xs3_math + lib_xcore_math fwk_voice::test::shared::test_utils fwk_voice::test::shared::unity fwk_voice::example::hpf From 3a9971f7029daf37f4c5ff9592bf1c3aa808a7a0 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 10:38:35 -0400 Subject: [PATCH 32/65] update docs to reflect name change from lib_xs3_math to lib_xcore_math --- modules/lib_adec/doc/src/getting_started.rst | 2 +- modules/lib_aec/doc/src/getting_started.rst | 4 ++-- modules/lib_agc/doc/src/getting_started.rst | 2 +- modules/lib_ic/doc/src/getting_started.rst | 4 ++-- modules/lib_ns/doc/src/getting_started.rst | 4 ++-- modules/lib_vnr/doc/src/getting_started.rst | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/lib_adec/doc/src/getting_started.rst b/modules/lib_adec/doc/src/getting_started.rst index 82249f6ad..4a9cbbbde 100644 --- a/modules/lib_adec/doc/src/getting_started.rst +++ b/modules/lib_adec/doc/src/getting_started.rst @@ -6,7 +6,7 @@ Overview ``lib_adec`` is a library which provides functions for measuring and correcting delay offsets between the reference and loudpeaker signals. -``lib_adec`` depends on ``lib_aec`` and ``lib_xs3_math`` libraries. For more details about the ADEC, refer to +``lib_adec`` depends on ``lib_aec`` and ``lib_xcore_math`` libraries. For more details about the ADEC, refer to :ref:`adec_overview` Repository Structure diff --git a/modules/lib_aec/doc/src/getting_started.rst b/modules/lib_aec/doc/src/getting_started.rst index 7d220c46f..d80826ab8 100644 --- a/modules/lib_aec/doc/src/getting_started.rst +++ b/modules/lib_aec/doc/src/getting_started.rst @@ -6,7 +6,7 @@ Overview ``lib_aec`` is a library which provides functions that can be put together to perform Acoustic Echo Cancellation (AEC) on input mic data using the input reference data to model the room echo characteristics. ``lib_aec`` library functions -make use of functionality provided in ``lib_xs3_math`` to perform DSP operations. For more details refer to +make use of functionality provided in ``lib_xcore_math`` to perform DSP operations. For more details refer to :ref:`aec_overview`. Repository Structure @@ -24,7 +24,7 @@ Requirements ``lib_aec`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_aec`` is compiled as a static library as part of -overall ``fwk_voice`` build. It depends on `lib_xs3_math `_. +overall ``fwk_voice`` build. It depends on `lib_xcore_math `_. API Structure ------------- diff --git a/modules/lib_agc/doc/src/getting_started.rst b/modules/lib_agc/doc/src/getting_started.rst index c2bf8715e..3aa90a7ec 100644 --- a/modules/lib_agc/doc/src/getting_started.rst +++ b/modules/lib_agc/doc/src/getting_started.rst @@ -24,7 +24,7 @@ Requirements ``lib_agc`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_agc`` is compiled as a static library as part of the overall -``fwk_voice`` build. It depends on `lib_xs3_math `_. +``fwk_voice`` build. It depends on `lib_xcore_math `_. Getting and Building diff --git a/modules/lib_ic/doc/src/getting_started.rst b/modules/lib_ic/doc/src/getting_started.rst index b1c5d42a6..8b1171503 100644 --- a/modules/lib_ic/doc/src/getting_started.rst +++ b/modules/lib_ic/doc/src/getting_started.rst @@ -7,7 +7,7 @@ Overview ``lib_ic`` is a library which provides functions that together perform Interference Cancellation (IC) on two channel input mic data by adapting to and modelling the room transfer characteristics. ``lib_ic`` library functions make use of functionality provided in ``lib_aec`` for the core normalised LMS blocks which in turn uses -``lib_xs3_math`` to perform DSP low-level optimised operations. For more details refer toc :ref:`ic_overview`. +``lib_xcore_math`` to perform DSP low-level optimised operations. For more details refer toc :ref:`ic_overview`. Repository Structure -------------------- @@ -25,7 +25,7 @@ Requirements ``lib_ic`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_ic`` is compiled as a static library as part of -overall ``fwk_voice`` build. It depends on ``lib_aec`` and ``lib_xs3_math``. +overall ``fwk_voice`` build. It depends on ``lib_aec`` and ``lib_xcore_math``. API Structure ------------- diff --git a/modules/lib_ns/doc/src/getting_started.rst b/modules/lib_ns/doc/src/getting_started.rst index 0c5fffdcc..9f328e032 100644 --- a/modules/lib_ns/doc/src/getting_started.rst +++ b/modules/lib_ns/doc/src/getting_started.rst @@ -6,7 +6,7 @@ Overview ``lib_ns`` is a library which performs Noise Suppression (NS), by estimating the noise and subtracting it from frame. ``lib_ns`` library functions make use of functionality -provided in ``lib_xs3_math`` to perform DSP operations. For more details, refer to :ref:`ns_overview`. +provided in ``lib_xcore_math`` to perform DSP operations. For more details, refer to :ref:`ns_overview`. Repository Structure @@ -25,7 +25,7 @@ Requirements ``lib_ns`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_ns`` is compiled as a static library as part of the overall -``fwk_voice`` build. It depends on `lib_xs3_math `_. +``fwk_voice`` build. It depends on `lib_xcore_math `_. Getting and Building diff --git a/modules/lib_vnr/doc/src/getting_started.rst b/modules/lib_vnr/doc/src/getting_started.rst index c190335c2..b460a995f 100644 --- a/modules/lib_vnr/doc/src/getting_started.rst +++ b/modules/lib_vnr/doc/src/getting_started.rst @@ -7,7 +7,7 @@ Overview -------- ``lib_vnr`` is a library which estimates the ratio of speech signal in noise for an input audio stream. -``lib_vnr`` library functions uses ``lib_xs3_math`` to perform DSP using low-level optimised operations, and ``lib_tflite_micro`` and ``lib_nn`` to perform inference using an optimised TensorFlow Lite model. +``lib_vnr`` library functions uses ``lib_xcore_math`` to perform DSP using low-level optimised operations, and ``lib_tflite_micro`` and ``lib_nn`` to perform inference using an optimised TensorFlow Lite model. Repository Structure -------------------- @@ -23,7 +23,7 @@ Repository Structure Requirements ------------ -``lib_vnr`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. It depends on ``lib_xs3_math``, ``lib_tflite_micro`` and ``lib_nn``. +``lib_vnr`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. It depends on ``lib_xcore_math``, ``lib_tflite_micro`` and ``lib_nn``. API Structure ------------- From 94c7c6e55c9f4a83fd8e0eb08d3b1544a3e1487d Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 12:27:47 -0400 Subject: [PATCH 33/65] fixed test build --- examples/bare-metal/aec_1_thread/src/main.xc | 2 +- examples/bare-metal/aec_2_threads/src/main.xc | 2 +- examples/bare-metal/ic/src/ic_test_task.c | 4 +- examples/bare-metal/ic/src/main.xc | 2 +- .../pipeline_multi_threaded/src/pipeline.c | 2 +- .../src/pipeline_state.h | 2 +- .../pipeline_multi_threaded/src/test_wav.c | 2 +- .../pipeline_single_threaded/src/pipeline.c | 2 +- .../pipeline_single_threaded/src/test_wav.c | 2 +- .../shared_src/aec/aec_memory_pool.h | 2 +- examples/bare-metal/shared_src/hpf/hpf.c | 6 +- examples/bare-metal/shared_src/hpf/hpf.h | 2 +- .../shared_src/pipeline_stage_1/stage_1.c | 2 +- examples/bare-metal/vnr/src/main.c | 2 +- modules/lib_adec/src/de_impl.c | 2 +- modules/lib_aec/src/aec_impl.c | 2 +- modules/lib_agc/api/agc_api.h | 2 +- modules/lib_agc/api/agc_profiles.h | 72 +++++++++---------- modules/lib_agc/src/agc_defines.h | 2 +- .../python/utils/mel/gen_mel_filters.py | 2 +- .../lib_vnr/src/features/vnr_features_priv.c | 2 +- test/lib_adec/test_wav_adec/src/pipeline.c | 2 +- test/lib_adec/test_wav_adec/src/test_wav.c | 2 +- .../src/test_compare_filters_and_calc_mu.c | 2 +- .../src/test_detect_input_activity.c | 2 +- .../src/test_update_td_ema_energy.c | 2 +- .../src/test_input_output.c | 2 +- .../src/test_lc_transitions.c | 8 +-- .../src/test_loss_control.c | 22 +++--- .../src/test_lower_threshold.c | 6 +- .../test_process_frame/src/test_max_gain.c | 12 ++-- .../test_process_frame/src/test_min_gain.c | 12 ++-- .../test_process_frame/src/test_no_gain.c | 4 +- .../src/test_process_frame.h | 36 +++++----- .../test_process_frame/src/test_reset.c | 2 +- .../test_process_frame/src/test_simple_gain.c | 4 +- .../src/test_soft_clipping.c | 8 +-- .../src/test_upper_threshold.c | 4 +- .../test_process_frame/src/test_vnr_flag.c | 12 ++-- .../py_c_frame_compare/build_ic_frame_proc.py | 8 +-- .../py_c_frame_compare/extract_state.py | 12 ++-- test/lib_ic/test_bad_state/src/main.c | 2 +- test/lib_ic/test_bad_state/src/main.xc | 2 +- .../src/test_apply_window/test_apply_window.c | 2 +- .../src/test_form_output/test_form_output.c | 2 +- .../src/test_minimum/test_minimum.c | 2 +- .../src/test_pack_input/test_pack_input.c | 2 +- .../test_rescale_vector/test_rescale_vector.c | 6 +- .../test_subtract_lambda_from_frame.c | 2 +- .../src/test_update_S/test_update_S.c | 2 +- .../test_update_alpha_d_tilde.c | 2 +- .../test_update_lambda_hat.c | 2 +- .../src/test_update_p/test_update_p.c | 2 +- test/lib_ns/test_wav_ns/src/main.xc | 2 +- .../build_vnr_feature_extraction.py | 8 +-- .../py_c_feature_compare/extract_state.py | 12 ++-- test/lib_vnr/test_wav_vnr/src/main.xc | 2 +- .../feature_extraction/src/main.xc | 2 +- .../feature_extraction/test_utils.py | 2 +- .../feature_extraction/test_vnr_priv_log2.py | 2 +- test/shared/testing/floating_fft.c | 2 +- test/shared/testing/testing.h | 4 +- test/stage_b/build_c_code.py | 8 +-- test/stage_b/extract_state.py | 12 ++-- test/stage_b/ic_vnr_test.c | 4 +- test/test_hpf/src/hpf_test.h | 2 +- test/test_hpf/src/test_hpf_comp_double.c | 2 +- 67 files changed, 185 insertions(+), 187 deletions(-) diff --git a/examples/bare-metal/aec_1_thread/src/main.xc b/examples/bare-metal/aec_1_thread/src/main.xc index 2eb5358eb..e35247e0a 100644 --- a/examples/bare-metal/aec_1_thread/src/main.xc +++ b/examples/bare-metal/aec_1_thread/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void aec_task(const char *input_file_name, const char *output_file_name); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/examples/bare-metal/aec_2_threads/src/main.xc b/examples/bare-metal/aec_2_threads/src/main.xc index 2eb5358eb..e35247e0a 100644 --- a/examples/bare-metal/aec_2_threads/src/main.xc +++ b/examples/bare-metal/aec_2_threads/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void aec_task(const char *input_file_name, const char *output_file_name); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/examples/bare-metal/ic/src/ic_test_task.c b/examples/bare-metal/ic/src/ic_test_task.c index 76ab0a1f1..1465792dc 100644 --- a/examples/bare-metal/ic/src/ic_test_task.c +++ b/examples/bare-metal/ic/src/ic_test_task.c @@ -18,7 +18,7 @@ #include "ic_api.h" -#include "xs3_math.h" +#include "xmath/xmath.h" #include "fileio.h" #include "wav_utils.h" #include "dump_var_py.h" @@ -97,7 +97,7 @@ void ic_task(const char *input_file_name, const char *output_file_name) { #if DISABLE_ADAPTION_CONTROLLER state.ic_adaption_controller_state.adaption_controller_config.adaption_config = IC_ADAPTION_FORCE_ON; - state.leakage_alpha = float_to_float_s32(1.0); //From test_wav_ic + state.leakage_alpha = f32_to_float_s32(1.0); //From test_wav_ic #endif diff --git a/examples/bare-metal/ic/src/main.xc b/examples/bare-metal/ic/src/main.xc index fea60a7ad..5c550d6d4 100644 --- a/examples/bare-metal/ic/src/main.xc +++ b/examples/bare-metal/ic/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void main_tile0(chanend, chanend); void main_tile1(chanend); } diff --git a/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c b/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c index ab83fa6cc..09389be6c 100644 --- a/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c +++ b/examples/bare-metal/pipeline_multi_threaded/src/pipeline.c @@ -104,7 +104,7 @@ void pipeline_stage_2(chanend_t c_frame_in, chanend_t c_frame_out) { // Initialise IC and VNR ic_state_t DWORD_ALIGNED ic_state; float_s32_t input_vnr_pred, output_vnr_pred; - float_s32_t agc_vnr_threshold = float_to_float_s32(VNR_AGC_THRESHOLD); + float_s32_t agc_vnr_threshold = f32_to_float_s32(VNR_AGC_THRESHOLD); ic_init(&ic_state); int32_t DWORD_ALIGNED frame[AP_MAX_Y_CHANNELS][AP_FRAME_ADVANCE]; diff --git a/examples/bare-metal/pipeline_multi_threaded/src/pipeline_state.h b/examples/bare-metal/pipeline_multi_threaded/src/pipeline_state.h index 67abe1763..ee60ff719 100644 --- a/examples/bare-metal/pipeline_multi_threaded/src/pipeline_state.h +++ b/examples/bare-metal/pipeline_multi_threaded/src/pipeline_state.h @@ -2,7 +2,7 @@ #define AP_STAGE_A_STATE_H #include "pipeline_config.h" -#include "xs3_math.h" +#include "xmath/xmath.h" typedef struct { float_s32_t max_ref_energy; diff --git a/examples/bare-metal/pipeline_multi_threaded/src/test_wav.c b/examples/bare-metal/pipeline_multi_threaded/src/test_wav.c index 448f27193..9037763b0 100644 --- a/examples/bare-metal/pipeline_multi_threaded/src/test_wav.c +++ b/examples/bare-metal/pipeline_multi_threaded/src/test_wav.c @@ -5,7 +5,7 @@ #include #include #include -#include "xs3_math.h" +#include "xmath/xmath.h" #include "fileio.h" #include "wav_utils.h" diff --git a/examples/bare-metal/pipeline_single_threaded/src/pipeline.c b/examples/bare-metal/pipeline_single_threaded/src/pipeline.c index d4aa8d59a..5a1b8492e 100644 --- a/examples/bare-metal/pipeline_single_threaded/src/pipeline.c +++ b/examples/bare-metal/pipeline_single_threaded/src/pipeline.c @@ -133,7 +133,7 @@ void pipeline_process_frame_tile1(pipeline_state_tile1_t *state, pipeline_metada printf("VNR OUTPUT PRED: %ld %d\n", state->output_vnr_pred.mant, state->output_vnr_pred.exp); printf("VNR INPUT PRED: %ld %d\n", state->input_vnr_pred.mant, state->input_vnr_pred.exp); #endif - float_s32_t agc_vnr_threshold = float_to_float_s32(VNR_AGC_THRESHOLD); + float_s32_t agc_vnr_threshold = f32_to_float_s32(VNR_AGC_THRESHOLD); md.vnr_pred_flag = float_s32_gt(state->output_vnr_pred, agc_vnr_threshold); ic_adapt(&state->ic_state, state->input_vnr_pred); diff --git a/examples/bare-metal/pipeline_single_threaded/src/test_wav.c b/examples/bare-metal/pipeline_single_threaded/src/test_wav.c index 594b3de07..9ea4e2d94 100644 --- a/examples/bare-metal/pipeline_single_threaded/src/test_wav.c +++ b/examples/bare-metal/pipeline_single_threaded/src/test_wav.c @@ -1,4 +1,4 @@ -#include "xs3_math.h" +#include "xmath/xmath.h" #include "fileio.h" #include "wav_utils.h" diff --git a/examples/bare-metal/shared_src/aec/aec_memory_pool.h b/examples/bare-metal/shared_src/aec/aec_memory_pool.h index b17de1736..f8790b281 100644 --- a/examples/bare-metal/shared_src/aec/aec_memory_pool.h +++ b/examples/bare-metal/shared_src/aec/aec_memory_pool.h @@ -3,7 +3,7 @@ #ifndef AEC_MEMORY_POOL_H #define AEC_MEMORY_POOL_H -#include "xs3_math.h" +#include "xmath/xmath.h" //Memory pool definition typedef struct { diff --git a/examples/bare-metal/shared_src/hpf/hpf.c b/examples/bare-metal/shared_src/hpf/hpf.c index 82ba91c58..66927341a 100644 --- a/examples/bare-metal/shared_src/hpf/hpf.c +++ b/examples/bare-metal/shared_src/hpf/hpf.c @@ -6,13 +6,13 @@ // Q30 coefficients for the 100 Hz high pass filter // coefficients were generated here: // https://github.com/xmos/lib_audio_pipelines/blob/develop/lib_audio_pipelines/src/dsp/ap_stage_c.xc#L26 -const fixed_s32_t hpf_coef_q30[TOTAL_NUM_COEFF] = { +const uq2_30 hpf_coef_q30[TOTAL_NUM_COEFF] = { 1020035168, -2040070348, 1020035168, 2070720224, -998576072, 1073741824, -2147483648, 1073741824, 2114066120, -1041955416 }; void pre_agc_hpf(int32_t DWORD_ALIGNED data[AP_FRAME_ADVANCE]){ - xs3_biquad_filter_s32_t filter = {0}; + filter_biquad_s32_t filter = {0}; filter.biquad_count = BIQUAD_COUNT; int i = 0, j = 0; for(int v = 0; v < TOTAL_NUM_COEFF; v++){ @@ -23,7 +23,7 @@ void pre_agc_hpf(int32_t DWORD_ALIGNED data[AP_FRAME_ADVANCE]){ for(int v = 0; v < AP_FRAME_ADVANCE; v++) { // shifting one bit right to match the coeficients format // the output will be in Q30, so we need to shift it one bit left - data[v] = xs3_filter_biquad_s32(&filter, data[v] >> 1); + data[v] = filter_biquad_s32(&filter, data[v] >> 1); } // using bfp because it has saturation logic bfp_s32_t bfp; diff --git a/examples/bare-metal/shared_src/hpf/hpf.h b/examples/bare-metal/shared_src/hpf/hpf.h index dcaff905a..05c57b5f2 100644 --- a/examples/bare-metal/shared_src/hpf/hpf.h +++ b/examples/bare-metal/shared_src/hpf/hpf.h @@ -4,7 +4,7 @@ #ifndef HPF_API_H #define HPF_API_H -#include +#include "xmath/xmath.h" #define AP_FRAME_ADVANCE (240) #define BIQUAD_COUNT (2) #define NUM_COEFF_PER_BIQUAD (5) diff --git a/examples/bare-metal/shared_src/pipeline_stage_1/stage_1.c b/examples/bare-metal/shared_src/pipeline_stage_1/stage_1.c index 8c9cd066a..5555d2793 100644 --- a/examples/bare-metal/shared_src/pipeline_stage_1/stage_1.c +++ b/examples/bare-metal/shared_src/pipeline_stage_1/stage_1.c @@ -51,7 +51,7 @@ static inline void get_delayed_frame( void stage_1_init(stage_1_state_t *state, aec_conf_t *de_conf, aec_conf_t *non_de_conf, adec_config_t *adec_config) { state->delay_estimator_enabled = 0; - state->ref_active_threshold = double_to_float_s32(pow(10, REF_ACTIVE_THRESHOLD_dB/20.0)); //-60dB + state->ref_active_threshold = f64_to_float_s32(pow(10, REF_ACTIVE_THRESHOLD_dB/20.0)); //-60dB state->hold_aec_count = 0; //No. of consecutive frames reference has been absent for state->hold_aec_limit = (16000*HOLD_AEC_LIMIT_SECONDS)/AP_FRAME_ADVANCE; //bypass AEC only when reference has been absent for atleast 3 seconds (200 frames) diff --git a/examples/bare-metal/vnr/src/main.c b/examples/bare-metal/vnr/src/main.c index 014a9778a..72a0f633e 100644 --- a/examples/bare-metal/vnr/src/main.c +++ b/examples/bare-metal/vnr/src/main.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" void get_frame(chanend_t xscope_chan, chanend_t c_frame_out){ diff --git a/modules/lib_adec/src/de_impl.c b/modules/lib_adec/src/de_impl.c index 615b87d06..37d80be88 100644 --- a/modules/lib_adec/src/de_impl.c +++ b/modules/lib_adec/src/de_impl.c @@ -9,7 +9,7 @@ void adec_estimate_delay ( const bfp_complex_s32_t* H_hat, unsigned num_phases) { - //Direct manipulation of mant/exp because double_to_float_s32(0.0) takes hundreds of cycles + //Direct manipulation of mant/exp because f64_to_float_s32(0.0) takes hundreds of cycles const float_s32_t zero = {0, 0}; const float_s32_t one = {1, 0}; diff --git a/modules/lib_aec/src/aec_impl.c b/modules/lib_aec/src/aec_impl.c index 6b4737bf2..f9037b070 100644 --- a/modules/lib_aec/src/aec_impl.c +++ b/modules/lib_aec/src/aec_impl.c @@ -137,7 +137,7 @@ void aec_forward_fft( //This is done to avoid having to call bfp_s32_init() on the input every frame uint32_t len = input->length; bfp_complex_s32_t *temp = bfp_fft_forward_mono(input); - temp->hr = bfp_complex_s32_headroom(temp); // TODO Workaround till https://github.com/xmos/lib_xs3_math/issues/96 is fixed + temp->hr = bfp_complex_s32_headroom(temp); // TODO Workaround till https://github.com/xmos/lib_xcore_math/issues/96 is fixed memcpy(output, temp, sizeof(bfp_complex_s32_t)); bfp_fft_unpack_mono(output); diff --git a/modules/lib_agc/api/agc_api.h b/modules/lib_agc/api/agc_api.h index 34f4116c1..815de7735 100644 --- a/modules/lib_agc/api/agc_api.h +++ b/modules/lib_agc/api/agc_api.h @@ -148,7 +148,7 @@ typedef struct { * @par Example with modification to the profile * @code{.c} * agc_config_t conf = AGC_PROFILE_FIXED_GAIN; - conf.gain = float_to_float_s32(100); + conf.gain = f32_to_float_s32(100); agc_state_t agc; agc_init(&agc, &conf); * @endcode diff --git a/modules/lib_agc/api/agc_profiles.h b/modules/lib_agc/api/agc_profiles.h index 8917347ba..033f9657d 100644 --- a/modules/lib_agc/api/agc_profiles.h +++ b/modules/lib_agc/api/agc_profiles.h @@ -28,27 +28,27 @@ .adapt = 1, \ .adapt_on_vnr = 1, \ .soft_clipping = 1, \ - .gain = float_to_float_s32(500), \ - .max_gain = float_to_float_s32(1000), \ - .min_gain = float_to_float_s32(0), \ - .upper_threshold = float_to_float_s32(0.9999), \ - .lower_threshold = float_to_float_s32(0.7000), \ - .gain_inc = float_to_float_s32(1.197), \ - .gain_dec = float_to_float_s32(0.87), \ + .gain = f32_to_float_s32(500), \ + .max_gain = f32_to_float_s32(1000), \ + .min_gain = f32_to_float_s32(0), \ + .upper_threshold = f32_to_float_s32(0.9999), \ + .lower_threshold = f32_to_float_s32(0.7000), \ + .gain_inc = f32_to_float_s32(1.197), \ + .gain_dec = f32_to_float_s32(0.87), \ .lc_enabled = 0, \ .lc_n_frame_far = 0, \ .lc_n_frame_near = 0, \ - .lc_corr_threshold = float_to_float_s32(0), \ - .lc_bg_power_gamma = float_to_float_s32(0), \ - .lc_gamma_inc = float_to_float_s32(0), \ - .lc_gamma_dec = float_to_float_s32(0), \ - .lc_far_delta = float_to_float_s32(0), \ - .lc_near_delta = float_to_float_s32(0), \ - .lc_near_delta_far_active = float_to_float_s32(0), \ - .lc_gain_max = float_to_float_s32(0), \ - .lc_gain_double_talk = float_to_float_s32(0), \ - .lc_gain_silence = float_to_float_s32(0), \ - .lc_gain_min = float_to_float_s32(0), \ + .lc_corr_threshold = f32_to_float_s32(0), \ + .lc_bg_power_gamma = f32_to_float_s32(0), \ + .lc_gamma_inc = f32_to_float_s32(0), \ + .lc_gamma_dec = f32_to_float_s32(0), \ + .lc_far_delta = f32_to_float_s32(0), \ + .lc_near_delta = f32_to_float_s32(0), \ + .lc_near_delta_far_active = f32_to_float_s32(0), \ + .lc_gain_max = f32_to_float_s32(0), \ + .lc_gain_double_talk = f32_to_float_s32(0), \ + .lc_gain_silence = f32_to_float_s32(0), \ + .lc_gain_min = f32_to_float_s32(0), \ } /** @@ -60,27 +60,27 @@ .adapt = 0, \ .adapt_on_vnr = 0, \ .soft_clipping = 0, \ - .gain = float_to_float_s32(25), \ - .max_gain = float_to_float_s32(0), \ - .min_gain = float_to_float_s32(0), \ - .upper_threshold = float_to_float_s32(0), \ - .lower_threshold = float_to_float_s32(0), \ - .gain_inc = float_to_float_s32(0), \ - .gain_dec = float_to_float_s32(0), \ + .gain = f32_to_float_s32(25), \ + .max_gain = f32_to_float_s32(0), \ + .min_gain = f32_to_float_s32(0), \ + .upper_threshold = f32_to_float_s32(0), \ + .lower_threshold = f32_to_float_s32(0), \ + .gain_inc = f32_to_float_s32(0), \ + .gain_dec = f32_to_float_s32(0), \ .lc_enabled = 0, \ .lc_n_frame_far = 0, \ .lc_n_frame_near = 0, \ - .lc_corr_threshold = float_to_float_s32(0), \ - .lc_bg_power_gamma = float_to_float_s32(0), \ - .lc_gamma_inc = float_to_float_s32(0), \ - .lc_gamma_dec = float_to_float_s32(0), \ - .lc_far_delta = float_to_float_s32(0), \ - .lc_near_delta = float_to_float_s32(0), \ - .lc_near_delta_far_active = float_to_float_s32(0), \ - .lc_gain_max = float_to_float_s32(0), \ - .lc_gain_double_talk = float_to_float_s32(0), \ - .lc_gain_silence = float_to_float_s32(0), \ - .lc_gain_min = float_to_float_s32(0), \ + .lc_corr_threshold = f32_to_float_s32(0), \ + .lc_bg_power_gamma = f32_to_float_s32(0), \ + .lc_gamma_inc = f32_to_float_s32(0), \ + .lc_gamma_dec = f32_to_float_s32(0), \ + .lc_far_delta = f32_to_float_s32(0), \ + .lc_near_delta = f32_to_float_s32(0), \ + .lc_near_delta_far_active = f32_to_float_s32(0), \ + .lc_gain_max = f32_to_float_s32(0), \ + .lc_gain_double_talk = f32_to_float_s32(0), \ + .lc_gain_silence = f32_to_float_s32(0), \ + .lc_gain_min = f32_to_float_s32(0), \ } diff --git a/modules/lib_agc/src/agc_defines.h b/modules/lib_agc/src/agc_defines.h index 5ae34e052..b7274e787 100644 --- a/modules/lib_agc/src/agc_defines.h +++ b/modules/lib_agc/src/agc_defines.h @@ -8,7 +8,7 @@ // The input and output frame data format is Q1.31 #define FRAME_EXP -31 -// Pre-calculated values to avoid the cycles of float_to_float_s32() +// Pre-calculated values to avoid the cycles of f32_to_float_s32() #define FLOAT_S32_ZERO (float_s32_t){0, -31} #define FLOAT_S32_ONE (float_s32_t){1073741824, -30} diff --git a/modules/lib_vnr/python/utils/mel/gen_mel_filters.py b/modules/lib_vnr/python/utils/mel/gen_mel_filters.py index f07f9566f..ee00926e4 100644 --- a/modules/lib_vnr/python/utils/mel/gen_mel_filters.py +++ b/modules/lib_vnr/python/utils/mel/gen_mel_filters.py @@ -189,7 +189,7 @@ def gen_c_src(self, var_name): c_text += "\n" c_text += f"#include " c_text += "\n" - c_text += f"#include " + c_text += f"#include " c_text += "\n" c_text += f"#define AUDIO_FEATURES_NUM_MELS {self.num_mels}\n"; c_text += f"#define AUDIO_FEATURES_NUM_BINS {self.num_bins}\n"; diff --git a/modules/lib_vnr/src/features/vnr_features_priv.c b/modules/lib_vnr/src/features/vnr_features_priv.c index 348a2b571..0d4b18767 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.c +++ b/modules/lib_vnr/src/features/vnr_features_priv.c @@ -19,7 +19,7 @@ void vnr_priv_forward_fft(bfp_complex_s32_t *X, int32_t *x_data) { } #endif //printf("post fft hr = reported %d, actual %d\n",temp->hr, bfp_complex_s32_headroom(temp)); - temp->hr = bfp_complex_s32_headroom(temp); // TODO Workaround till https://github.com/xmos/lib_xs3_math/issues/96 is fixed + temp->hr = bfp_complex_s32_headroom(temp); // TODO Workaround till https://github.com/xmos/lib_xcore_math/issues/96 is fixed bfp_fft_unpack_mono(temp); memcpy(X, temp, sizeof(bfp_complex_s32_t)); } diff --git a/test/lib_adec/test_wav_adec/src/pipeline.c b/test/lib_adec/test_wav_adec/src/pipeline.c index 8d735c4b2..c3d3d8b90 100644 --- a/test/lib_adec/test_wav_adec/src/pipeline.c +++ b/test/lib_adec/test_wav_adec/src/pipeline.c @@ -47,7 +47,7 @@ void pipeline_init(pipeline_state_t *state, aec_conf_t *de_conf, aec_conf_t *non prof(0, "start_pipeline_init"); //Start profiling after memset since the pipeline components do the memset as part of their init functions. state->delay_estimator_enabled = 0; state->adec_requested_delay_samples = 0; - state->ref_active_threshold = double_to_float_s32(pow(10, -60/20.0)); + state->ref_active_threshold = f64_to_float_s32(pow(10, -60/20.0)); // Initialise default delay values delay_buffer_init(&state->delay_state, 0/*Initialise with 0 delay_samples*/); diff --git a/test/lib_adec/test_wav_adec/src/test_wav.c b/test/lib_adec/test_wav_adec/src/test_wav.c index 179b324ac..5ffc27218 100644 --- a/test/lib_adec/test_wav_adec/src/test_wav.c +++ b/test/lib_adec/test_wav_adec/src/test_wav.c @@ -1,4 +1,4 @@ -#include "xs3_math.h" +#include "xmath/xmath.h" #include "fileio.h" #include "wav_utils.h" #include "aec_config.h" diff --git a/test/lib_aec/aec_unit_tests/src/test_compare_filters_and_calc_mu.c b/test/lib_aec/aec_unit_tests/src/test_compare_filters_and_calc_mu.c index aff8f488f..f87dde9b0 100644 --- a/test/lib_aec/aec_unit_tests/src/test_compare_filters_and_calc_mu.c +++ b/test/lib_aec/aec_unit_tests/src/test_compare_filters_and_calc_mu.c @@ -707,7 +707,7 @@ void test_compare_filters_and_calc_mu() { //set coh to a number between CC_thres and coh_slow for code coverage of an if condition for(int ch=0; chy_channels; ch++) { params_fp->coh[ch] = CC_thres + (params_fp->coh_slow[ch] - CC_thres)/(3.15 + params_fp->coh[ch]); - main_state.shared_state->coh_mu_state[ch].coh = double_to_float_s32(params_fp->coh[ch]); + main_state.shared_state->coh_mu_state[ch].coh = f64_to_float_s32(params_fp->coh[ch]); } } //mu_scalar diff --git a/test/lib_aec/aec_unit_tests/src/test_detect_input_activity.c b/test/lib_aec/aec_unit_tests/src/test_detect_input_activity.c index 90afad0a7..e0f736fab 100644 --- a/test/lib_aec/aec_unit_tests/src/test_detect_input_activity.c +++ b/test/lib_aec/aec_unit_tests/src/test_detect_input_activity.c @@ -37,7 +37,7 @@ void test_detect_input_activity() { double active_threshold_dB = -60; double ref_active_threshold = pow(10, active_threshold_dB/20.0); - float_s32_t dut_active_threshold = double_to_float_s32(ref_active_threshold); + float_s32_t dut_active_threshold = f64_to_float_s32(ref_active_threshold); uint32_t seed = 43554; diff --git a/test/lib_aec/aec_unit_tests/src/test_update_td_ema_energy.c b/test/lib_aec/aec_unit_tests/src/test_update_td_ema_energy.c index 39d6b3db2..58765ffbb 100644 --- a/test/lib_aec/aec_unit_tests/src/test_update_td_ema_energy.c +++ b/test/lib_aec/aec_unit_tests/src/test_update_td_ema_energy.c @@ -55,7 +55,7 @@ void test_update_td_ema_energy() { } //alpha - fixed_s32_t alpha_q30; + uq2_30 alpha_q30; alpha_q30 = pseudo_rand_uint32(&seed) >> 1; //alpha_q30 = 1063004405; double alpha_fp = ldexp(alpha_q30, -30); diff --git a/test/lib_agc/test_process_frame/src/test_input_output.c b/test/lib_agc/test_process_frame/src/test_input_output.c index 675249f73..6fa2c1a01 100644 --- a/test/lib_agc/test_process_frame/src/test_input_output.c +++ b/test/lib_agc/test_process_frame/src/test_input_output.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // This test checks that agc_process_frame() can be safely performed in-place on the input diff --git a/test/lib_agc/test_process_frame/src/test_lc_transitions.c b/test/lib_agc/test_process_frame/src/test_lc_transitions.c index 5b094a922..345bc5c5e 100644 --- a/test/lib_agc/test_process_frame/src/test_lc_transitions.c +++ b/test/lib_agc/test_process_frame/src/test_lc_transitions.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // Frames of random data are processed by an AGC instance, which has its meta-data set to @@ -64,7 +64,7 @@ static void perform_transition(agc_state_t *agc, struct lc_test_params *params, md.vnr_flag = AGC_META_DATA_NO_VNR; // Scale input frame by 0.5 to avoid AGC adaption upper threshold - float_s32_t scale = float_to_float_s32(0.5 * params->silence_scale); + float_s32_t scale = f32_to_float_s32(0.5 * params->silence_scale); for (unsigned frame = 0; frame < TRANSITION_FRAMES; ++frame) { for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { @@ -76,8 +76,8 @@ static void perform_transition(agc_state_t *agc, struct lc_test_params *params, float_s32_t input_energy = float_s64_to_float_s32(bfp_s32_energy(&input_bfp)); - md.aec_ref_power = float_s32_mul(input_energy, float_to_float_s32(params->power_scale)); - md.aec_corr_factor = float_to_float_s32(params->correlation); + md.aec_ref_power = float_s32_mul(input_energy, f32_to_float_s32(params->power_scale)); + md.aec_corr_factor = f32_to_float_s32(params->correlation); agc_process_frame(agc, output, input, &md); // Return here if successfully transitioned to the expected state diff --git a/test/lib_agc/test_process_frame/src/test_loss_control.c b/test/lib_agc/test_process_frame/src/test_loss_control.c index 39d059981..575d08d8c 100644 --- a/test/lib_agc/test_process_frame/src/test_loss_control.c +++ b/test/lib_agc/test_process_frame/src/test_loss_control.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // Frames of random data are created and processed by four independent instances of the AGC @@ -36,7 +36,7 @@ void test_loss_control() { agc_meta_data_t md_near; md_near.vnr_flag = AGC_META_DATA_NO_VNR; - md_near.aec_corr_factor = float_to_float_s32(TEST_LC_NEAR_CORR); + md_near.aec_corr_factor = f32_to_float_s32(TEST_LC_NEAR_CORR); agc_state_t agc_far; agc_config_t conf_far = AGC_PROFILE_COMMS; @@ -44,7 +44,7 @@ void test_loss_control() { agc_meta_data_t md_far; md_far.vnr_flag = AGC_META_DATA_NO_VNR; - md_far.aec_corr_factor = float_to_float_s32(TEST_LC_FAR_CORR); + md_far.aec_corr_factor = f32_to_float_s32(TEST_LC_FAR_CORR); agc_state_t agc_double_talk; agc_config_t conf_double_talk = AGC_PROFILE_COMMS; @@ -52,7 +52,7 @@ void test_loss_control() { agc_meta_data_t md_double_talk; md_double_talk.vnr_flag = AGC_META_DATA_NO_VNR; - md_double_talk.aec_corr_factor = float_to_float_s32(TEST_LC_DT_CORR); + md_double_talk.aec_corr_factor = f32_to_float_s32(TEST_LC_DT_CORR); agc_state_t agc_silence; agc_config_t conf_silence = AGC_PROFILE_COMMS; @@ -60,11 +60,11 @@ void test_loss_control() { agc_meta_data_t md_silence; md_silence.vnr_flag = AGC_META_DATA_NO_VNR; - md_silence.aec_corr_factor = float_to_float_s32(TEST_LC_SILENCE_CORR); + md_silence.aec_corr_factor = f32_to_float_s32(TEST_LC_SILENCE_CORR); // Scale the input by 0.5 to avoid the AGC adaption upper threshold - float_s32_t scale = float_to_float_s32(0.5); - float_s32_t scale_silence = float_to_float_s32(TEST_LC_SILENCE_SCALE); + float_s32_t scale = f32_to_float_s32(0.5); + float_s32_t scale_silence = f32_to_float_s32(TEST_LC_SILENCE_SCALE); unsigned num_frames = conf_near.lc_n_frame_far; if (num_frames < conf_near.lc_n_frame_near) { @@ -87,20 +87,20 @@ void test_loss_control() { float_s32_t input_energy = float_s64_to_float_s32(bfp_s32_energy(&input_bfp)); - md_near.aec_ref_power = float_s32_mul(input_energy, float_to_float_s32(TEST_LC_NEAR_POWER_SCALE)); + md_near.aec_ref_power = float_s32_mul(input_energy, f32_to_float_s32(TEST_LC_NEAR_POWER_SCALE)); agc_process_frame(&agc_near, output_near, input, &md_near); - md_far.aec_ref_power = float_s32_mul(input_energy, float_to_float_s32(TEST_LC_FAR_POWER_SCALE)); + md_far.aec_ref_power = float_s32_mul(input_energy, f32_to_float_s32(TEST_LC_FAR_POWER_SCALE)); agc_process_frame(&agc_far, output_far, input, &md_far); - md_double_talk.aec_ref_power = float_s32_mul(input_energy, float_to_float_s32(TEST_LC_DT_POWER_SCALE)); + md_double_talk.aec_ref_power = float_s32_mul(input_energy, f32_to_float_s32(TEST_LC_DT_POWER_SCALE)); agc_process_frame(&agc_double_talk, output_double_talk, input, &md_double_talk); bfp_s32_scale(&input_bfp, &input_bfp, scale_silence); bfp_s32_use_exponent(&input_bfp, FRAME_EXP); input_energy = float_s64_to_float_s32(bfp_s32_energy(&input_bfp)); - md_silence.aec_ref_power = float_s32_mul(input_energy, float_to_float_s32(TEST_LC_SILENCE_POWER_SCALE)); + md_silence.aec_ref_power = float_s32_mul(input_energy, f32_to_float_s32(TEST_LC_SILENCE_POWER_SCALE)); agc_process_frame(&agc_silence, output_silence, input, &md_silence); } diff --git a/test/lib_agc/test_process_frame/src/test_lower_threshold.c b/test/lib_agc/test_process_frame/src/test_lower_threshold.c index fd07e7512..c897feac0 100644 --- a/test/lib_agc/test_process_frame/src/test_lower_threshold.c +++ b/test/lib_agc/test_process_frame/src/test_lower_threshold.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // A single iteration of this test generates frames of random data and processes them with @@ -37,11 +37,11 @@ void test_lower_threshold() { // Max gain is 1000, so scale the input by a factor larger than 1/1000 from the // lower_threshold which the AGC is trying to exceed. - float_s32_t scale = float_s32_mul(float_to_float_s32(0.0011), conf.lower_threshold); + float_s32_t scale = float_s32_mul(f32_to_float_s32(0.0011), conf.lower_threshold); float_s32_t lower_threshold; if(conf.soft_clipping){ //Soft clipping limits gain a bit at top end - lower_threshold = float_s32_mul(conf.lower_threshold, float_to_float_s32(0.90)); + lower_threshold = float_s32_mul(conf.lower_threshold, f32_to_float_s32(0.90)); }else{ lower_threshold = conf.lower_threshold; } diff --git a/test/lib_agc/test_process_frame/src/test_max_gain.c b/test/lib_agc/test_process_frame/src/test_max_gain.c index 11e5eebe2..313877a28 100644 --- a/test/lib_agc/test_process_frame/src/test_max_gain.c +++ b/test/lib_agc/test_process_frame/src/test_max_gain.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // The AGC is configured with a gain that is greater than the maximum gain setting. The @@ -26,10 +26,10 @@ void test_max_gain() { conf.adapt_on_vnr = 0; conf.soft_clipping = 0; conf.lc_enabled = 0; - conf.max_gain = float_to_float_s32(TEST_MAX_GAIN); + conf.max_gain = f32_to_float_s32(TEST_MAX_GAIN); // Set the upper and lower thresholds to extremes to avoid interfering - conf.lower_threshold = float_to_float_s32(0); - conf.upper_threshold = float_to_float_s32(1); + conf.lower_threshold = f32_to_float_s32(0); + conf.upper_threshold = f32_to_float_s32(1); agc_init(&agc, &conf); agc_meta_data_t md; @@ -41,11 +41,11 @@ void test_max_gain() { unsigned seed = 4747; // Scale the input down by the maximum gain so there is room to increase it fully - float_s32_t scale = float_s32_div(float_to_float_s32(1), conf.max_gain); + float_s32_t scale = float_s32_div(f32_to_float_s32(1), conf.max_gain); for (unsigned iter = 0; iter < (1<<12)/F; ++iter) { // Reset the gain for each frame - agc.config.gain = float_to_float_s32(TEST_GAIN); + agc.config.gain = f32_to_float_s32(TEST_GAIN); for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { input[idx] = pseudo_rand_int32(&seed); diff --git a/test/lib_agc/test_process_frame/src/test_min_gain.c b/test/lib_agc/test_process_frame/src/test_min_gain.c index 1e1262007..91aa74ce4 100644 --- a/test/lib_agc/test_process_frame/src/test_min_gain.c +++ b/test/lib_agc/test_process_frame/src/test_min_gain.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // The AGC is configured with a gain that is less than the minimum gain setting. The @@ -26,10 +26,10 @@ void test_min_gain() { conf.adapt_on_vnr = 0; conf.soft_clipping = 0; conf.lc_enabled = 0; - conf.min_gain = float_to_float_s32(TEST_MIN_GAIN); + conf.min_gain = f32_to_float_s32(TEST_MIN_GAIN); // Set the upper and lower thresholds to extremes to avoid interfering - conf.lower_threshold = float_to_float_s32(0); - conf.upper_threshold = float_to_float_s32(1); + conf.lower_threshold = f32_to_float_s32(0); + conf.upper_threshold = f32_to_float_s32(1); agc_init(&agc, &conf); agc_meta_data_t md; @@ -41,11 +41,11 @@ void test_min_gain() { unsigned seed = 9608; // Scale the input down by the min_gain so there is room to increase it fully - float_s32_t scale = float_s32_div(float_to_float_s32(1), conf.min_gain); + float_s32_t scale = float_s32_div(f32_to_float_s32(1), conf.min_gain); for (unsigned iter = 0; iter < (1<<12)/F; ++iter) { // Reset the gain for each frame - agc.config.gain = float_to_float_s32(TEST_GAIN); + agc.config.gain = f32_to_float_s32(TEST_GAIN); for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { input[idx] = pseudo_rand_int32(&seed); diff --git a/test/lib_agc/test_process_frame/src/test_no_gain.c b/test/lib_agc/test_process_frame/src/test_no_gain.c index bb8ceac22..fb45ba750 100644 --- a/test/lib_agc/test_process_frame/src/test_no_gain.c +++ b/test/lib_agc/test_process_frame/src/test_no_gain.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // In this test, the AGC is configured to use a fixed gain of 1, so no gain is expected to be @@ -18,7 +18,7 @@ void test_no_gain() { agc_state_t agc; agc_config_t conf = AGC_PROFILE_FIXED_GAIN; - conf.gain = float_to_float_s32(1); + conf.gain = f32_to_float_s32(1); agc_init(&agc, &conf); agc_meta_data_t md; diff --git a/test/lib_agc/test_process_frame/src/test_process_frame.h b/test/lib_agc/test_process_frame/src/test_process_frame.h index c9d4c9d0a..54bb28e35 100644 --- a/test/lib_agc/test_process_frame/src/test_process_frame.h +++ b/test/lib_agc/test_process_frame/src/test_process_frame.h @@ -16,27 +16,27 @@ .adapt = 1, \ .adapt_on_vnr = 1, \ .soft_clipping = 1, \ - .gain = float_to_float_s32(500), \ - .max_gain = float_to_float_s32(1000), \ - .min_gain = float_to_float_s32(0), \ - .upper_threshold = float_to_float_s32(0.4), \ - .lower_threshold = float_to_float_s32(0.4), \ - .gain_inc = float_to_float_s32(1.0034), \ - .gain_dec = float_to_float_s32(0.98804), \ + .gain = f32_to_float_s32(500), \ + .max_gain = f32_to_float_s32(1000), \ + .min_gain = f32_to_float_s32(0), \ + .upper_threshold = f32_to_float_s32(0.4), \ + .lower_threshold = f32_to_float_s32(0.4), \ + .gain_inc = f32_to_float_s32(1.0034), \ + .gain_dec = f32_to_float_s32(0.98804), \ .lc_enabled = 1, \ .lc_n_frame_far = 17, \ .lc_n_frame_near = 34, \ - .lc_corr_threshold = float_to_float_s32(0.993), \ - .lc_bg_power_gamma = float_to_float_s32(1.002), \ - .lc_gamma_inc = float_to_float_s32(1.005), \ - .lc_gamma_dec = float_to_float_s32(0.995), \ - .lc_far_delta = float_to_float_s32(300), \ - .lc_near_delta = float_to_float_s32(50), \ - .lc_near_delta_far_active = float_to_float_s32(100), \ - .lc_gain_max = float_to_float_s32(1), \ - .lc_gain_double_talk = float_to_float_s32(0.9), \ - .lc_gain_silence = float_to_float_s32(0.1), \ - .lc_gain_min = float_to_float_s32(0.022387), \ + .lc_corr_threshold = f32_to_float_s32(0.993), \ + .lc_bg_power_gamma = f32_to_float_s32(1.002), \ + .lc_gamma_inc = f32_to_float_s32(1.005), \ + .lc_gamma_dec = f32_to_float_s32(0.995), \ + .lc_far_delta = f32_to_float_s32(300), \ + .lc_near_delta = f32_to_float_s32(50), \ + .lc_near_delta_far_active = f32_to_float_s32(100), \ + .lc_gain_max = f32_to_float_s32(1), \ + .lc_gain_double_talk = f32_to_float_s32(0.9), \ + .lc_gain_silence = f32_to_float_s32(0.1), \ + .lc_gain_min = f32_to_float_s32(0.022387), \ } // Set F to an integer greater than 1 to speedup testing (by reducing iterations) by a factor of F times diff --git a/test/lib_agc/test_process_frame/src/test_reset.c b/test/lib_agc/test_process_frame/src/test_reset.c index b212f1248..44c36b90d 100644 --- a/test/lib_agc/test_process_frame/src/test_reset.c +++ b/test/lib_agc/test_process_frame/src/test_reset.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // A number of frames of random data are processed by the AGC, with the first output frame diff --git a/test/lib_agc/test_process_frame/src/test_simple_gain.c b/test/lib_agc/test_process_frame/src/test_simple_gain.c index d72bce9f4..b2c69832f 100644 --- a/test/lib_agc/test_process_frame/src/test_simple_gain.c +++ b/test/lib_agc/test_process_frame/src/test_simple_gain.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // In this test, the AGC is configured to use the "fixed gain" profile. Frames of random data @@ -29,7 +29,7 @@ void test_simple_gain() { md.aec_corr_factor = AGC_META_DATA_NO_AEC; // Scale down the input so that the fixed gain doesn't overflow - float_s32_t scale = float_s32_div(float_to_float_s32(1), agc.config.gain); + float_s32_t scale = float_s32_div(f32_to_float_s32(1), agc.config.gain); for (unsigned iter = 0; iter < (1<<12)/F; ++iter) { for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { diff --git a/test/lib_agc/test_process_frame/src/test_soft_clipping.c b/test/lib_agc/test_process_frame/src/test_soft_clipping.c index 3afb505b8..49371908a 100644 --- a/test/lib_agc/test_process_frame/src/test_soft_clipping.c +++ b/test/lib_agc/test_process_frame/src/test_soft_clipping.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // Frames of random data are generated (scaled to avoid overflow), and processed by two @@ -39,10 +39,10 @@ void test_soft_clipping() { unsigned seed = 62809; // Scale the input down so that there is enough room to apply the max gain - float_s32_t scale = float_s32_div(float_to_float_s32(1), conf_clip.max_gain); - float_s32_t zero = float_to_float_s32(0); + float_s32_t scale = float_s32_div(f32_to_float_s32(1), conf_clip.max_gain); + float_s32_t zero = f32_to_float_s32(0); // This is the threshold above which soft-clipping is applied - float_s32_t thresh = float_to_float_s32(0.5); + float_s32_t thresh = f32_to_float_s32(0.5); for (unsigned iter = 0; iter < (1<<12)/F; ++iter) { for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { diff --git a/test/lib_agc/test_process_frame/src/test_upper_threshold.c b/test/lib_agc/test_process_frame/src/test_upper_threshold.c index 9bfddbbe5..fbaf44170 100644 --- a/test/lib_agc/test_process_frame/src/test_upper_threshold.c +++ b/test/lib_agc/test_process_frame/src/test_upper_threshold.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // A single iteration of this test generates frames of random data and processes them with @@ -27,7 +27,7 @@ void test_upper_threshold() { conf.lc_enabled = 0; // Set initial gain to a lower value to save time adapting - conf.gain = float_to_float_s32(1); + conf.gain = f32_to_float_s32(1); agc_meta_data_t md; md.vnr_flag = AGC_META_DATA_NO_VNR; diff --git a/test/lib_agc/test_process_frame/src/test_vnr_flag.c b/test/lib_agc/test_process_frame/src/test_vnr_flag.c index 72399d6a4..d2b3c5aa7 100644 --- a/test/lib_agc/test_process_frame/src/test_vnr_flag.c +++ b/test/lib_agc/test_process_frame/src/test_vnr_flag.c @@ -1,7 +1,7 @@ // Copyright 2022 XMOS LIMITED. // This Software is subject to the terms of the XMOS Public Licence: Version 1. #include "test_process_frame.h" -#include +#include "xmath/xmath.h" #include // Take an input frame of random data and run it through two AGC instances: one always sets @@ -23,8 +23,8 @@ void test_vnr_flag() { agc_state_t agc_vnr0; agc_config_t conf_vnr0 = AGC_PROFILE_COMMS; // Set the upper and lower threshold to one so that AGC adaption with VNR always gains - conf_vnr0.lower_threshold = float_to_float_s32(1); - conf_vnr0.upper_threshold = float_to_float_s32(1); + conf_vnr0.lower_threshold = f32_to_float_s32(1); + conf_vnr0.upper_threshold = f32_to_float_s32(1); conf_vnr0.lc_enabled = 0; agc_init(&agc_vnr0, &conf_vnr0); @@ -36,8 +36,8 @@ void test_vnr_flag() { agc_state_t agc_vnr1; agc_config_t conf_vnr1 = AGC_PROFILE_COMMS; // Set the upper and lower threshold to one so that AGC adaption with VNR always gains - conf_vnr1.lower_threshold = float_to_float_s32(1); - conf_vnr1.upper_threshold = float_to_float_s32(1); + conf_vnr1.lower_threshold = f32_to_float_s32(1); + conf_vnr1.upper_threshold = f32_to_float_s32(1); conf_vnr1.lc_enabled = 0; agc_init(&agc_vnr1, &conf_vnr1); @@ -47,7 +47,7 @@ void test_vnr_flag() { md_vnr1.aec_corr_factor = AGC_META_DATA_NO_AEC; // Scale the input to allow room to apply the max gain - float_s32_t scale = float_s32_div(float_to_float_s32(1), conf_vnr0.max_gain); + float_s32_t scale = float_s32_div(f32_to_float_s32(1), conf_vnr0.max_gain); for (unsigned iter = 0; iter < (1<<12)/F; ++iter) { for (unsigned idx = 0; idx < AGC_FRAME_ADVANCE; ++idx) { diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index 7b7d89dbd..d18cb6e99 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -9,7 +9,7 @@ # One more ../ than necessary - builds in the 'build' folder MODULE_ROOT = "../../../../modules" -XS3_MATH = "../../../../build/fwk_voice_deps/lib_xs3_math/" +XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math/" FLAGS = [ '-std=c99', @@ -25,7 +25,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XS3_MATH}/lib_xs3_math/api/", + f"{XCORE_MATH}/lib_xcore_math/api/", ] SRCS = f"../ic_test.c".split() ffibuilder = FFI() @@ -59,9 +59,9 @@ '../../../../build/modules/lib_ic', '../../../../build/modules/lib_aec', '../../../../build/modules/lib_vnr', - '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' + '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/lib_ic/py_c_frame_compare/extract_state.py b/test/lib_ic/py_c_frame_compare/extract_state.py index 6f2017b43..20f9dd08c 100644 --- a/test/lib_ic/py_c_frame_compare/extract_state.py +++ b/test/lib_ic/py_c_frame_compare/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xs3_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xs3_math/lib_xs3_math/api" +xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" lib_ic_api_dir = "../../../modules/lib_ic/api/" lib_vnr_common_api_dir = "../../../modules/lib_vnr/api/common" lib_vnr_features_api_dir = "../../../modules/lib_vnr/api/features/" @@ -35,8 +35,8 @@ def extract_section(line, pp): if log_ic_state: ic_state.append(line) -def extract_xs3_math(): - with open(xs3_math_types_api_dir+"/xs3_math_types.h") as xs3m: +def extract_xcore_math(): + with open(xcore_math_types_api_dir+"/types.h") as xs3m: lines = xs3m.readlines() for line in lines: if not "#" in line and "C_TYPE" not in line: @@ -45,11 +45,11 @@ def extract_xs3_math(): ic_state.append(line) def extract_pre_defs(): - #Grab xs3_math types - extract_xs3_math() + #Grab xcore_math types + extract_xcore_math() #Grab just ic_state related lines from the C pre-processed - subprocess.call(f"gcc -E ic_test.c -o ic_test.i -I {lib_ic_api_dir} -I {xs3_math_types_api_dir} -I {lib_vnr_common_api_dir} -I {lib_vnr_features_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir}".split()) + subprocess.call(f"gcc -E ic_test.c -o ic_test.i -I {lib_ic_api_dir} -I {xcore_math_types_api_dir} -I {lib_vnr_common_api_dir} -I {lib_vnr_features_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir}".split()) with open("ic_test.i") as pp: end_of_file = False diff --git a/test/lib_ic/test_bad_state/src/main.c b/test/lib_ic/test_bad_state/src/main.c index bee458d38..1393f8ba1 100644 --- a/test/lib_ic/test_bad_state/src/main.c +++ b/test/lib_ic/test_bad_state/src/main.c @@ -8,7 +8,7 @@ #include "fileio.h" #include "wav_utils.h" -#include "xs3_math.h" +#include "xmath/xmath.h" #include "ic_defines.h" extern void test_init(int32_t adapt_conf, int32_t * H_data); diff --git a/test/lib_ic/test_bad_state/src/main.xc b/test/lib_ic/test_bad_state/src/main.xc index 87129ad26..fe567c386 100644 --- a/test/lib_ic/test_bad_state/src/main.xc +++ b/test/lib_ic/test_bad_state/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void test_bad_state(const char *conf_file_name, const char *input_file_name, const char *output_file_name); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/test/lib_ns/ns_unit_tests/src/test_apply_window/test_apply_window.c b/test/lib_ns/ns_unit_tests/src/test_apply_window/test_apply_window.c index b83443fa5..9802a4e35 100644 --- a/test/lib_ns/ns_unit_tests/src/test_apply_window/test_apply_window.c +++ b/test/lib_ns/ns_unit_tests/src/test_apply_window/test_apply_window.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_form_output/test_form_output.c b/test/lib_ns/ns_unit_tests/src/test_form_output/test_form_output.c index 802cadc59..0fc78a8bf 100644 --- a/test/lib_ns/ns_unit_tests/src/test_form_output/test_form_output.c +++ b/test/lib_ns/ns_unit_tests/src/test_form_output/test_form_output.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_minimum/test_minimum.c b/test/lib_ns/ns_unit_tests/src/test_minimum/test_minimum.c index 95fc20142..60abe939a 100644 --- a/test/lib_ns/ns_unit_tests/src/test_minimum/test_minimum.c +++ b/test/lib_ns/ns_unit_tests/src/test_minimum/test_minimum.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_pack_input/test_pack_input.c b/test/lib_ns/ns_unit_tests/src/test_pack_input/test_pack_input.c index 4241690cd..912098c05 100644 --- a/test/lib_ns/ns_unit_tests/src/test_pack_input/test_pack_input.c +++ b/test/lib_ns/ns_unit_tests/src/test_pack_input/test_pack_input.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_rescale_vector/test_rescale_vector.c b/test/lib_ns/ns_unit_tests/src/test_rescale_vector/test_rescale_vector.c index 7b244c371..9a8f6b04e 100644 --- a/test/lib_ns/ns_unit_tests/src/test_rescale_vector/test_rescale_vector.c +++ b/test/lib_ns/ns_unit_tests/src/test_rescale_vector/test_rescale_vector.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include @@ -92,8 +92,8 @@ TEST(ns_priv_rescale_vector, case0){ for(int v = 0; v < NS_PROC_FRAME_BINS; v++){ int32_t d_r, d_i, re_int, im_int; - ex_re_fl = double_to_float_s32(expected[2 * v]); - ex_im_fl = double_to_float_s32(expected[(2 * v) + 1]); + ex_re_fl = f64_to_float_s32(expected[2 * v]); + ex_im_fl = f64_to_float_s32(expected[(2 * v) + 1]); re_int = use_exp_float(ex_re_fl, Y.exp); im_int = use_exp_float(ex_im_fl, Y.exp); diff --git a/test/lib_ns/ns_unit_tests/src/test_subtact_lambda_from_frame/test_subtract_lambda_from_frame.c b/test/lib_ns/ns_unit_tests/src/test_subtact_lambda_from_frame/test_subtract_lambda_from_frame.c index d7bbffdbd..d2400aefd 100644 --- a/test/lib_ns/ns_unit_tests/src/test_subtact_lambda_from_frame/test_subtract_lambda_from_frame.c +++ b/test/lib_ns/ns_unit_tests/src/test_subtact_lambda_from_frame/test_subtract_lambda_from_frame.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_update_S/test_update_S.c b/test/lib_ns/ns_unit_tests/src/test_update_S/test_update_S.c index 1b2655190..5d7e3afb2 100644 --- a/test/lib_ns/ns_unit_tests/src/test_update_S/test_update_S.c +++ b/test/lib_ns/ns_unit_tests/src/test_update_S/test_update_S.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_update_alpha_d_tilde/test_update_alpha_d_tilde.c b/test/lib_ns/ns_unit_tests/src/test_update_alpha_d_tilde/test_update_alpha_d_tilde.c index 488583c7c..feae2bfcc 100644 --- a/test/lib_ns/ns_unit_tests/src/test_update_alpha_d_tilde/test_update_alpha_d_tilde.c +++ b/test/lib_ns/ns_unit_tests/src/test_update_alpha_d_tilde/test_update_alpha_d_tilde.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_update_lambda_hat/test_update_lambda_hat.c b/test/lib_ns/ns_unit_tests/src/test_update_lambda_hat/test_update_lambda_hat.c index 8c7747c37..bdc2f6ece 100644 --- a/test/lib_ns/ns_unit_tests/src/test_update_lambda_hat/test_update_lambda_hat.c +++ b/test/lib_ns/ns_unit_tests/src/test_update_lambda_hat/test_update_lambda_hat.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/ns_unit_tests/src/test_update_p/test_update_p.c b/test/lib_ns/ns_unit_tests/src/test_update_p/test_update_p.c index bf59d66cd..a651a87b6 100644 --- a/test/lib_ns/ns_unit_tests/src/test_update_p/test_update_p.c +++ b/test/lib_ns/ns_unit_tests/src/test_update_p/test_update_p.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include "xmath/xmath.h" #include #include diff --git a/test/lib_ns/test_wav_ns/src/main.xc b/test/lib_ns/test_wav_ns/src/main.xc index f6bf75c30..9ff4ec8d3 100644 --- a/test/lib_ns/test_wav_ns/src/main.xc +++ b/test/lib_ns/test_wav_ns/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void ns_task(const char *input_file_name, const char *output_file_name); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index 46d6264c7..8ca7cc948 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -9,7 +9,7 @@ # One more ../ than necessary - builds in the 'build' folder MODULE_ROOT = "../../../../modules" -XS3_MATH = "../../../../build/fwk_voice_deps/lib_xs3_math/" +XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math/" FLAGS = [ '-std=c99', @@ -23,7 +23,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XS3_MATH}/lib_xs3_math/api/", + f"{XCORE_MATH}/lib_xcore_math/api/", ] SRCS = f"../vnr_test.c".split() ffibuilder = FFI() @@ -57,9 +57,9 @@ library_dirs=[ '../../../../build/modules/lib_vnr', '../../../../build/test/lib_vnr', - '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' + '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! + libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/lib_vnr/py_c_feature_compare/extract_state.py b/test/lib_vnr/py_c_feature_compare/extract_state.py index 5b2768dc5..71602dd1e 100644 --- a/test/lib_vnr/py_c_feature_compare/extract_state.py +++ b/test/lib_vnr/py_c_feature_compare/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xs3_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xs3_math/lib_xs3_math/api" +xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" lib_vnr_api_dir = "../../../modules/lib_vnr/api/features/" lib_vnr_defines_dir = "../../../modules/lib_vnr/api/common/" lib_vnr_inference_api_dir = "../../../modules/lib_vnr/api/inference/" @@ -31,8 +31,8 @@ def extract_section_vnr(line, pp): if log_state: vnr_state.append(line) -def extract_xs3_math_vnr(): - with open(xs3_math_types_api_dir+"/xs3_math_types.h") as xs3m: +def extract_xcore_math_vnr(): + with open(xcore_math_types_api_dir+"/types.h") as xs3m: lines = xs3m.readlines() for line in lines: if not "#" in line and "C_TYPE" not in line: @@ -41,11 +41,11 @@ def extract_xs3_math_vnr(): vnr_state.append(line) def extract_pre_defs_vnr(): - #Grab xs3_math types - extract_xs3_math_vnr() + #Grab xcore_math types + extract_xcore_math_vnr() #Grab just vnr_feature_state related lines from the C pre-processed - subprocess.call(f"gcc -E vnr_test.c -o vnr_test.i -I {lib_vnr_api_dir} -I {lib_vnr_defines_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir} -I {xs3_math_types_api_dir}".split()) + subprocess.call(f"gcc -E vnr_test.c -o vnr_test.i -I {lib_vnr_api_dir} -I {lib_vnr_defines_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir} -I {xcore_math_types_api_dir}".split()) with open("vnr_test.i") as pp: end_of_file = False diff --git a/test/lib_vnr/test_wav_vnr/src/main.xc b/test/lib_vnr/test_wav_vnr/src/main.xc index 8c2cbc3d3..95d1c8e0d 100644 --- a/test/lib_vnr/test_wav_vnr/src/main.xc +++ b/test/lib_vnr/test_wav_vnr/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void test_wav_vnr(const char *in_filename); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/src/main.xc b/test/lib_vnr/vnr_unit_tests/feature_extraction/src/main.xc index 67d575465..c2441b418 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/src/main.xc +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/src/main.xc @@ -11,7 +11,7 @@ #endif extern "C" { -#include "xs3_math.h" +#include "xmath/xmath.h" void test_vnr_unit(const char *input_file_name, const char *output_file_name); #if TEST_WAV_XSCOPE #include "xscope_io_device.h" diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_utils.py b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_utils.py index 1992157a1..8960463b0 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_utils.py +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_utils.py @@ -45,7 +45,7 @@ def int32_to_double(x, exp): y = x.astype(np.float64) * (2.0 ** exp) return y -def double_to_float_s32(d): +def f64_to_float_s32(d): m,e = math.frexp(d) m_int = int(m * (2.0 ** 31)) e = e-31 diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_log2.py b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_log2.py index 2f3e92fea..d8fa6a24d 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_log2.py +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_log2.py @@ -16,7 +16,7 @@ def test_vnr_priv_log2(target): input_words_per_frame = fp.MEL_FILTERS*2 # MEL_FILTERS float_s32_t values # No. of int32 output values expected from dut per frame - output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS fixed_s32_t values. Exponent fixed to -24 + output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS uq8_24 values. Exponent fixed to -24 input_data = np.empty(0, dtype=np.int32) input_data = np.append(input_data, np.array([input_words_per_frame, output_words_per_frame], dtype=np.int32)) diff --git a/test/shared/testing/floating_fft.c b/test/shared/testing/floating_fft.c index 4dbdff236..e460f3c27 100644 --- a/test/shared/testing/floating_fft.c +++ b/test/shared/testing/floating_fft.c @@ -1,6 +1,6 @@ #include "testing.h" -#include "xs3_util.h" +#include "xmath/xmath.h" #include #include #include diff --git a/test/shared/testing/testing.h b/test/shared/testing/testing.h index f2b5560d6..26b968c6a 100644 --- a/test/shared/testing/testing.h +++ b/test/shared/testing/testing.h @@ -2,9 +2,7 @@ // This Software is subject to the terms of the XMOS Public Licence: Version 1. #pragma once -#include "xs3_math_conf.h" -#include "xs3_api.h" -#include "xs3_math_types.h" +#include "xmath/xmath.h" /** diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 296a8ccdb..2e7ccd02d 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -9,7 +9,7 @@ # One more ../ than necessary - builds in the 'build' folder MODULE_ROOT = "../../../modules" -XS3_MATH = "../../../build/fwk_voice_deps/lib_xs3_math/" +XCORE_MATH = "../../../build/fwk_voice_deps/lib_xcore_math/" FLAGS = [ '-std=c99', @@ -25,7 +25,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XS3_MATH}/lib_xs3_math/api/", + f"{XCORE_MATH}/lib_xcore_math/api/xmath", ] SRCS = f"../ic_vnr_test.c".split() ffibuilder = FFI() @@ -75,9 +75,9 @@ '../../../build/modules/lib_ic', '../../../build/modules/lib_aec', '../../../build/modules/lib_vnr', - '../../../build/examples/bare-metal/shared_src/external_deps/lib_xs3_math' + '../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xs3_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/stage_b/extract_state.py b/test/stage_b/extract_state.py index 60694af24..f4faa67de 100644 --- a/test/stage_b/extract_state.py +++ b/test/stage_b/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xs3_math_types_api_dir = "../../build/fwk_voice_deps/lib_xs3_math/lib_xs3_math/api" +xcore_math_types_api_dir = "../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" lib_ic_api_dir = "../../modules/lib_ic/api/" lib_ic_src_dir = "../../modules/lib_ic/src/" lib_vnr_api_common_dir = "../../modules/lib_vnr/api/common/" @@ -32,11 +32,11 @@ def extract_section(line, pp, filenames): if log_state: state.append(line) -def extract_xs3_math(): +def extract_xcore_math(): #This is a really quick and dirty way to get things to play nicely. CFFI should do this for us but doesn't #Note enums do not go down well so we replace that with int late skip_lines_containing = ["#", "C_TYPE", "enum", "BFP_FLAG_DYNAMIC", "bfp_flags_e;"] - with open(xs3_math_types_api_dir+"/xs3_math_types.h") as xs3m: + with open(xcore_math_types_api_dir+"/types.h") as xs3m: lines = xs3m.readlines() for line in lines: line_ok = True @@ -48,11 +48,11 @@ def extract_xs3_math(): def extract_pre_defs(): - #Grab xs3_math types - extract_xs3_math() + #Grab xcore_math types + extract_xcore_math() #Grab just ic_state related lines from the C pre-processed - subprocess.call(f"gcc -E ic_vnr_test.c -o ic_vnr_test.i -I {lib_ic_api_dir} -I {lib_ic_src_dir} -I {xs3_math_types_api_dir} -I {lib_vnr_api_common_dir} -I {lib_vnr_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir} -I {calc_vnr_pred_dir}".split()) + subprocess.call(f"gcc -E ic_vnr_test.c -o ic_vnr_test.i -I {lib_ic_api_dir} -I {lib_ic_src_dir} -I {xcore_math_types_api_dir} -I {lib_vnr_api_common_dir} -I {lib_vnr_api_dir} -I {lib_vnr_inference_api_dir} -I {lib_vnr_inference_model_dir} -I {lib_vnr_inference_src_dir} -I {calc_vnr_pred_dir}".split()) with open("ic_vnr_test.i") as pp: end_of_file = False diff --git a/test/stage_b/ic_vnr_test.c b/test/stage_b/ic_vnr_test.c index 9b43038c0..c9fb77393 100644 --- a/test/stage_b/ic_vnr_test.c +++ b/test/stage_b/ic_vnr_test.c @@ -34,7 +34,7 @@ float_s32_t test_vnr(){ void test_control_system(double vnr_fl, int32_t ad_config, double fast_ratio){ ic_state.ic_adaption_controller_state.adaption_controller_config.adaption_config = ad_config; - ic_state.ic_adaption_controller_state.fast_ratio = double_to_float_s32(fast_ratio); - float_s32_t vnr = double_to_float_s32(vnr_fl); + ic_state.ic_adaption_controller_state.fast_ratio = f64_to_float_s32(fast_ratio); + float_s32_t vnr = f64_to_float_s32(vnr_fl); ic_mu_control_system(&ic_state, vnr); } diff --git a/test/test_hpf/src/hpf_test.h b/test/test_hpf/src/hpf_test.h index 786b4d8a6..bfd93193a 100644 --- a/test/test_hpf/src/hpf_test.h +++ b/test/test_hpf/src/hpf_test.h @@ -6,7 +6,7 @@ #include "unity.h" #include "pseudo_rand.h" -#include +#include "xmath/xmath.h" #include #endif diff --git a/test/test_hpf/src/test_hpf_comp_double.c b/test/test_hpf/src/test_hpf_comp_double.c index b06eb7bb8..494a8fa0d 100644 --- a/test/test_hpf/src/test_hpf_comp_double.c +++ b/test/test_hpf/src/test_hpf_comp_double.c @@ -5,7 +5,7 @@ #define len 240 -extern const fixed_s32_t hpf_coef_q30[TOTAL_NUM_COEFF]; +extern const uq2_30 hpf_coef_q30[TOTAL_NUM_COEFF]; void biquad(double out[len + 2], const double in[len + 2], const double coef[NUM_COEFF_PER_BIQUAD]){ for(int v = 2; v < len + 2; v++){ From 53233d23a10c6bf23ada0f4c03f78d6f2f4b8ad5 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 12:46:02 -0400 Subject: [PATCH 34/65] fixed xcore_math_types_api_dir --- test/lib_ic/py_c_frame_compare/extract_state.py | 4 ++-- test/lib_vnr/py_c_feature_compare/extract_state.py | 4 ++-- test/stage_b/extract_state.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/lib_ic/py_c_frame_compare/extract_state.py b/test/lib_ic/py_c_frame_compare/extract_state.py index 20f9dd08c..c511d6d30 100644 --- a/test/lib_ic/py_c_frame_compare/extract_state.py +++ b/test/lib_ic/py_c_frame_compare/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" +xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api" lib_ic_api_dir = "../../../modules/lib_ic/api/" lib_vnr_common_api_dir = "../../../modules/lib_vnr/api/common" lib_vnr_features_api_dir = "../../../modules/lib_vnr/api/features/" @@ -36,7 +36,7 @@ def extract_section(line, pp): ic_state.append(line) def extract_xcore_math(): - with open(xcore_math_types_api_dir+"/types.h") as xs3m: + with open(xcore_math_types_api_dir+"/xmath/types.h") as xs3m: lines = xs3m.readlines() for line in lines: if not "#" in line and "C_TYPE" not in line: diff --git a/test/lib_vnr/py_c_feature_compare/extract_state.py b/test/lib_vnr/py_c_feature_compare/extract_state.py index 71602dd1e..16aac9208 100644 --- a/test/lib_vnr/py_c_feature_compare/extract_state.py +++ b/test/lib_vnr/py_c_feature_compare/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" +xcore_math_types_api_dir = "../../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api" lib_vnr_api_dir = "../../../modules/lib_vnr/api/features/" lib_vnr_defines_dir = "../../../modules/lib_vnr/api/common/" lib_vnr_inference_api_dir = "../../../modules/lib_vnr/api/inference/" @@ -32,7 +32,7 @@ def extract_section_vnr(line, pp): vnr_state.append(line) def extract_xcore_math_vnr(): - with open(xcore_math_types_api_dir+"/types.h") as xs3m: + with open(xcore_math_types_api_dir+"/xmath/types.h") as xs3m: lines = xs3m.readlines() for line in lines: if not "#" in line and "C_TYPE" not in line: diff --git a/test/stage_b/extract_state.py b/test/stage_b/extract_state.py index f4faa67de..e7ba88f13 100644 --- a/test/stage_b/extract_state.py +++ b/test/stage_b/extract_state.py @@ -7,7 +7,7 @@ import subprocess -xcore_math_types_api_dir = "../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api/xmath" +xcore_math_types_api_dir = "../../build/fwk_voice_deps/lib_xcore_math/lib_xcore_math/api" lib_ic_api_dir = "../../modules/lib_ic/api/" lib_ic_src_dir = "../../modules/lib_ic/src/" lib_vnr_api_common_dir = "../../modules/lib_vnr/api/common/" @@ -36,7 +36,7 @@ def extract_xcore_math(): #This is a really quick and dirty way to get things to play nicely. CFFI should do this for us but doesn't #Note enums do not go down well so we replace that with int late skip_lines_containing = ["#", "C_TYPE", "enum", "BFP_FLAG_DYNAMIC", "bfp_flags_e;"] - with open(xcore_math_types_api_dir+"/types.h") as xs3m: + with open(xcore_math_types_api_dir+"/xmath/types.h") as xs3m: lines = xs3m.readlines() for line in lines: line_ok = True From 8d3b32c1f6817380b91d4df6a8a11a50c715b1c0 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 15:46:35 -0400 Subject: [PATCH 35/65] added workaround for CFFI extern C --- test/lib_ic/py_c_frame_compare/extract_state.py | 10 ++++++++++ test/lib_vnr/py_c_feature_compare/extract_state.py | 10 ++++++++++ test/stage_b/extract_state.py | 9 +++++++++ 3 files changed, 29 insertions(+) diff --git a/test/lib_ic/py_c_frame_compare/extract_state.py b/test/lib_ic/py_c_frame_compare/extract_state.py index c511d6d30..501f57e9c 100644 --- a/test/lib_ic/py_c_frame_compare/extract_state.py +++ b/test/lib_ic/py_c_frame_compare/extract_state.py @@ -44,6 +44,16 @@ def extract_xcore_math(): continue ic_state.append(line) + # really hacky way to work-around CFFI's lack of support for `extern "C"` + # this is fragile because it assumes the extern "C" is on line #2. And, that the + # closing bracket is the last line. However, this may not make the parsing of + # the lib_xcore_math types.h file any more fragile. The parsing can be broken by + # subtle changes to the header. + EXTERN_C_LINE_NUM=2 + if ic_state[EXTERN_C_LINE_NUM] == 'extern "C" { \n': + del ic_state[EXTERN_C_LINE_NUM] + del ic_state[-1] + def extract_pre_defs(): #Grab xcore_math types extract_xcore_math() diff --git a/test/lib_vnr/py_c_feature_compare/extract_state.py b/test/lib_vnr/py_c_feature_compare/extract_state.py index 16aac9208..8da4a1569 100644 --- a/test/lib_vnr/py_c_feature_compare/extract_state.py +++ b/test/lib_vnr/py_c_feature_compare/extract_state.py @@ -40,6 +40,16 @@ def extract_xcore_math_vnr(): continue vnr_state.append(line) + # really hacky way to work-around CFFI's lack of support for `extern "C"` + # this is fragile because it assumes the extern "C" is on line #2. And, that the + # closing bracket is the last line. However, this may not make the parsing of + # the lib_xcore_math types.h file any more fragile. The parsing can be broken by + # subtle changes to the header. + EXTERN_C_LINE_NUM=2 + if vnr_state[EXTERN_C_LINE_NUM] == 'extern "C" { \n': + del vnr_state[EXTERN_C_LINE_NUM] + del vnr_state[-1] + def extract_pre_defs_vnr(): #Grab xcore_math types extract_xcore_math_vnr() diff --git a/test/stage_b/extract_state.py b/test/stage_b/extract_state.py index e7ba88f13..940e653a0 100644 --- a/test/stage_b/extract_state.py +++ b/test/stage_b/extract_state.py @@ -46,6 +46,15 @@ def extract_xcore_math(): if line_ok and not line == "\n": state.append(line) + # really hacky way to work-around CFFI's lack of support for `extern "C"` + # this is fragile because it assumes the extern "C" is on line #2. And, that the + # closing bracket is the last line. However, this may not make the parsing of + # the lib_xcore_math types.h file any more fragile. The parsing can be broken by + # subtle changes to the header. + EXTERN_C_LINE_NUM=2 + if state[EXTERN_C_LINE_NUM] == 'extern "C" { \n': + del state[EXTERN_C_LINE_NUM] + del state[-1] def extract_pre_defs(): #Grab xcore_math types From f4bf0dce667c5d8af8919f36996dd9707c4acc07 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 16:19:41 -0400 Subject: [PATCH 36/65] fixed lib_xcore_math linker lib --- test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py | 2 +- .../py_c_feature_compare/build_vnr_feature_extraction.py | 2 +- test/stage_b/build_c_code.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index d18cb6e99..45a0dc20f 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -61,7 +61,7 @@ '../../../../build/modules/lib_vnr', '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index 8ca7cc948..aa59c684b 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -59,7 +59,7 @@ '../../../../build/test/lib_vnr', '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! + libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 2e7ccd02d..945cf6955 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -77,7 +77,7 @@ '../../../build/modules/lib_vnr', '../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' ], - libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'fwk_voice_deps_lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux + libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, include_dirs=INCLUDE_DIRS) From b3b411f5c2cee19f222e166afb6f51bd418f7699 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 17:03:34 -0400 Subject: [PATCH 37/65] fixed lib_xcore_math linker path --- test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py | 2 +- .../py_c_feature_compare/build_vnr_feature_extraction.py | 2 +- test/stage_b/build_c_code.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index 45a0dc20f..e07a1943b 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -59,7 +59,7 @@ '../../../../build/modules/lib_ic', '../../../../build/modules/lib_aec', '../../../../build/modules/lib_vnr', - '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' + '../../../../build/fwk_voice_deps/build' ], libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index aa59c684b..d73032a51 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -57,7 +57,7 @@ library_dirs=[ '../../../../build/modules/lib_vnr', '../../../../build/test/lib_vnr', - '../../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' + '../../../../build/fwk_voice_deps/build' ], libraries=['fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux! extra_compile_args=FLAGS, diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 945cf6955..749412de2 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -75,7 +75,7 @@ '../../../build/modules/lib_ic', '../../../build/modules/lib_aec', '../../../build/modules/lib_vnr', - '../../../build/examples/bare-metal/shared_src/external_deps/lib_xcore_math' + '../../../../build/fwk_voice_deps/build' ], libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, From f8df9d7797a61785831ece8e6083dd1b6b596cb2 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 17:34:55 -0400 Subject: [PATCH 38/65] added fPIC compiler flag --- .../shared_src/external_deps/lib_xcore_math/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt b/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt index 1069df38d..790d1586b 100644 --- a/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt +++ b/examples/bare-metal/shared_src/external_deps/lib_xcore_math/CMakeLists.txt @@ -1,3 +1,10 @@ set(XCORE_MATH_PATH ${CMAKE_BINARY_DIR}/fwk_voice_deps) add_subdirectory(${XCORE_MATH_PATH}/lib_xcore_math/lib_xcore_math ${XCORE_MATH_PATH}/build) + +if(PROJECT_IS_TOP_LEVEL) + if(NOT CMAKE_SYSTEM_NAME STREQUAL XCORE_XS3A) + ## Needed for CFFI tests + target_compile_options(lib_xcore_math PRIVATE "-fPIC") + endif() +endif() \ No newline at end of file From 0c9f4f50c1f6f4d857ab2c9a36bf393d0352b18f Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 17:55:54 -0400 Subject: [PATCH 39/65] fixed lib_xcore_math include dirs --- test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py | 2 +- .../py_c_feature_compare/build_vnr_feature_extraction.py | 2 +- test/stage_b/build_c_code.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index e07a1943b..bba601083 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -25,7 +25,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XCORE_MATH}/lib_xcore_math/api/", + f"{XCORE_MATH}/lib_xcore_math/api", ] SRCS = f"../ic_test.c".split() ffibuilder = FFI() diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index d73032a51..c1c5cf560 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -23,7 +23,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XCORE_MATH}/lib_xcore_math/api/", + f"{XCORE_MATH}/lib_xcore_math/api", ] SRCS = f"../vnr_test.c".split() ffibuilder = FFI() diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 749412de2..58dd2c291 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -25,7 +25,7 @@ f"{MODULE_ROOT}/lib_vnr/api/inference", f"{MODULE_ROOT}/lib_vnr/src/inference/model", f"{MODULE_ROOT}/lib_vnr/src/inference", - f"{XCORE_MATH}/lib_xcore_math/api/xmath", + f"{XCORE_MATH}/lib_xcore_math/api", ] SRCS = f"../ic_vnr_test.c".split() ffibuilder = FFI() From 918decac3604d2faa78c6907ecb9654b669c9588 Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Wed, 2 Nov 2022 19:03:38 -0400 Subject: [PATCH 40/65] fixed lib_xcore_math lib path --- test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py | 4 ++-- .../py_c_feature_compare/build_vnr_feature_extraction.py | 2 +- test/stage_b/build_c_code.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py index bba601083..582b0c298 100644 --- a/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py +++ b/test/lib_ic/py_c_frame_compare/build_ic_frame_proc.py @@ -9,7 +9,7 @@ # One more ../ than necessary - builds in the 'build' folder MODULE_ROOT = "../../../../modules" -XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math/" +XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math" FLAGS = [ '-std=c99', @@ -58,7 +58,7 @@ library_dirs=[ '../../../../build/modules/lib_ic', '../../../../build/modules/lib_aec', - '../../../../build/modules/lib_vnr', + '../../../../build/modules/lib_vnr', '../../../../build/fwk_voice_deps/build' ], libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec','fwk_voice_module_lib_vnr_features', 'fwk_voice_module_lib_vnr_inference', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux diff --git a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py index c1c5cf560..f063e5c41 100644 --- a/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py +++ b/test/lib_vnr/py_c_feature_compare/build_vnr_feature_extraction.py @@ -9,7 +9,7 @@ # One more ../ than necessary - builds in the 'build' folder MODULE_ROOT = "../../../../modules" -XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math/" +XCORE_MATH = "../../../../build/fwk_voice_deps/lib_xcore_math" FLAGS = [ '-std=c99', diff --git a/test/stage_b/build_c_code.py b/test/stage_b/build_c_code.py index 58dd2c291..d00fafca6 100644 --- a/test/stage_b/build_c_code.py +++ b/test/stage_b/build_c_code.py @@ -75,7 +75,7 @@ '../../../build/modules/lib_ic', '../../../build/modules/lib_aec', '../../../build/modules/lib_vnr', - '../../../../build/fwk_voice_deps/build' + '../../../build/fwk_voice_deps/build' ], libraries=['fwk_voice_module_lib_ic', 'fwk_voice_module_lib_aec', 'fwk_voice_module_lib_vnr_inference', 'fwk_voice_module_lib_vnr_features', 'lib_xcore_math', 'm', 'stdc++'], # on Unix, link with the math library. Linking order is important here for gcc compile on Linux extra_compile_args=FLAGS, From 6fddfc68d7f16db6993638fc92f0ed4e8213839a Mon Sep 17 00:00:00 2001 From: keithm-xmos <35048036+keithm-xmos@users.noreply.github.com> Date: Tue, 15 Nov 2022 14:11:02 -0500 Subject: [PATCH 41/65] integrated PR feedback --- examples/bare-metal/shared_src/external_deps/fetch_deps.cmake | 2 +- modules/lib_ic/src/ic_low_level.c | 2 +- modules/lib_ic/src/ic_low_level.h | 2 +- modules/lib_vnr/api/features/vnr_features_state.h | 2 +- modules/lib_vnr/src/features/vnr_features_priv.c | 2 +- modules/lib_vnr/src/features/vnr_features_priv.h | 2 +- .../feature_extraction/test_vnr_priv_make_slice.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake index 151ef4bf1..2d5747883 100644 --- a/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake +++ b/examples/bare-metal/shared_src/external_deps/fetch_deps.cmake @@ -4,7 +4,7 @@ include(FetchContent) FetchContent_Declare( xcore_math GIT_REPOSITORY https://github.com/xmos/lib_xcore_math.git - GIT_TAG v2.1.0 + GIT_TAG v2.1.1 GIT_SHALLOW FALSE SOURCE_DIR ${CMAKE_BINARY_DIR}/fwk_voice_deps/lib_xcore_math ) diff --git a/modules/lib_ic/src/ic_low_level.c b/modules/lib_ic/src/ic_low_level.c index 48b5bc5b9..dbb77c946 100644 --- a/modules/lib_ic/src/ic_low_level.c +++ b/modules/lib_ic/src/ic_low_level.c @@ -104,7 +104,7 @@ void ic_update_td_ema_energy( const bfp_s32_t *input, unsigned start_offset, unsigned length, - const int32_t alpha){ + const uq2_30 alpha){ if(!length) { return; diff --git a/modules/lib_ic/src/ic_low_level.h b/modules/lib_ic/src/ic_low_level.h index 8e695cc92..0ef476d51 100644 --- a/modules/lib_ic/src/ic_low_level.h +++ b/modules/lib_ic/src/ic_low_level.h @@ -43,7 +43,7 @@ void ic_update_td_ema_energy( const bfp_s32_t *input, unsigned start_offset, unsigned length, - const int32_t alpha); + const uq2_30 alpha); // FFT single channel real input void ic_fft( diff --git a/modules/lib_vnr/api/features/vnr_features_state.h b/modules/lib_vnr/api/features/vnr_features_state.h index d1b3777a5..5519e66e6 100644 --- a/modules/lib_vnr/api/features/vnr_features_state.h +++ b/modules/lib_vnr/api/features/vnr_features_state.h @@ -65,7 +65,7 @@ typedef struct { */ typedef struct { /** Feature buffer containing the most recent VNR_MEL_FILTERS frames' MEL frequency spectrum. */ - int32_t DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; + uq8_24 DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; vnr_feature_config_t config; }vnr_feature_state_t; #endif diff --git a/modules/lib_vnr/src/features/vnr_features_priv.c b/modules/lib_vnr/src/features/vnr_features_priv.c index 0d4b18767..da619508c 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.c +++ b/modules/lib_vnr/src/features/vnr_features_priv.c @@ -39,7 +39,7 @@ void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t vnr_priv_log2(new_slice, mel_output, VNR_MEL_FILTERS); //Calculate new_slice in state->scratch_data } -void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice) +void vnr_priv_add_new_slice(uq8_24 (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice) { // Roll the patch buffer to get rid of oldest slice // self.feature_buffers[buffer_number] = np.roll(self.feature_buffers[buffer_number], -1, axis=0) diff --git a/modules/lib_vnr/src/features/vnr_features_priv.h b/modules/lib_vnr/src/features/vnr_features_priv.h index 9f3d1527a..65b68e4e0 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.h +++ b/modules/lib_vnr/src/features/vnr_features_priv.h @@ -46,7 +46,7 @@ void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t * * This function name matches with the corresponding function in py_vnr python model. */ -void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice); +void vnr_priv_add_new_slice(uq8_24 (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice); /** * @brief Normalise a patch by subtracting the max. diff --git a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py index d6f330066..379002674 100644 --- a/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py +++ b/test/lib_vnr/vnr_unit_tests/feature_extraction/test_vnr_priv_make_slice.py @@ -15,7 +15,7 @@ def test_vnr_priv_make_slice(target, tflite_model): input_data = np.empty(0, dtype=np.int32) input_words_per_frame = fp.FRAME_ADVANCE + 1 #No. of int32 values sent to dut as input per frame - output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS int32_t values. Exponent fixed to -24 + output_words_per_frame = fp.MEL_FILTERS # MEL_FILTERS uq8_24 values. Exponent fixed to -24 fd_frame_len = int(fp.NFFT/2 + 1) input_data = np.append(input_data, np.array([input_words_per_frame, output_words_per_frame], dtype=np.int32)) From 4a0ef904f1ff14f8afd5bb5cbaa0aa75f3713b4a Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 6 Feb 2023 13:50:21 +0000 Subject: [PATCH 42/65] remove extra space indent in index --- modules/lib_ic/doc/src/reference/index.rst | 12 ++++++------ modules/lib_vnr/doc/src/reference/index.rst | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/lib_ic/doc/src/reference/index.rst b/modules/lib_ic/doc/src/reference/index.rst index 111d71e95..3b438ea03 100644 --- a/modules/lib_ic/doc/src/reference/index.rst +++ b/modules/lib_ic/doc/src/reference/index.rst @@ -2,10 +2,10 @@ API Reference ============= - .. toctree:: - :maxdepth: 1 +.. toctree:: + :maxdepth: 1 - api - state - defines - header_files \ No newline at end of file + api + state + defines + header_files \ No newline at end of file diff --git a/modules/lib_vnr/doc/src/reference/index.rst b/modules/lib_vnr/doc/src/reference/index.rst index 43e2c97e0..9b860e4e3 100644 --- a/modules/lib_vnr/doc/src/reference/index.rst +++ b/modules/lib_vnr/doc/src/reference/index.rst @@ -1,10 +1,10 @@ API Reference ============= - .. toctree:: - :maxdepth: 1 +.. toctree:: + :maxdepth: 1 - api - common_defines - state - header_files + api + common_defines + state + header_files From bcd7e06ed3bf4f61590d6c945d45da126a1105ff Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 6 Feb 2023 13:54:58 +0000 Subject: [PATCH 43/65] Remove content-only doxygengroup param --- modules/lib_adec/doc/src/reference/api.rst | 2 +- modules/lib_adec/doc/src/reference/defines.rst | 2 +- modules/lib_adec/doc/src/reference/header_files.rst | 6 +++--- modules/lib_adec/doc/src/reference/types.rst | 2 +- modules/lib_aec/doc/src/reference/api/high_level_api.rst | 2 +- modules/lib_aec/doc/src/reference/api/low_level_api.rst | 2 +- modules/lib_aec/doc/src/reference/defines.rst | 2 +- modules/lib_aec/doc/src/reference/header_files.rst | 6 +++--- modules/lib_aec/doc/src/reference/types.rst | 2 +- modules/lib_agc/doc/src/reference/api.rst | 2 +- modules/lib_agc/doc/src/reference/defines.rst | 2 +- modules/lib_agc/doc/src/reference/header_files.rst | 4 ++-- modules/lib_agc/doc/src/reference/profiles.rst | 2 +- modules/lib_ic/doc/src/reference/api.rst | 2 +- modules/lib_ic/doc/src/reference/defines.rst | 2 +- modules/lib_ic/doc/src/reference/header_files.rst | 6 +++--- modules/lib_ic/doc/src/reference/state.rst | 2 +- modules/lib_ns/doc/src/reference/api.rst | 2 +- modules/lib_ns/doc/src/reference/defines.rst | 2 +- modules/lib_ns/doc/src/reference/header_files.rst | 4 ++-- modules/lib_vnr/doc/src/reference/api.rst | 4 ++-- modules/lib_vnr/doc/src/reference/common_defines.rst | 2 +- modules/lib_vnr/doc/src/reference/header_files.rst | 8 ++++---- modules/lib_vnr/doc/src/reference/state.rst | 2 +- 24 files changed, 36 insertions(+), 36 deletions(-) diff --git a/modules/lib_adec/doc/src/reference/api.rst b/modules/lib_adec/doc/src/reference/api.rst index 84df93aca..3b15a748d 100644 --- a/modules/lib_adec/doc/src/reference/api.rst +++ b/modules/lib_adec/doc/src/reference/api.rst @@ -4,4 +4,4 @@ ADEC API Functions ================== .. doxygengroup:: adec_func - :content-only: + diff --git a/modules/lib_adec/doc/src/reference/defines.rst b/modules/lib_adec/doc/src/reference/defines.rst index ab39584a3..134d26342 100644 --- a/modules/lib_adec/doc/src/reference/defines.rst +++ b/modules/lib_adec/doc/src/reference/defines.rst @@ -5,4 +5,4 @@ ADEC #define constants .. doxygengroup:: adec_defines :members: - :content-only: + diff --git a/modules/lib_adec/doc/src/reference/header_files.rst b/modules/lib_adec/doc/src/reference/header_files.rst index dc03799e3..9e02ddb0c 100644 --- a/modules/lib_adec/doc/src/reference/header_files.rst +++ b/modules/lib_adec/doc/src/reference/header_files.rst @@ -7,7 +7,7 @@ ADEC Header Files ---------------- .. doxygenpage:: page_adec_defines_h - :content-only: + .. _adec_state_h: @@ -16,7 +16,7 @@ ADEC Header Files ---------------- .. doxygenpage:: page_adec_state_h - :content-only: + .. _adec_api_h: @@ -25,4 +25,4 @@ ADEC Header Files ----------------- .. doxygenpage:: page_adec_api_h - :content-only: + diff --git a/modules/lib_adec/doc/src/reference/types.rst b/modules/lib_adec/doc/src/reference/types.rst index 73351c9e8..3539f6f6f 100644 --- a/modules/lib_adec/doc/src/reference/types.rst +++ b/modules/lib_adec/doc/src/reference/types.rst @@ -5,4 +5,4 @@ ADEC Data Structure and Enum definitions .. doxygengroup:: adec_types :members: - :content-only: + diff --git a/modules/lib_aec/doc/src/reference/api/high_level_api.rst b/modules/lib_aec/doc/src/reference/api/high_level_api.rst index 35f657be3..bac815e74 100644 --- a/modules/lib_aec/doc/src/reference/api/high_level_api.rst +++ b/modules/lib_aec/doc/src/reference/api/high_level_api.rst @@ -4,5 +4,5 @@ AEC High Level API Functions ===================================== .. doxygengroup:: aec_func - :content-only: + diff --git a/modules/lib_aec/doc/src/reference/api/low_level_api.rst b/modules/lib_aec/doc/src/reference/api/low_level_api.rst index d459ae026..cf9d59f8b 100644 --- a/modules/lib_aec/doc/src/reference/api/low_level_api.rst +++ b/modules/lib_aec/doc/src/reference/api/low_level_api.rst @@ -4,4 +4,4 @@ AEC Low Level API Functions (STILL WIP) ========================================= .. doxygengroup:: aec_low_level_func - :content-only: + diff --git a/modules/lib_aec/doc/src/reference/defines.rst b/modules/lib_aec/doc/src/reference/defines.rst index 6e1182e46..e7ee09bbe 100644 --- a/modules/lib_aec/doc/src/reference/defines.rst +++ b/modules/lib_aec/doc/src/reference/defines.rst @@ -5,4 +5,4 @@ AEC #define constants .. doxygengroup:: aec_defines :members: - :content-only: + diff --git a/modules/lib_aec/doc/src/reference/header_files.rst b/modules/lib_aec/doc/src/reference/header_files.rst index a19ff3c59..42da73b8e 100644 --- a/modules/lib_aec/doc/src/reference/header_files.rst +++ b/modules/lib_aec/doc/src/reference/header_files.rst @@ -8,7 +8,7 @@ --------------- .. doxygenpage:: page_aec_defines_h - :content-only: + .. _aec_state_h: @@ -16,7 +16,7 @@ ------------- .. doxygenpage:: page_aec_state_h - :content-only: + .. _aec_api_h: @@ -25,7 +25,7 @@ ----------- .. doxygenpage:: page_aec_api_h - :content-only: + diff --git a/modules/lib_aec/doc/src/reference/types.rst b/modules/lib_aec/doc/src/reference/types.rst index 74eaf8215..e55ed5791 100644 --- a/modules/lib_aec/doc/src/reference/types.rst +++ b/modules/lib_aec/doc/src/reference/types.rst @@ -5,4 +5,4 @@ AEC Data Structure and Enum Definitions .. doxygengroup:: aec_types :members: - :content-only: + diff --git a/modules/lib_agc/doc/src/reference/api.rst b/modules/lib_agc/doc/src/reference/api.rst index 2951c05d1..6c42994ee 100644 --- a/modules/lib_agc/doc/src/reference/api.rst +++ b/modules/lib_agc/doc/src/reference/api.rst @@ -4,4 +4,4 @@ AGC API Functions ================= .. doxygengroup:: agc_func - :content-only: + diff --git a/modules/lib_agc/doc/src/reference/defines.rst b/modules/lib_agc/doc/src/reference/defines.rst index 908d6bf13..df1ef96bd 100644 --- a/modules/lib_agc/doc/src/reference/defines.rst +++ b/modules/lib_agc/doc/src/reference/defines.rst @@ -5,4 +5,4 @@ AGC API Structure Definitions .. doxygengroup:: agc_defs :members: - :content-only: + diff --git a/modules/lib_agc/doc/src/reference/header_files.rst b/modules/lib_agc/doc/src/reference/header_files.rst index 96221204d..d8fa41b7f 100644 --- a/modules/lib_agc/doc/src/reference/header_files.rst +++ b/modules/lib_agc/doc/src/reference/header_files.rst @@ -7,7 +7,7 @@ AGC Header Files ----------- .. doxygenpage:: page_agc_api_h - :content-only: + .. _agc_profiles_h: @@ -15,4 +15,4 @@ AGC Header Files ---------------- .. doxygenpage:: page_agc_profiles_h - :content-only: + diff --git a/modules/lib_agc/doc/src/reference/profiles.rst b/modules/lib_agc/doc/src/reference/profiles.rst index 848bbecc5..532b39b40 100644 --- a/modules/lib_agc/doc/src/reference/profiles.rst +++ b/modules/lib_agc/doc/src/reference/profiles.rst @@ -4,4 +4,4 @@ AGC Pre-Defined Profiles ======================== .. doxygengroup:: agc_profiles - :content-only: + diff --git a/modules/lib_ic/doc/src/reference/api.rst b/modules/lib_ic/doc/src/reference/api.rst index fe117144a..f6ef53985 100644 --- a/modules/lib_ic/doc/src/reference/api.rst +++ b/modules/lib_ic/doc/src/reference/api.rst @@ -4,4 +4,4 @@ ====================== .. doxygengroup:: ic_func - :content-only: \ No newline at end of file + \ No newline at end of file diff --git a/modules/lib_ic/doc/src/reference/defines.rst b/modules/lib_ic/doc/src/reference/defines.rst index 3d255eb2e..847b6b570 100644 --- a/modules/lib_ic/doc/src/reference/defines.rst +++ b/modules/lib_ic/doc/src/reference/defines.rst @@ -5,4 +5,4 @@ .. doxygengroup:: ic_defines :members: - :content-only: \ No newline at end of file + \ No newline at end of file diff --git a/modules/lib_ic/doc/src/reference/header_files.rst b/modules/lib_ic/doc/src/reference/header_files.rst index 8bc323c36..d4c0e9d45 100644 --- a/modules/lib_ic/doc/src/reference/header_files.rst +++ b/modules/lib_ic/doc/src/reference/header_files.rst @@ -9,7 +9,7 @@ --------------- .. doxygenpage:: page_ic_defines_h - :content-only: + .. _ic_state_h: @@ -17,7 +17,7 @@ ------------- .. doxygenpage:: page_ic_state_h - :content-only: + .. _ic_api_h: @@ -26,7 +26,7 @@ ------------ .. doxygenpage:: page_ic_api_h - :content-only: + diff --git a/modules/lib_ic/doc/src/reference/state.rst b/modules/lib_ic/doc/src/reference/state.rst index abd767d95..e88ed0815 100644 --- a/modules/lib_ic/doc/src/reference/state.rst +++ b/modules/lib_ic/doc/src/reference/state.rst @@ -5,4 +5,4 @@ .. doxygengroup:: ic_state :members: - :content-only: \ No newline at end of file + \ No newline at end of file diff --git a/modules/lib_ns/doc/src/reference/api.rst b/modules/lib_ns/doc/src/reference/api.rst index f9ffe4ad1..97b94c7cc 100644 --- a/modules/lib_ns/doc/src/reference/api.rst +++ b/modules/lib_ns/doc/src/reference/api.rst @@ -4,4 +4,4 @@ NS API Functions ================ .. doxygengroup:: ns_func - :content-only: + diff --git a/modules/lib_ns/doc/src/reference/defines.rst b/modules/lib_ns/doc/src/reference/defines.rst index 9de3858a3..16010fd68 100644 --- a/modules/lib_ns/doc/src/reference/defines.rst +++ b/modules/lib_ns/doc/src/reference/defines.rst @@ -5,4 +5,4 @@ NS API Structure Definitions .. doxygengroup:: ns_defs :members: - :content-only: + diff --git a/modules/lib_ns/doc/src/reference/header_files.rst b/modules/lib_ns/doc/src/reference/header_files.rst index fb97d3ea0..013b55e2d 100644 --- a/modules/lib_ns/doc/src/reference/header_files.rst +++ b/modules/lib_ns/doc/src/reference/header_files.rst @@ -7,7 +7,7 @@ NS Header Files ----------- .. doxygenpage:: page_ns_api_h - :content-only: + .. _ns_state_h: @@ -15,4 +15,4 @@ NS Header Files ------------- .. doxygenpage:: page_ns_state_h - :content-only: \ No newline at end of file + \ No newline at end of file diff --git a/modules/lib_vnr/doc/src/reference/api.rst b/modules/lib_vnr/doc/src/reference/api.rst index a39b42864..8786439b4 100644 --- a/modules/lib_vnr/doc/src/reference/api.rst +++ b/modules/lib_vnr/doc/src/reference/api.rst @@ -4,10 +4,10 @@ ========================================== .. doxygengroup:: vnr_features_api - :content-only: + `lib_vnr` inference engine API Functions ========================================== .. doxygengroup:: vnr_inference_api - :content-only: + diff --git a/modules/lib_vnr/doc/src/reference/common_defines.rst b/modules/lib_vnr/doc/src/reference/common_defines.rst index ea14cb640..0e90e1301 100644 --- a/modules/lib_vnr/doc/src/reference/common_defines.rst +++ b/modules/lib_vnr/doc/src/reference/common_defines.rst @@ -5,4 +5,4 @@ .. doxygengroup:: vnr_defines :members: - :content-only: + diff --git a/modules/lib_vnr/doc/src/reference/header_files.rst b/modules/lib_vnr/doc/src/reference/header_files.rst index effbe67c4..bbcc6be3d 100644 --- a/modules/lib_vnr/doc/src/reference/header_files.rst +++ b/modules/lib_vnr/doc/src/reference/header_files.rst @@ -9,13 +9,13 @@ -------------------- .. doxygenpage:: page_vnr_features_api_h - :content-only: + `vnr_inference_api.h` -------------------- .. doxygenpage:: page_vnr_inference_api_h - :content-only: + .. _vnr_common_defines_h: @@ -23,7 +23,7 @@ --------------- .. doxygenpage:: page_vnr_defines_h - :content-only: + .. _vnr_features_state_h: @@ -31,7 +31,7 @@ ---------------------- .. doxygenpage:: page_vnr_features_state_h - :content-only: + diff --git a/modules/lib_vnr/doc/src/reference/state.rst b/modules/lib_vnr/doc/src/reference/state.rst index 7ddaca916..7b0179f86 100644 --- a/modules/lib_vnr/doc/src/reference/state.rst +++ b/modules/lib_vnr/doc/src/reference/state.rst @@ -5,4 +5,4 @@ .. doxygengroup:: vnr_features_state :members: - :content-only: + From 45f09efd7fdc881e9c78047e46de2e10506a86ea Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 6 Feb 2023 14:05:34 +0000 Subject: [PATCH 44/65] add templates to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4b79dfed7..c203e36d3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # Build cruft **/build*/ **/_build*/ +**/_templates*/ **/bin*/ **/dist*/ **/fatfs_mkimage From 3513491219935f2a6f356350d1ede86e2d4f732a Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 6 Feb 2023 14:06:12 +0000 Subject: [PATCH 45/65] archive all the doc artifacts --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 130f9fd78..35b74eec2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -46,6 +46,6 @@ jobs: uses: actions/upload-artifact@v2 with: name: fwk_voice_docs - path: ./doc/_build/html + path: ./doc/_build if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` retention-days: 5 From 9c6ce2000426d017a9253e59cc17be65a9187916 Mon Sep 17 00:00:00 2001 From: Brennan Magee Date: Mon, 6 Feb 2023 14:12:56 +0000 Subject: [PATCH 46/65] put getting started guidde into a folder to generate pdf --- doc/{getting_started.rst => getting_started/index.rst} | 0 index.rst | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename doc/{getting_started.rst => getting_started/index.rst} (100%) diff --git a/doc/getting_started.rst b/doc/getting_started/index.rst similarity index 100% rename from doc/getting_started.rst rename to doc/getting_started/index.rst diff --git a/index.rst b/index.rst index 0487f8b9d..5859a5491 100644 --- a/index.rst +++ b/index.rst @@ -7,6 +7,6 @@ Framework of voice processing libraries for XCORE.AI. .. toctree:: :maxdepth: 2 - ./doc/getting_started + ./doc/getting_started/index ./doc/user_guide/index From daf03aa3d61148eca24045cb11b8ec31b00aa7d3 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 8 Feb 2023 15:48:55 +0000 Subject: [PATCH 47/65] Changed feature buffers back to int32_t --- examples/bare-metal/shared_src/hpf/hpf.c | 2 +- modules/lib_vnr/api/features/vnr_features_state.h | 2 +- modules/lib_vnr/src/features/vnr_features_priv.c | 2 +- modules/lib_vnr/src/features/vnr_features_priv.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bare-metal/shared_src/hpf/hpf.c b/examples/bare-metal/shared_src/hpf/hpf.c index 66927341a..58420f6de 100644 --- a/examples/bare-metal/shared_src/hpf/hpf.c +++ b/examples/bare-metal/shared_src/hpf/hpf.c @@ -6,7 +6,7 @@ // Q30 coefficients for the 100 Hz high pass filter // coefficients were generated here: // https://github.com/xmos/lib_audio_pipelines/blob/develop/lib_audio_pipelines/src/dsp/ap_stage_c.xc#L26 -const uq2_30 hpf_coef_q30[TOTAL_NUM_COEFF] = { +const q2_30 hpf_coef_q30[TOTAL_NUM_COEFF] = { 1020035168, -2040070348, 1020035168, 2070720224, -998576072, 1073741824, -2147483648, 1073741824, 2114066120, -1041955416 }; diff --git a/modules/lib_vnr/api/features/vnr_features_state.h b/modules/lib_vnr/api/features/vnr_features_state.h index 5519e66e6..d1b3777a5 100644 --- a/modules/lib_vnr/api/features/vnr_features_state.h +++ b/modules/lib_vnr/api/features/vnr_features_state.h @@ -65,7 +65,7 @@ typedef struct { */ typedef struct { /** Feature buffer containing the most recent VNR_MEL_FILTERS frames' MEL frequency spectrum. */ - uq8_24 DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; + int32_t DWORD_ALIGNED feature_buffers[VNR_PATCH_WIDTH][VNR_MEL_FILTERS]; vnr_feature_config_t config; }vnr_feature_state_t; #endif diff --git a/modules/lib_vnr/src/features/vnr_features_priv.c b/modules/lib_vnr/src/features/vnr_features_priv.c index da619508c..700a93e62 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.c +++ b/modules/lib_vnr/src/features/vnr_features_priv.c @@ -39,7 +39,7 @@ void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t vnr_priv_log2(new_slice, mel_output, VNR_MEL_FILTERS); //Calculate new_slice in state->scratch_data } -void vnr_priv_add_new_slice(uq8_24 (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice) +void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const int32_t *new_slice) { // Roll the patch buffer to get rid of oldest slice // self.feature_buffers[buffer_number] = np.roll(self.feature_buffers[buffer_number], -1, axis=0) diff --git a/modules/lib_vnr/src/features/vnr_features_priv.h b/modules/lib_vnr/src/features/vnr_features_priv.h index 65b68e4e0..b7d696163 100644 --- a/modules/lib_vnr/src/features/vnr_features_priv.h +++ b/modules/lib_vnr/src/features/vnr_features_priv.h @@ -46,7 +46,7 @@ void vnr_priv_make_slice(uq8_24 *new_slice, const bfp_complex_s32_t *X, int32_t * * This function name matches with the corresponding function in py_vnr python model. */ -void vnr_priv_add_new_slice(uq8_24 (*feature_buffers)[VNR_MEL_FILTERS], const uq8_24 *new_slice); +void vnr_priv_add_new_slice(int32_t (*feature_buffers)[VNR_MEL_FILTERS], const int32_t *new_slice); /** * @brief Normalise a patch by subtracting the max. From 4c241c4072928e6a0621c78a37be773196e7d662 Mon Sep 17 00:00:00 2001 From: Shuchita Khare Date: Wed, 8 Feb 2023 16:00:37 +0000 Subject: [PATCH 48/65] Fixed hpf_coef_q30 type --- test/test_hpf/src/test_hpf_comp_double.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_hpf/src/test_hpf_comp_double.c b/test/test_hpf/src/test_hpf_comp_double.c index 494a8fa0d..5a9f9e214 100644 --- a/test/test_hpf/src/test_hpf_comp_double.c +++ b/test/test_hpf/src/test_hpf_comp_double.c @@ -5,7 +5,7 @@ #define len 240 -extern const uq2_30 hpf_coef_q30[TOTAL_NUM_COEFF]; +extern const q2_30 hpf_coef_q30[TOTAL_NUM_COEFF]; void biquad(double out[len + 2], const double in[len + 2], const double coef[NUM_COEFF_PER_BIQUAD]){ for(int v = 2; v < len + 2; v++){ From dcddc4adb73ae6c02282aeb3eedd1e7038284604 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 08:34:17 +0000 Subject: [PATCH 49/65] Update quickstart guide --- doc/getting_started/index.rst | 82 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index e05968b3a..d262d5e17 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -16,75 +16,75 @@ Building The following instructions show how to build the Voice Framework and run one of the example applications. This procedure is currently supported on MacOS and Linux only. -1. Enter the clone of the Voice Framework and initialise submodules +#. Enter the clone of the Voice Framework and initialise submodules -.. code-block:: console + .. code-block:: console - cd fwk_voice - git submodule update --init --recursive + cd fwk_voice + git submodule update --init --recursive -2. Create a build directory +#. Create a build directory -.. code-block:: console + .. code-block:: console - mkdir build - cd build + mkdir build + cd build -3. Run cmake to setup the build environment for the XMOS toolchain +#. Run cmake to setup the build environment for the XMOS toolchain -.. tab:: Linux and Mac + .. tab:: Linux and Mac - .. code-block:: console + .. code-block:: console - cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -.. tab:: Windows + .. tab:: Windows - .. code-block:: console + .. code-block:: console - # make sure you have the patch command available - cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + # make sure you have the patch command available + cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake -As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors -related to not being able to apply a patch to an already patched library are seen. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. + As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors + related to not being able to apply a patch to an already patched library are seen. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. -4. Running make will then build the Voice Framework libraries and example applications +#. Running make will then build the Voice Framework libraries and example applications -.. tab:: Linux and Mac + .. tab:: Linux and Mac - .. code-block:: console + .. code-block:: console - make fwk_voice_example_bare_metal_aec_1_thread + make fwk_voice_example_bare_metal_aec_1_thread -.. tab:: Windows + .. tab:: Windows - .. code-block:: console + .. code-block:: console - nmake fwk_voice_example_bare_metal_aec_1_thread + nmake fwk_voice_example_bare_metal_aec_1_thread -5. Install dependencies +#. Install dependencies -.. tab:: Linux and Mac + .. tab:: Linux and Mac - .. code-block:: console + .. code-block:: console - pip install -e build/fwk_voice_deps/xscope_fileio/ + pip install -e build/fwk_voice_deps/xscope_fileio/ -.. tab:: Windows + .. tab:: Windows - .. code-block:: console + .. code-block:: console - pip install -e fwk_voice_deps/xscope_fileio - cd fwk_voice_deps/xscope_fileio/host - cmake -G "NMake Makefiles" . - nmake - cd ../../../ + pip install -e fwk_voice_deps/xscope_fileio + cd fwk_voice_deps/xscope_fileio/host + cmake -G "NMake Makefiles" . + nmake + cd ../../../ -6. Run the single-threaded AEC example +#. Run the single-threaded AEC example -.. code-block:: console + .. code-block:: console - cd ../examples/bare-metal/aec_1_thread - python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav + cd ../examples/bare-metal/aec_1_thread + python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav -See :ref:`examples` for full details about the example applications. + See :ref:`examples` for full details about the example applications. From 0b1c19195815aaf2e9b59a425853a83afea507bf Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 09:28:18 +0000 Subject: [PATCH 50/65] More formatting --- doc/getting_started/index.rst | 6 +++++- doc/user_guide/audio_processing/index.rst | 8 ++++++-- doc/user_guide/index.rst | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index d262d5e17..57731f334 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -60,7 +60,7 @@ procedure is currently supported on MacOS and Linux only. .. code-block:: console - nmake fwk_voice_example_bare_metal_aec_1_thread + nmake fwk_voice_example_bare_metal_aec_1_thread #. Install dependencies @@ -80,6 +80,10 @@ procedure is currently supported on MacOS and Linux only. nmake cd ../../../ +.. raw:: latex + + \newpage + #. Run the single-threaded AEC example .. code-block:: console diff --git a/doc/user_guide/audio_processing/index.rst b/doc/user_guide/audio_processing/index.rst index ee8eaf4ed..52536ee66 100644 --- a/doc/user_guide/audio_processing/index.rst +++ b/doc/user_guide/audio_processing/index.rst @@ -6,10 +6,12 @@ At the core of the Voice Framework are high-performance audio processing algorit A flexible audio signal routing infrastructure and a range of digital inputs and outputs enables the Voice Framework to be integrated into a wide range of system configurations, that can be configured at start up and during operation through a set of control registers. In addition, all source code is provided to allow for full customization or the addition of other audio processing algorithms. +************** AUDIO FEATURES +************** .. toctree:: - :maxdepth: 1 + :maxdepth: 2 ../../../modules/lib_aec/doc/index ../../../modules/lib_ns/doc/index @@ -18,9 +20,11 @@ AUDIO FEATURES ../../../modules/lib_ic/doc/index ../../../modules/lib_vnr/doc/index +******** EXAMPLES +******** .. toctree:: - :maxdepth: 1 + :maxdepth: 2 ../../../examples/bare-metal/doc/index diff --git a/doc/user_guide/index.rst b/doc/user_guide/index.rst index cde68336c..e4de3d358 100644 --- a/doc/user_guide/index.rst +++ b/doc/user_guide/index.rst @@ -7,6 +7,6 @@ The Voice Framework Design Guide is written for system architects and engineers It is expected that this document is read in conjunction with the relevant datasheet and that the user is familiar with basic voice processing terminology. .. toctree:: - :maxdepth: 1 + :maxdepth: 2 audio_processing/index From 4c26967a7c393a0f2cb91792723de9dc9186d205 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 10:28:28 +0000 Subject: [PATCH 51/65] Fix some issues --- doc/getting_started/index.rst | 8 ++++---- modules/lib_aec/doc/src/getting_started.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index 57731f334..5b698269e 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -80,15 +80,15 @@ procedure is currently supported on MacOS and Linux only. nmake cd ../../../ -.. raw:: latex +.. raw:: pdf - \newpage + PageBreak oneColumn -#. Run the single-threaded AEC example +6. Run the single-threaded AEC example .. code-block:: console cd ../examples/bare-metal/aec_1_thread python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav - See :ref:`examples` for full details about the example applications. + See :ref:`examples` section in User Guide for full details about the example applications. diff --git a/modules/lib_aec/doc/src/getting_started.rst b/modules/lib_aec/doc/src/getting_started.rst index d80826ab8..108147375 100644 --- a/modules/lib_aec/doc/src/getting_started.rst +++ b/modules/lib_aec/doc/src/getting_started.rst @@ -43,7 +43,7 @@ details about the fields within the state modified when calling a given function Low level API has more input arguments but allows more freedom for running in parallel across multiple threads. Low level API function names begin with a ``aec_l2_`` prefix. Depending on the low level API used, functions can be run in parallel to work over a range of bins or a range of phases. -This API is still a work in progess and will be fully supported in the future. +This API is still a work in progress and will be fully supported in the future. Getting and Building #################### From a6fd707c2f069d97295cf29daf23c5b284790070 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 11:27:17 +0000 Subject: [PATCH 52/65] Fix spelling --- .github/workflows/docs.yml | 4 ++-- examples/bare-metal/ic/README.rst | 4 ++-- examples/bare-metal/pipeline_alt_arch/README.rst | 4 ++-- modules/lib_adec/api/adec_api.h | 2 +- modules/lib_adec/api/adec_state.h | 4 ++-- modules/lib_adec/doc/src/getting_started.rst | 2 +- modules/lib_adec/doc/src/overview.rst | 2 +- modules/lib_aec/api/aec_api.h | 16 ++++++++-------- modules/lib_aec/api/aec_defines.h | 2 +- modules/lib_aec/api/aec_state.h | 4 ++-- modules/lib_ic/api/ic_api.h | 2 +- modules/lib_ic/api/ic_defines.h | 6 +++--- modules/lib_ic/api/ic_state.h | 2 +- modules/lib_ic/doc/src/getting_started.rst | 2 +- modules/lib_ns/api/ns_state.h | 8 ++++---- modules/lib_vnr/api/features/vnr_features_api.h | 2 +- 16 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 35b74eec2..d0804601b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Voice Framework - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Pull doc_builder container run: | @@ -43,7 +43,7 @@ jobs: docker run --rm -t -u "$(id -u):$(id -g)" -v ${{ github.workspace }}:/build -e REPO:/build -e DOXYGEN_INCLUDE=/build/doc/Doxyfile.inc -e EXCLUDE_PATTERNS=/build/doc/exclude_patterns.inc -e DOXYGEN_INPUT=ignore -e PDF=1 ghcr.io/xmos/doc_builder:main - name: Save documentation artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: fwk_voice_docs path: ./doc/_build diff --git a/examples/bare-metal/ic/README.rst b/examples/bare-metal/ic/README.rst index 4ca8258dc..718bbbb0e 100644 --- a/examples/bare-metal/ic/README.rst +++ b/examples/bare-metal/ic/README.rst @@ -5,7 +5,7 @@ ic This example demonstrates how the IC functions are called to process data through the IC stage of a voice pipeline. -A 32-bit, 2 channel wav file input.wav is read and processed through the IC stage frame by frame. The input file consistes of 2 channels of +A 32-bit, 2 channel wav file input.wav is read and processed through the IC stage frame by frame. The input file consists of 2 channels of mic input consisting of a `Alexa` utterances with a point noise source consisting of pop music. The signal and noise sources in input.wav come from different spatial locations. @@ -61,7 +61,7 @@ From the fwk_voice/build folder run: Output ------ -The output file output.wav is generated in the `fwk_voice/examples/bare-metal/ic` directory. When viewing output.wav in a visual audio tool, such as Audacity, you can see a stark differnce between the channels emitted. Channel 0 is the IC output and is suitable for increasing the SNR in automatic speech recognition (ASR) applications. Channel 1 is the `simple beamformed` (average of mic 0 and mic 1 inputs) which may be preferable in comms (human to human) applications. The logic for channel 1 is contained in the ``ic_test_task.c`` file and is not part of the IC library.s +The output file output.wav is generated in the `fwk_voice/examples/bare-metal/ic` directory. When viewing output.wav in a visual audio tool, such as Audacity, you can see a stark difference between the channels emitted. Channel 0 is the IC output and is suitable for increasing the SNR in automatic speech recognition (ASR) applications. Channel 1 is the `simple beamformed` (average of mic 0 and mic 1 inputs) which may be preferable in comms (human to human) applications. The logic for channel 1 is contained in the ``ic_test_task.c`` file and is not part of the IC library.s .. image:: ic_output.png :alt: Comparision between the IC output and simple beamformed output diff --git a/examples/bare-metal/pipeline_alt_arch/README.rst b/examples/bare-metal/pipeline_alt_arch/README.rst index c3f46233c..d30314932 100644 --- a/examples/bare-metal/pipeline_alt_arch/README.rst +++ b/examples/bare-metal/pipeline_alt_arch/README.rst @@ -17,7 +17,7 @@ output is ignored and the mic input is directly sent to output. Once the new del applied, the AEC gets configured back to its original configuration and starts adapting and cancellation. This example supports a maximum of 150ms of delay correction, in either direction, between the reference and microphone input. -In the absense of activity on the reference channels, when the AEC is disabled, the mic input is copied directly to the output of the AEC. +In the absence of activity on the reference channels, when the AEC is disabled, the mic input is copied directly to the output of the AEC. When enabled, the IC processes the two channel input. It will use the second channel as the reference to the first to output one channel of interference cancelled output. In this manner, it tries to cancel the room noise. However, to avoid cancelling the wanted signal, it only adapts in the absence of voice. @@ -64,7 +64,7 @@ To build the single-threaded firmware use fwk_voice_example_bare_metal_pipeline_ Running ******* -To run the multi-threaded application run these comands from the fwk_voice/build folder: +To run the multi-threaded application run these commands from the fwk_voice/build folder: .. tab:: Linux and Mac diff --git a/modules/lib_adec/api/adec_api.h b/modules/lib_adec/api/adec_api.h index 63fff6702..143d7dfe3 100644 --- a/modules/lib_adec/api/adec_api.h +++ b/modules/lib_adec/api/adec_api.h @@ -67,7 +67,7 @@ void adec_process_frame( * This function measures the microphone signal delay wrt the reference signal. It does so by * looking for the phase with the peak energy among all AEC filter phases and uses the peak energy phase index * as the estimate of the microphone delay. Along with the measured delay, it also outputs information - * about the peak phase energy that can then be used to guage the AEC filter convergence and the reliability of the + * about the peak phase energy that can then be used to gauge the AEC filter convergence and the reliability of the * measured delay. * * @param[out] de_state Delay estimator output structure diff --git a/modules/lib_adec/api/adec_state.h b/modules/lib_adec/api/adec_state.h index aa8c28681..30d1a1201 100644 --- a/modules/lib_adec/api/adec_state.h +++ b/modules/lib_adec/api/adec_state.h @@ -137,8 +137,8 @@ typedef struct { int32_t gated_milliseconds_since_mode_change; ///< milliseconds elapsed since a delay change was last requested. Used to ensure that delay corrections are not requested too early without allowing enough time for aec filter to converge. int32_t last_measured_delay; ///< Last measured delay int32_t peak_power_history_idx; ///< index storing the head of the peak_power_history circular buffer - int32_t peak_power_history_valid; ///< Flag indicating whether the peak_power_history buffer has been filled atleast once. - int32_t sf_copy_flag; ///< Flag indicating if shadow to main filter copy has happened atleast once in the AEC + int32_t peak_power_history_valid; ///< Flag indicating whether the peak_power_history buffer has been filled at least once. + int32_t sf_copy_flag; ///< Flag indicating if shadow to main filter copy has happened at least once in the AEC int32_t convergence_counter; ///< Counter indicating number of frames the AEC shadow filter has been attempting to converge. int32_t shadow_flag_counter; ///< Counter indicating number of frame the AEC shadow filter has been better than the main filter. adec_config_t adec_config; ///< ADEC configuration parameters structure. Can be modified by application at run-time to reconfigure ADEC. diff --git a/modules/lib_adec/doc/src/getting_started.rst b/modules/lib_adec/doc/src/getting_started.rst index 4a9cbbbde..0490fb205 100644 --- a/modules/lib_adec/doc/src/getting_started.rst +++ b/modules/lib_adec/doc/src/getting_started.rst @@ -5,7 +5,7 @@ Overview -------- ``lib_adec`` is a library which provides functions for measuring and correcting delay offsets between the reference -and loudpeaker signals. +and loudspeaker signals. ``lib_adec`` depends on ``lib_aec`` and ``lib_xcore_math`` libraries. For more details about the ADEC, refer to :ref:`adec_overview` diff --git a/modules/lib_adec/doc/src/overview.rst b/modules/lib_adec/doc/src/overview.rst index 88e153852..8e77ebf83 100644 --- a/modules/lib_adec/doc/src/overview.rst +++ b/modules/lib_adec/doc/src/overview.rst @@ -16,7 +16,7 @@ delay to be inserted into one of the two paths, to correct this delay difference The ADEC module provides functionality for * Measuring the current delay -* Using the measured delay along with AEC perfomance related metadata collected from the echo canceller to monitor AEC and make decisions about reconfiguring the AEC and correcting bulk delay offsets. +* Using the measured delay along with AEC performance related metadata collected from the echo canceller to monitor AEC and make decisions about reconfiguring the AEC and correcting bulk delay offsets. The metadata collected from AEC contains statistics such as the ERLE, the peak power seen in the adaptive filter and the peak power to average power ratio of the adaptive filter. diff --git a/modules/lib_aec/api/aec_api.h b/modules/lib_aec/api/aec_api.h index 5d787582b..d9e3b8350 100644 --- a/modules/lib_aec/api/aec_api.h +++ b/modules/lib_aec/api/aec_api.h @@ -44,7 +44,7 @@ * * main_mem_pool and shadow_mem_pool must point to memory buffers big enough to support main and shadow filter * processing. AEC state aec_state_t and shared state aec_shared_state_t structures contain only the BFP data - * strctures used in the AEC. The memory these BFP structures will point to needs to be provided by the user in the + * structures used in the AEC. The memory these BFP structures will point to needs to be provided by the user in the * memory pool main and shadow filters memory pool. An example memory pool structure is present in aec_memory_pool_t and * aec_shadow_filt_memory_pool_t. * @@ -244,7 +244,7 @@ void aec_calc_Error_and_Y_hat( * @brief Calculate coherence * * This function calculates the average coherence between mic input signal (`y`) and estimated mic signal (`y_hat`). - * A metric is calcuated using `y` and `y_hat` and the moving average (`coh`) and a slow moving average (`coh_slow`) of that metric is calculated. + * A metric is calculated using `y` and `y_hat` and the moving average (`coh`) and a slow moving average (`coh_slow`) of that metric is calculated. * The coherence values are used to distinguish between situations when filter adaption should continue or freeze and update mu accordingly. * * @param[inout] state AEC state structure. `state->shared_state->coh_mu_state[ch].coh` and `state->shared_state->coh_mu_state[ch].coh_slow` are updated @@ -275,12 +275,12 @@ void aec_calc_output( unsigned ch); /** - * @brief Calculate normalisation specturm + * @brief Calculate normalisation spectrum * * This function calculates the normalisation spectrum of the reference input signal. This normalised spectrum is later used during filter adaption to scale the adaption to the size of the input signal. * The normalisation spectrum is calculated as a time and frequency smoothed energy of the reference input spectrum. * - * The normalisation spectrum is calculated differetly for main and shadow filter, so a flag indicating whether this calculation is being done for the main or shadow filter is passed as an input to the function + * The normalisation spectrum is calculated differently for main and shadow filter, so a flag indicating whether this calculation is being done for the main or shadow filter is passed as an input to the function * * @param[inout] state AEC state structure. state->inv_X_energy[ch] is updated * @param[in] ch reference channel index for which to calculate normalisation spectrum @@ -296,8 +296,8 @@ void aec_calc_normalisation_spectrum( /** * @brief Compare and update filters. Calculate the adaption step size mu. * - * This function has 2 reponsibilities. - * First, it compares the energies in the error spectrums of the main and shadow filter with each other and with the mic input spectum energy, and makes an estimate of how well the filters are performing. Based on this, it optionally modifies the filters by either resetting the filter coefficients or copying one filter into another. + * This function has 2 responsibilities. + * First, it compares the energies in the error spectrums of the main and shadow filter with each other and with the mic input spectrum energy, and makes an estimate of how well the filters are performing. Based on this, it optionally modifies the filters by either resetting the filter coefficients or copying one filter into another. * Second, it uses the coherence values calculated in aec_calc_coherence as well as information from filter comparison done in step 1 to calculate the adaption step size mu. * * @param[inout] main_state AEC state structure for the main filter @@ -329,7 +329,7 @@ void aec_calc_T( /** @brief Update filter * * This function updates the adaptive filter spectrum (`H_hat'). It calculates the delta update that is applied to the filter by scaling the X FIFO with the T values computed in `aec_compute_T()` and applies the delta update to `H_hat`. - * A gradient contraint FFT is then applied to constrain the length of each phase of the filter to avoid wrapping when calculating `y_hat` + * A gradient constraint FFT is then applied to constrain the length of each phase of the filter to avoid wrapping when calculating `y_hat` * * @param[inout] state AEC state structure. `state->H_hat[y_ch]` is updated * @param[in] y_ch mic channel index @@ -357,7 +357,7 @@ void aec_update_X_fifo_1d( /** @brief Calculate a correlation metric between the microphone input and estimated microphone signal * - * This function calculates a metric of resemblence between the mic input and the estimated mic signal. The correlation + * This function calculates a metric of resemblance between the mic input and the estimated mic signal. The correlation * metric, along with reference signal energy is used to infer presence of near and far end signals in the AEC mic * input. * diff --git a/modules/lib_aec/api/aec_defines.h b/modules/lib_aec/api/aec_defines.h index a5e9f16a6..a700c864f 100644 --- a/modules/lib_aec/api/aec_defines.h +++ b/modules/lib_aec/api/aec_defines.h @@ -16,7 +16,7 @@ /** @brief Maximum number of microphone input channels supported in the library. * Microphone input to the AEC refers to the input from the device's microphones from which AEC removes the echo - * created in the room by the device's loudpeakers. + * created in the room by the device's loudspeakers. * * AEC functions follow the convention of using @math{y} and @math{Y} for referring to time domain and frequency domain * representation of microphone input. diff --git a/modules/lib_aec/api/aec_state.h b/modules/lib_aec/api/aec_state.h index ceae7eb42..9205ad95a 100644 --- a/modules/lib_aec/api/aec_state.h +++ b/modules/lib_aec/api/aec_state.h @@ -159,7 +159,7 @@ typedef struct { /** * @brief AEC shared state structure. * - * Data structures holding AEC persistant state that is common between main filter and shadow filter. + * Data structures holding AEC persistent state that is common between main filter and shadow filter. * aec_state_t::shared_state for both main and shadow filter point to the common aec_shared_t structure. * * @ingroup aec_types @@ -250,7 +250,7 @@ typedef struct { /** * @brief AEC state structure. * - * Data structures holding AEC persistant state. There are 2 instances of aec_state_t maintained within AEC; one for + * Data structures holding AEC persistent state. There are 2 instances of aec_state_t maintained within AEC; one for * main filter and one for shadow filter specific state. * * @ingroup aec_types diff --git a/modules/lib_ic/api/ic_api.h b/modules/lib_ic/api/ic_api.h index cc0371d38..ddceacfc0 100644 --- a/modules/lib_ic/api/ic_api.h +++ b/modules/lib_ic/api/ic_api.h @@ -75,7 +75,7 @@ void ic_calc_vnr_pred(ic_state_t *state, * @brief Adapts the IC filter according to previous frame's statistics and VNR input * * This function should be called after each call to ic_filter. - * Filter and adapt functions are seprated so that the external VNR can operate + * Filter and adapt functions are separated so that the external VNR can operate * on each frame. * * @param[inout] state pointer to IC state structure diff --git a/modules/lib_ic/api/ic_defines.h b/modules/lib_ic/api/ic_defines.h index 39d5683ff..5cb84f89b 100644 --- a/modules/lib_ic/api/ic_defines.h +++ b/modules/lib_ic/api/ic_defines.h @@ -39,7 +39,7 @@ * filter length. Hence a 10 phase filter will allow cancellation of noise sources with * up to 150ms of echo tail length. There is a tradeoff between adaption speed and * maximum cancellation of the filter; increasing the number of phases will increase - * the maximum cancellation at the cost of increasesed xCORE resource usage and slower + * the maximum cancellation at the cost of increased xCORE resource usage and slower * adaption times. * @ingroup ic_defines */ #define IC_FILTER_PHASES 10 // two_mic_stereo.json @@ -90,10 +90,10 @@ /** Alpha for EMA VNR prediction calculation. * @ingroup ic_defines */ #define IC_INIT_VNR_PRED_ALPHA 0.97 // From python model -/** Initial vaue for the input VNR prediction. +/** Initial value for the input VNR prediction. * @ingroup ic_defines */ #define IC_INIT_INPUT_VNR_PRED 0.5 // From python model -/** Initial vaue for the output VNR prediction. +/** Initial value for the output VNR prediction. * @ingroup ic_defines */ #define IC_INIT_OUTPUT_VNR_PRED 0.5 // From python model diff --git a/modules/lib_ic/api/ic_state.h b/modules/lib_ic/api/ic_state.h index 19a248199..815b67d8d 100644 --- a/modules/lib_ic/api/ic_state.h +++ b/modules/lib_ic/api/ic_state.h @@ -133,7 +133,7 @@ typedef struct { /** Adaption counter which counts number of frames has been adapted. */ uint32_t adapt_counter; - /** Flag that represents the state ao the filter. */ + /** Flag that represents the state of the filter. */ control_flag_e control_flag; /** Configuration parameters for the adaption controller. */ diff --git a/modules/lib_ic/doc/src/getting_started.rst b/modules/lib_ic/doc/src/getting_started.rst index 8b1171503..70966b9e3 100644 --- a/modules/lib_ic/doc/src/getting_started.rst +++ b/modules/lib_ic/doc/src/getting_started.rst @@ -7,7 +7,7 @@ Overview ``lib_ic`` is a library which provides functions that together perform Interference Cancellation (IC) on two channel input mic data by adapting to and modelling the room transfer characteristics. ``lib_ic`` library functions make use of functionality provided in ``lib_aec`` for the core normalised LMS blocks which in turn uses -``lib_xcore_math`` to perform DSP low-level optimised operations. For more details refer toc :ref:`ic_overview`. +``lib_xcore_math`` to perform DSP low-level optimised operations. For more details refer to :ref:`ic_overview`. Repository Structure -------------------- diff --git a/modules/lib_ns/api/ns_state.h b/modules/lib_ns/api/ns_state.h index 977d34fc8..e6cdd141a 100644 --- a/modules/lib_ns/api/ns_state.h +++ b/modules/lib_ns/api/ns_state.h @@ -43,7 +43,7 @@ */ #define NS_INT_EXP (-31) -/** The length of the window applyed in time domain +/** The length of the window applied in time domain * * @ingroup ns_defs */ @@ -64,7 +64,7 @@ typedef struct { //Dynamic MCRA filter coefficients /** BFP structure to hold the local energy. */ bfp_s32_t S; - /** BFP structure to hold the minimun local energy whithin 10 frames. */ + /** BFP structure to hold the minimum local energy within 10 frames. */ bfp_s32_t S_min; /** BFP structure to hold the temporary local energy. */ bfp_s32_t S_tmp; @@ -72,7 +72,7 @@ typedef struct { bfp_s32_t p; /** BFP structure to hold the time-varying smoothing parameter. */ bfp_s32_t alpha_d_tilde; - /** BFP structure to hold the noise estimanion. */ + /** BFP structure to hold the noise estimation. */ bfp_s32_t lambda_hat; /** int32_t array to hold the data for S. */ @@ -113,7 +113,7 @@ typedef struct { float_s32_t alpha_d; /** EWMA of the smoothing parameter for S. */ float_s32_t alpha_s; - /** EWMA of the smoohting parameter for p. */ + /** EWMA of the smoothing parameter for p. */ float_s32_t alpha_p; /** EWMA of the 1 - alpha_d parameter. */ float_s32_t one_minus_aplha_d; diff --git a/modules/lib_vnr/api/features/vnr_features_api.h b/modules/lib_vnr/api/features/vnr_features_api.h index 78acee544..4cc2459ed 100644 --- a/modules/lib_vnr/api/features/vnr_features_api.h +++ b/modules/lib_vnr/api/features/vnr_features_api.h @@ -76,7 +76,7 @@ void vnr_feature_state_init(vnr_feature_state_t *feature_state); * structure and feature_patch_data memory provided by the user. The feature output from this function are passed as input to the VNR inference engine. * * @param[inout] vnr_feature_state Pointer to the VNR feature extraction state structure - * @param[out] feature_patch Pointer to the bfp_s32_t structure allocated by the user. The user doesn't need to initialise this BFP strcuture + * @param[out] feature_patch Pointer to the bfp_s32_t structure allocated by the user. The user doesn't need to initialise this BFP structure * before passing it to this function. After this function call feature_patch will be updated and will point to the extracted features. * It can then be passed to the inference stage. * @param[out] feature_patch_data Pointer to the VNR_PATCH_WIDTH * VNR_MEL_FILTERS int32_t values allocated by the user. The extracted features will be written From 724c38c37c99f8384eb4dfa97f8a820dd83044d8 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 12:24:43 +0000 Subject: [PATCH 53/65] Fix example --- doc/user_guide/audio_processing/index.rst | 13 ++----------- doc/user_guide/index.rst | 3 ++- examples/bare-metal/doc/index.rst | 4 ++-- examples/bare-metal/ic/README.rst | 1 - 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/doc/user_guide/audio_processing/index.rst b/doc/user_guide/audio_processing/index.rst index 52536ee66..29b8e5624 100644 --- a/doc/user_guide/audio_processing/index.rst +++ b/doc/user_guide/audio_processing/index.rst @@ -7,11 +7,11 @@ At the core of the Voice Framework are high-performance audio processing algorit A flexible audio signal routing infrastructure and a range of digital inputs and outputs enables the Voice Framework to be integrated into a wide range of system configurations, that can be configured at start up and during operation through a set of control registers. In addition, all source code is provided to allow for full customization or the addition of other audio processing algorithms. ************** -AUDIO FEATURES +Audio Features ************** .. toctree:: - :maxdepth: 2 + :maxdepth: 3 ../../../modules/lib_aec/doc/index ../../../modules/lib_ns/doc/index @@ -19,12 +19,3 @@ AUDIO FEATURES ../../../modules/lib_adec/doc/index ../../../modules/lib_ic/doc/index ../../../modules/lib_vnr/doc/index - -******** -EXAMPLES -******** - -.. toctree:: - :maxdepth: 2 - - ../../../examples/bare-metal/doc/index diff --git a/doc/user_guide/index.rst b/doc/user_guide/index.rst index e4de3d358..dbf4eb0d5 100644 --- a/doc/user_guide/index.rst +++ b/doc/user_guide/index.rst @@ -7,6 +7,7 @@ The Voice Framework Design Guide is written for system architects and engineers It is expected that this document is read in conjunction with the relevant datasheet and that the user is familiar with basic voice processing terminology. .. toctree:: - :maxdepth: 2 + :maxdepth: 3 audio_processing/index + ../../examples/bare-metal/doc/index diff --git a/examples/bare-metal/doc/index.rst b/examples/bare-metal/doc/index.rst index 636b575ae..177ef1191 100644 --- a/examples/bare-metal/doc/index.rst +++ b/examples/bare-metal/doc/index.rst @@ -27,8 +27,8 @@ build step has been completed prior to this. .. toctree:: - :maxdepth: 1 - + :maxdepth: 3 + aec_1_thread aec_2_threads vnr diff --git a/examples/bare-metal/ic/README.rst b/examples/bare-metal/ic/README.rst index 718bbbb0e..e329d888e 100644 --- a/examples/bare-metal/ic/README.rst +++ b/examples/bare-metal/ic/README.rst @@ -2,7 +2,6 @@ ic =============== - This example demonstrates how the IC functions are called to process data through the IC stage of a voice pipeline. A 32-bit, 2 channel wav file input.wav is read and processed through the IC stage frame by frame. The input file consists of 2 channels of From a7e8cdcea0427edaaf48123b520ba54ab92eefe9 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 12:35:58 +0000 Subject: [PATCH 54/65] Try to fix references --- doc/getting_started/index.rst | 2 +- modules/lib_vnr/doc/index.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index 5b698269e..eb84f3fd8 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -91,4 +91,4 @@ procedure is currently supported on MacOS and Linux only. cd ../examples/bare-metal/aec_1_thread python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav - See :ref:`examples` section in User Guide for full details about the example applications. + See `Example Applications`_ section in User Guide for full details about the example applications diff --git a/modules/lib_vnr/doc/index.rst b/modules/lib_vnr/doc/index.rst index 9ac0577ec..92a3ab9e5 100644 --- a/modules/lib_vnr/doc/index.rst +++ b/modules/lib_vnr/doc/index.rst @@ -25,5 +25,5 @@ On GitHub Indices and tables ****************** -* :ref:`genindex` -* :ref:`search` +* `genindex`_ +* `search`_ From 442fb14f1fec85b6056b2541bf5d604629f5f8cc Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 13:25:18 +0000 Subject: [PATCH 55/65] Remove unresolved references --- doc/getting_started/index.rst | 2 +- modules/lib_adec/doc/index.rst | 8 -------- modules/lib_aec/doc/index.rst | 6 ------ modules/lib_agc/doc/index.rst | 7 ------- modules/lib_ic/doc/index.rst | 7 ------- modules/lib_ns/doc/index.rst | 6 ------ modules/lib_vnr/doc/index.rst | 6 ------ 7 files changed, 1 insertion(+), 41 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index eb84f3fd8..715583063 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -91,4 +91,4 @@ procedure is currently supported on MacOS and Linux only. cd ../examples/bare-metal/aec_1_thread python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav - See `Example Applications`_ section in User Guide for full details about the example applications + See ``Example Applications`` section in the User Guide for full details about the examples. diff --git a/modules/lib_adec/doc/index.rst b/modules/lib_adec/doc/index.rst index 2b2fbd38b..f584e3f3f 100644 --- a/modules/lib_adec/doc/index.rst +++ b/modules/lib_adec/doc/index.rst @@ -25,11 +25,3 @@ API To use the functions in this library in an application, include :ref:`adec_api_h` in the application source file -Indices and tables -****************** - -* :ref:`genindex` -* :ref:`search` - - - diff --git a/modules/lib_aec/doc/index.rst b/modules/lib_aec/doc/index.rst index 883f8fdea..68a644c7b 100755 --- a/modules/lib_aec/doc/index.rst +++ b/modules/lib_aec/doc/index.rst @@ -26,9 +26,3 @@ API To use the functions in this library in an application, include :ref:`aec_api_h` in the application source file - -Indices and tables -****************** - -* :ref:`genindex` -* :ref:`search` diff --git a/modules/lib_agc/doc/index.rst b/modules/lib_agc/doc/index.rst index 789fbb1d4..358d4f700 100644 --- a/modules/lib_agc/doc/index.rst +++ b/modules/lib_agc/doc/index.rst @@ -26,10 +26,3 @@ API --- To use the functions in this library in an application, include :ref:`agc_api_h` in the application source file. - - -Indices and tables -****************** - -* :ref:`genindex` -* :ref:`search` diff --git a/modules/lib_ic/doc/index.rst b/modules/lib_ic/doc/index.rst index 16e81b70f..99da5f76f 100755 --- a/modules/lib_ic/doc/index.rst +++ b/modules/lib_ic/doc/index.rst @@ -25,10 +25,3 @@ API --- To use the functions in this library in an application, include :ref:`ic_api_h` in the application source file - - -Indices and tables -****************** - -* :ref:`genindex` -* :ref:`search` diff --git a/modules/lib_ns/doc/index.rst b/modules/lib_ns/doc/index.rst index ecf997419..47784524c 100644 --- a/modules/lib_ns/doc/index.rst +++ b/modules/lib_ns/doc/index.rst @@ -25,9 +25,3 @@ API To use the functions in this library in an application, include :ref:`ns_api_h` in the application source file. - -Indices and tables -****************** - -* :ref:`genindex` -* :ref:`search` \ No newline at end of file diff --git a/modules/lib_vnr/doc/index.rst b/modules/lib_vnr/doc/index.rst index 92a3ab9e5..d029f4d0d 100644 --- a/modules/lib_vnr/doc/index.rst +++ b/modules/lib_vnr/doc/index.rst @@ -21,9 +21,3 @@ On GitHub ``lib_vnr`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. The ``lib_vnr`` module can be found in the `modules/lib_vnr` directory in ``fwk_voice``. - -Indices and tables -****************** - -* `genindex`_ -* `search`_ From 0d6e6f675c273f959ffceab976e5e4738965abfd Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 14:00:32 +0000 Subject: [PATCH 56/65] Rework structure of user guide --- modules/lib_adec/doc/index.rst | 10 ++++---- modules/lib_adec/doc/src/getting_started.rst | 15 ++---------- modules/lib_adec/doc/src/overview.rst | 2 +- modules/lib_aec/doc/index.rst | 16 ++++++------- modules/lib_aec/doc/src/getting_started.rst | 19 ++++----------- modules/lib_aec/doc/src/overview.rst | 2 +- modules/lib_agc/doc/index.rst | 11 ++++----- modules/lib_agc/doc/src/getting_started.rst | 16 +++---------- modules/lib_agc/doc/src/overview.rst | 2 +- modules/lib_ic/doc/index.rst | 15 ++++++------ modules/lib_ic/doc/src/getting_started.rst | 6 ----- modules/lib_ic/doc/src/overview.rst | 2 +- modules/lib_ns/doc/index.rst | 11 ++++----- modules/lib_ns/doc/src/getting_started.rst | 17 +++----------- modules/lib_ns/doc/src/overview.rst | 2 +- modules/lib_vnr/doc/index.rst | 13 ++++------- modules/lib_vnr/doc/src/getting_started.rst | 23 ++++++------------- modules/lib_vnr/doc/src/overview.rst | 2 +- .../doc/src/reference/header_files.rst | 2 +- 19 files changed, 61 insertions(+), 125 deletions(-) diff --git a/modules/lib_adec/doc/index.rst b/modules/lib_adec/doc/index.rst index f584e3f3f..5acc14bd9 100644 --- a/modules/lib_adec/doc/index.rst +++ b/modules/lib_adec/doc/index.rst @@ -1,15 +1,15 @@ Automatic Delay Estimation and Correction Library ================================================= -Introduction -************ - -``lib_adec`` is a library of functions to measure and automatically correct possible delay offsets between the reference and microphone signals. +``lib_adec`` is a library which provides functions for measuring and correcting delay offsets between the reference +and loudspeaker signals. +``lib_adec`` depends on ``lib_aec`` and ``lib_xcore_math`` libraries. For more details about the ADEC, refer to +:ref:`adec_overview` .. toctree:: :maxdepth: 1 :caption: Contents: - + src/getting_started src/overview src/reference/index diff --git a/modules/lib_adec/doc/src/getting_started.rst b/modules/lib_adec/doc/src/getting_started.rst index 0490fb205..6a5d637a2 100644 --- a/modules/lib_adec/doc/src/getting_started.rst +++ b/modules/lib_adec/doc/src/getting_started.rst @@ -1,16 +1,5 @@ -Getting Started -=============== - -Overview --------- - -``lib_adec`` is a library which provides functions for measuring and correcting delay offsets between the reference -and loudspeaker signals. -``lib_adec`` depends on ``lib_aec`` and ``lib_xcore_math`` libraries. For more details about the ADEC, refer to -:ref:`adec_overview` - Repository Structure --------------------- +******************** * ``modules/lib_adec`` - The actual ``lib_adec`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_adec`` @@ -19,7 +8,7 @@ Repository Structure * ``src/`` - Library source code. Getting and Building --------------------- +******************** ``lib_adec`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_adec`` is compiled as a static library as part of diff --git a/modules/lib_adec/doc/src/overview.rst b/modules/lib_adec/doc/src/overview.rst index 8e77ebf83..aa34c3259 100644 --- a/modules/lib_adec/doc/src/overview.rst +++ b/modules/lib_adec/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _adec_overview: ADEC Overview -~~~~~~~~~~~~~~ +************* The ADEC module provides functions to estimate and automatically correct for delay offsets between the reference and the loudspeakers. diff --git a/modules/lib_aec/doc/index.rst b/modules/lib_aec/doc/index.rst index 68a644c7b..78cea0912 100755 --- a/modules/lib_aec/doc/index.rst +++ b/modules/lib_aec/doc/index.rst @@ -1,28 +1,28 @@ Acoustic Echo Canceller Library -================================ +=============================== -Introduction -************ - -``lib_aec`` is a library of functions for performing Acoustic Echo Cancellation on input data. +``lib_aec`` is a library which provides functions that can be put together to perform Acoustic Echo Cancellation (AEC) +on input mic data using the input reference data to model the room echo characteristics. ``lib_aec`` library functions +make use of functionality provided in ``lib_xcore_math`` to perform DSP operations. For more details refer to +:ref:`aec_overview`. .. toctree:: :maxdepth: 1 :caption: Contents: - + src/getting_started src/overview src/reference/index On GitHub ---------- +********* ``lib_aec`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. ``lib_aec`` is present within the `modules/lib_aec` directory in ``fwk_voice`` API ---- +*** To use the functions in this library in an application, include :ref:`aec_api_h` in the application source file diff --git a/modules/lib_aec/doc/src/getting_started.rst b/modules/lib_aec/doc/src/getting_started.rst index 108147375..37b469c8d 100644 --- a/modules/lib_aec/doc/src/getting_started.rst +++ b/modules/lib_aec/doc/src/getting_started.rst @@ -1,16 +1,5 @@ -Getting Started -=============== - -Overview --------- - -``lib_aec`` is a library which provides functions that can be put together to perform Acoustic Echo Cancellation (AEC) -on input mic data using the input reference data to model the room echo characteristics. ``lib_aec`` library functions -make use of functionality provided in ``lib_xcore_math`` to perform DSP operations. For more details refer to -:ref:`aec_overview`. - Repository Structure --------------------- +******************** * ``modules/lib_aec`` - The actual ``lib_aec`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_aec`` @@ -20,14 +9,14 @@ Repository Structure Requirements ------------- +************ ``lib_aec`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_aec`` is compiled as a static library as part of overall ``fwk_voice`` build. It depends on `lib_xcore_math `_. API Structure -------------- +************* The API can be categorised into high level and low level functions. @@ -46,7 +35,7 @@ Depending on the low level API used, functions can be run in parallel to work ov This API is still a work in progress and will be fully supported in the future. Getting and Building -#################### +******************** This repo is got as part of the parent ``fwk_voice`` repo clone. It is compiled as a static library as part of fwk_voice compilation process. diff --git a/modules/lib_aec/doc/src/overview.rst b/modules/lib_aec/doc/src/overview.rst index 9faeea0a8..616d789be 100644 --- a/modules/lib_aec/doc/src/overview.rst +++ b/modules/lib_aec/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _aec_overview: AEC Overview -~~~~~~~~~~~~ +************ The lib_aec library provides functions that can be put together to perform Automatic Echo Cancellation on input microphone data by using diff --git a/modules/lib_agc/doc/index.rst b/modules/lib_agc/doc/index.rst index 358d4f700..4007b003e 100644 --- a/modules/lib_agc/doc/index.rst +++ b/modules/lib_agc/doc/index.rst @@ -1,11 +1,10 @@ Automatic Gain Control Library ============================== -Introduction -************ +``lib_agc`` is a library which performs Automatic Gain Control (AGC), with support for Loss Control. +For more details, refer to :ref:`agc_overview`. + -``lib_agc`` is a library of functions for performing Automatic Gain Control on input data. It can dynamically -adapt to maintain a specified output level for the voice content. .. toctree:: :maxdepth: 1 @@ -17,12 +16,12 @@ adapt to maintain a specified output level for the voice content. On GitHub ---------- +********* ``lib_agc`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. ``lib_agc`` is present within the `modules/lib_agc` directory in ``fwk_voice``. API ---- +*** To use the functions in this library in an application, include :ref:`agc_api_h` in the application source file. diff --git a/modules/lib_agc/doc/src/getting_started.rst b/modules/lib_agc/doc/src/getting_started.rst index 3aa90a7ec..cf2e87f2c 100644 --- a/modules/lib_agc/doc/src/getting_started.rst +++ b/modules/lib_agc/doc/src/getting_started.rst @@ -1,15 +1,5 @@ -Getting Started -=============== - -Overview --------- - -``lib_agc`` is a library which performs Automatic Gain Control (AGC), with support for Loss Control. -For more details, refer to :ref:`agc_overview`. - - Repository Structure --------------------- +******************** * ``modules/lib_agc`` - The actual ``lib_agc`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_agc`` @@ -20,7 +10,7 @@ Repository Structure Requirements ------------- +************ ``lib_agc`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_agc`` is compiled as a static library as part of the overall @@ -28,7 +18,7 @@ and building ``fwk_voice`` apply. ``lib_agc`` is compiled as a static library as Getting and Building --------------------- +******************** This module is part of the parent ``fwk_voice`` repo clone. It is compiled as a static library as part of ``fwk_voice`` compilation process. diff --git a/modules/lib_agc/doc/src/overview.rst b/modules/lib_agc/doc/src/overview.rst index 2e31aaa8a..954854805 100644 --- a/modules/lib_agc/doc/src/overview.rst +++ b/modules/lib_agc/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _agc_overview: AGC Overview -~~~~~~~~~~~~ +************ The ``lib_agc`` library provides an API to implement Automatic Gain Control within an application. The goal of the AGC algorithm is to provide consistent output diff --git a/modules/lib_ic/doc/index.rst b/modules/lib_ic/doc/index.rst index 99da5f76f..8ffa7b4c7 100755 --- a/modules/lib_ic/doc/index.rst +++ b/modules/lib_ic/doc/index.rst @@ -1,27 +1,26 @@ Interference Canceller Library ============================== -Introduction -************ - -``lib_ic`` is a library of functions for performing Cancellation of Interference of point noise sources in a two channel microphone source. - +``lib_ic`` is a library which provides functions that together perform Interference Cancellation (IC) +on two channel input mic data by adapting to and modelling the room transfer characteristics. ``lib_ic`` library functions +make use of functionality provided in ``lib_aec`` for the core normalised LMS blocks which in turn uses +``lib_xcore_math`` to perform DSP low-level optimised operations. For more details refer to :ref:`ic_overview`. .. toctree:: :maxdepth: 1 :caption: Contents: - + src/getting_started src/overview src/reference/index On GitHub ---------- +********* ``lib_ic`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. The ``lib_ic`` module can be found in the `modules/lib_ic` directory in ``fwk_voice``. API ---- +*** To use the functions in this library in an application, include :ref:`ic_api_h` in the application source file diff --git a/modules/lib_ic/doc/src/getting_started.rst b/modules/lib_ic/doc/src/getting_started.rst index 70966b9e3..d7cce11e2 100644 --- a/modules/lib_ic/doc/src/getting_started.rst +++ b/modules/lib_ic/doc/src/getting_started.rst @@ -3,12 +3,6 @@ Getting Started Overview -------- - -``lib_ic`` is a library which provides functions that together perform Interference Cancellation (IC) -on two channel input mic data by adapting to and modelling the room transfer characteristics. ``lib_ic`` library functions -make use of functionality provided in ``lib_aec`` for the core normalised LMS blocks which in turn uses -``lib_xcore_math`` to perform DSP low-level optimised operations. For more details refer to :ref:`ic_overview`. - Repository Structure -------------------- diff --git a/modules/lib_ic/doc/src/overview.rst b/modules/lib_ic/doc/src/overview.rst index 7d7dc14d6..abeac8bad 100755 --- a/modules/lib_ic/doc/src/overview.rst +++ b/modules/lib_ic/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _ic_overview: IC Overview -=========== +*********** The Interference Canceller (IC) suppresses static noise from point sources such as cooker hoods, washing machines, or radios for which there is no reference audio signal available. When the Voice to Noise Ratio estimator (VNR) input diff --git a/modules/lib_ns/doc/index.rst b/modules/lib_ns/doc/index.rst index 47784524c..10cc99578 100644 --- a/modules/lib_ns/doc/index.rst +++ b/modules/lib_ns/doc/index.rst @@ -1,10 +1,9 @@ Noise Suppression Library ========================= -Introduction -************ - -``lib_ns`` is a library of functions for performing Noise Suppression on input data. +``lib_ns`` is a library which performs Noise Suppression (NS), by estimating the noise and +subtracting it from frame. ``lib_ns`` library functions make use of functionality +provided in ``lib_xcore_math`` to perform DSP operations. For more details, refer to :ref:`ns_overview`. .. toctree:: :maxdepth: 1 @@ -15,13 +14,13 @@ Introduction src/reference/index On GitHub ---------- +********* ``lib_ns`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. ``lib_ns`` is present within the `modules/lib_ns` directory in ``fwk_voice``. API ---- +*** To use the functions in this library in an application, include :ref:`ns_api_h` in the application source file. diff --git a/modules/lib_ns/doc/src/getting_started.rst b/modules/lib_ns/doc/src/getting_started.rst index 9f328e032..61c983da2 100644 --- a/modules/lib_ns/doc/src/getting_started.rst +++ b/modules/lib_ns/doc/src/getting_started.rst @@ -1,16 +1,5 @@ -Getting Started -=============== - -Overview --------- - -``lib_ns`` is a library which performs Noise Suppression (NS), by estimating the noise and -subtracting it from frame. ``lib_ns`` library functions make use of functionality -provided in ``lib_xcore_math`` to perform DSP operations. For more details, refer to :ref:`ns_overview`. - - Repository Structure --------------------- +******************** * ``modules/lib_ns`` - The actual ``lib_ns`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_ns`` @@ -21,7 +10,7 @@ Repository Structure Requirements ------------- +************ ``lib_ns`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_ns`` is compiled as a static library as part of the overall @@ -29,7 +18,7 @@ and building ``fwk_voice`` apply. ``lib_ns`` is compiled as a static library as Getting and Building --------------------- +******************** This module is part of the parent ``fwk_voice`` repo clone. It is compiled as a static library as part of ``fwk_voice`` compilation process. diff --git a/modules/lib_ns/doc/src/overview.rst b/modules/lib_ns/doc/src/overview.rst index bbf31d48f..ec216a82a 100644 --- a/modules/lib_ns/doc/src/overview.rst +++ b/modules/lib_ns/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _ns_overview: NS Overview -~~~~~~~~~~~ +*********** The ``lib_ns`` library provides an API to implement Noise Suppression within an application. diff --git a/modules/lib_vnr/doc/index.rst b/modules/lib_vnr/doc/index.rst index d029f4d0d..1abf73cc6 100644 --- a/modules/lib_vnr/doc/index.rst +++ b/modules/lib_vnr/doc/index.rst @@ -1,22 +1,19 @@ Voice To Noise Ratio Estimator Library ======================================= -Introduction -************ - -``lib_vnr`` is a library that predicts the signal to noise ratio of a speech signal in noise, using a neutral network. - +``lib_vnr`` is a library which estimates the ratio of speech signal in noise for an input audio stream. +``lib_vnr`` library functions uses ``lib_xcore_math`` to perform DSP using low-level optimised operations, and ``lib_tflite_micro`` and ``lib_nn`` to perform inference using an optimised TensorFlow Lite model. .. toctree:: :maxdepth: 1 - :caption: Contents: - + :caption: Contents + src/getting_started src/overview src/reference/index On GitHub ---------- +********* ``lib_vnr`` is present as part of ``fwk_voice``. Get the latest version of ``fwk_voice`` from ``https://github.com/xmos/fwk_voice``. The ``lib_vnr`` module can be found in the `modules/lib_vnr` directory in ``fwk_voice``. diff --git a/modules/lib_vnr/doc/src/getting_started.rst b/modules/lib_vnr/doc/src/getting_started.rst index b460a995f..9bd26756c 100644 --- a/modules/lib_vnr/doc/src/getting_started.rst +++ b/modules/lib_vnr/doc/src/getting_started.rst @@ -1,16 +1,7 @@ .. _getting_started: -Getting Started -=============== - -Overview --------- - -``lib_vnr`` is a library which estimates the ratio of speech signal in noise for an input audio stream. -``lib_vnr`` library functions uses ``lib_xcore_math`` to perform DSP using low-level optimised operations, and ``lib_tflite_micro`` and ``lib_nn`` to perform inference using an optimised TensorFlow Lite model. - Repository Structure --------------------- +******************** * ``modules/lib_vnr`` - The ``lib_vnr`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_vnr``: @@ -21,19 +12,19 @@ Repository Structure Requirements ------------- +************ ``lib_vnr`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. It depends on ``lib_xcore_math``, ``lib_tflite_micro`` and ``lib_nn``. -API Structure -------------- +API +*** The API is split into 2 parts; feature extraction and inference. The feature extraction API processes an input audio frame to extract features that are input to the inference stage. The inference API has functions for running inference using the VNR TensorFlow Lite model to predict the speech to noise ratio. Both feature extraction and inference APIs have initialisation functions that are called only once at device initialisation and processing functions that are called every frame. The performance requirement is relative low, around 5 MIPS for initialisation and 3 MIPS for processing, and as such is supplied as a single threaded implementation only. Getting and Building --------------------- +******************** The VNR estimator module is obtained as part of the parent ``fwk_voice`` repo clone. It is present in ``fwk_voice/modules/lib_vnr`` @@ -41,12 +32,12 @@ The feature extraction part of lib_vnr can be compiled as a static library. The VNR inference engine compilation however, requires the runtime HW target to be specified, information about which is not available at library compile time. To include VNR inference engine in an application, it needs to compile the VNR inference related files from source. `lib_vnr module CMake file `_ demonstrates the VNR inference engine compiled as an INTERFACE library and if compiling using CMake, the application can simply `link` against the fwk_voice::vnr::inference library. For an example of compiling an application with VNR using CMake, refer to `VNR example CMake file `_. VNR Inference Model -------------------- +******************* The VNR estimator module uses a neural network model to predict the SNR of speech in noise for incoming data. The model used is a pre trained TensorFlow Lite model that has been optimised for the XCORE architecture using the `xmos-ai-tools `_ xformer. The optimised model is compiled as part of the VNR Inference Engine. Changing the model at runtime is not supported. If changing to a different model, the application needs to generate the model related files, copy them to the appropriate directory within the VNR module and recompile. Part of this process is automated through a python script, as described below. .. toctree:: :maxdepth: 1 - + xformer.rst diff --git a/modules/lib_vnr/doc/src/overview.rst b/modules/lib_vnr/doc/src/overview.rst index da57b5440..a6d9dffd2 100644 --- a/modules/lib_vnr/doc/src/overview.rst +++ b/modules/lib_vnr/doc/src/overview.rst @@ -1,7 +1,7 @@ .. _vnr_overview: VNR Overview -============ +************ The VNR (Voice to Noise Ratio) estimator predicts the signal to noise ratio of a speech signal in noise, using a pre-trained neural network. The VNR neural network model outputs a value between 0 and 1, with 1 indicating the strongest speech, and 0, the weakest speech compared to noise in a frame of audio data. diff --git a/modules/lib_vnr/doc/src/reference/header_files.rst b/modules/lib_vnr/doc/src/reference/header_files.rst index bbcc6be3d..48c4ba044 100644 --- a/modules/lib_vnr/doc/src/reference/header_files.rst +++ b/modules/lib_vnr/doc/src/reference/header_files.rst @@ -12,7 +12,7 @@ `vnr_inference_api.h` --------------------- +--------------------- .. doxygenpage:: page_vnr_inference_api_h From 7a652e9d3ad73a2add1c631b3781a4a49ab63779 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 14:11:12 +0000 Subject: [PATCH 57/65] Fix titles of output section --- examples/bare-metal/aec_1_thread/README.rst | 2 +- examples/bare-metal/aec_2_threads/README.rst | 2 +- examples/bare-metal/agc/README.rst | 2 +- examples/bare-metal/ic/README.rst | 2 +- examples/bare-metal/pipeline_alt_arch/README.rst | 2 +- examples/bare-metal/pipeline_multi_threaded/README.rst | 2 +- examples/bare-metal/vnr/README.rst | 3 +-- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/bare-metal/aec_1_thread/README.rst b/examples/bare-metal/aec_1_thread/README.rst index 5880a1068..661eccb66 100644 --- a/examples/bare-metal/aec_1_thread/README.rst +++ b/examples/bare-metal/aec_1_thread/README.rst @@ -55,7 +55,7 @@ From the fwk_voice/build folder run: python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_1_thread/bin/fwk_voice_example_bare_metal_aec_1_thread.xe --input ../shared_src/test_streams/aec_example_input.wav Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/aec_1_thread` directory. The input file input.wav is also present in the same directory. View output.wav and input.wav in Audacity to compare the echo cancelled diff --git a/examples/bare-metal/aec_2_threads/README.rst b/examples/bare-metal/aec_2_threads/README.rst index 4584b2460..e3de15b16 100644 --- a/examples/bare-metal/aec_2_threads/README.rst +++ b/examples/bare-metal/aec_2_threads/README.rst @@ -56,7 +56,7 @@ From the fwk_voice/build folder run: python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/aec_2_thread/bin/fwk_voice_example_bare_metal_aec_2_thread.xe --input ../shared_src/test_streams/aec_example_input.wav Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/aec_2_threads` directory. The input file input.wav is also present in the same directory. View output.wav and input.wav in Audacity to compare the echo cancelled diff --git a/examples/bare-metal/agc/README.rst b/examples/bare-metal/agc/README.rst index 890523f1b..32d1e7e8e 100644 --- a/examples/bare-metal/agc/README.rst +++ b/examples/bare-metal/agc/README.rst @@ -55,7 +55,7 @@ From the fwk_voice/build folder run: python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/agc/bin/fwk_voice_example_bare_metal_agc.xe --input ../shared_src/test_streams/agc_example_input.wav Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/agc` directory. The provided input `agc_example_input.wav` is low-volume white-noise and the effect of the AGC can be heard in the output diff --git a/examples/bare-metal/ic/README.rst b/examples/bare-metal/ic/README.rst index e329d888e..84f57cb05 100644 --- a/examples/bare-metal/ic/README.rst +++ b/examples/bare-metal/ic/README.rst @@ -58,7 +58,7 @@ From the fwk_voice/build folder run: python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/ic/bin/fwk_voice_example_bare_metal_ic.xe Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/ic` directory. When viewing output.wav in a visual audio tool, such as Audacity, you can see a stark difference between the channels emitted. Channel 0 is the IC output and is suitable for increasing the SNR in automatic speech recognition (ASR) applications. Channel 1 is the `simple beamformed` (average of mic 0 and mic 1 inputs) which may be preferable in comms (human to human) applications. The logic for channel 1 is contained in the ``ic_test_task.c`` file and is not part of the IC library.s diff --git a/examples/bare-metal/pipeline_alt_arch/README.rst b/examples/bare-metal/pipeline_alt_arch/README.rst index d30314932..7f6eed709 100644 --- a/examples/bare-metal/pipeline_alt_arch/README.rst +++ b/examples/bare-metal/pipeline_alt_arch/README.rst @@ -88,7 +88,7 @@ To run the multi-threaded application run these commands from the fwk_voice/buil To run the single-threaded application use fwk_voice_example_bare_metal_pipeline_alt_arch_st.xe as an executable for the python script. Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/pipeline_alt_arch` directory. The input file input.wav is also present in the same directory. View output.wav and input.wav in Audacity to compare the diff --git a/examples/bare-metal/pipeline_multi_threaded/README.rst b/examples/bare-metal/pipeline_multi_threaded/README.rst index b7fc967ae..955de96a5 100644 --- a/examples/bare-metal/pipeline_multi_threaded/README.rst +++ b/examples/bare-metal/pipeline_multi_threaded/README.rst @@ -86,7 +86,7 @@ From the fwk_voice/build folder run: python ../shared_src/python/run_xcoreai.py ../../../build/examples/bare-metal/pipeline_multi_threaded/bin/fwk_voice_example_bare_metal_pipeline_multi_thread.xe --input ../shared_src/test_streams/pipeline_example_input.wav Output ------- +****** The output file output.wav is generated in the `fwk_voice/examples/bare-metal/pipeline_multi_threaded` directory. The input file input.wav is also present in the same directory. View output.wav and input.wav in Audacity to compare the diff --git a/examples/bare-metal/vnr/README.rst b/examples/bare-metal/vnr/README.rst index 810e25e7d..fe1f35ca7 100644 --- a/examples/bare-metal/vnr/README.rst +++ b/examples/bare-metal/vnr/README.rst @@ -24,9 +24,8 @@ Alternatively, to not have the VNR output plot displayed on the screen, run, python host_app.py test_stream_1.wav vnr_out.bin --run-with-xscope-fileio - Output ------- +****** The output from the VNR is written into the *vnr_out.bin* file. For every frame, VNR outputs its estimate in the form of a floating point value between 0 and 1. The floating point value is written as a 32bit mantissa, followed by a 32bit exponent in the vnr_out.bin file. Additionally, these estimates are plotted, with the plot displayed on screen when run with the ``--show-plot`` argument. Irrespective of whether on not ``--show-plot`` is used as an option, the plotted figure is saved in the *vnr_example_plot_test_stream_1.png* file. From 1623af103f60871b22452e594b20bf22ab3561c3 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Feb 2023 17:06:02 +0000 Subject: [PATCH 58/65] Use lists for Win/Linux blocks --- doc/getting_started/index.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index 715583063..b9a0df937 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -14,7 +14,7 @@ Building -------- The following instructions show how to build the Voice Framework and run one of the example applications. This -procedure is currently supported on MacOS and Linux only. +procedure is currently supported on MacOS, Linux and Windows. #. Enter the clone of the Voice Framework and initialise submodules @@ -32,31 +32,32 @@ procedure is currently supported on MacOS and Linux only. #. Run cmake to setup the build environment for the XMOS toolchain - .. tab:: Linux and Mac + - On Linux and Mac .. code-block:: console - cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake - .. tab:: Windows + - On Windows .. code-block:: console - # make sure you have the patch command available - cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + + # make sure you have the patch command available + cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors related to not being able to apply a patch to an already patched library are seen. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. #. Running make will then build the Voice Framework libraries and example applications - .. tab:: Linux and Mac + - On Linux and Mac .. code-block:: console make fwk_voice_example_bare_metal_aec_1_thread - .. tab:: Windows + - On Windows .. code-block:: console @@ -64,13 +65,13 @@ procedure is currently supported on MacOS and Linux only. #. Install dependencies - .. tab:: Linux and Mac + - On Linux and Mac .. code-block:: console pip install -e build/fwk_voice_deps/xscope_fileio/ - .. tab:: Windows + - On Windows .. code-block:: console From e166bc4a3f8f36f13c57d3a9f2ab31a5d596ee79 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Mon, 20 Feb 2023 09:14:42 +0000 Subject: [PATCH 59/65] Fix indentations --- doc/getting_started/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/getting_started/index.rst b/doc/getting_started/index.rst index b9a0df937..be801ccb9 100644 --- a/doc/getting_started/index.rst +++ b/doc/getting_started/index.rst @@ -36,15 +36,15 @@ procedure is currently supported on MacOS, Linux and Windows. .. code-block:: console - cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + cmake -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake - On Windows .. code-block:: console - # make sure you have the patch command available - cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake + # make sure you have the patch command available + cmake -G "NMake Makefiles" -S.. -DCMAKE_TOOLCHAIN_FILE=../xmos_cmake_toolchain/xs3a.cmake As part of the cmake, some dependencies are fetched using CMake FetchContent. One of these dependencies, lib_tflite_micro has a patch applied to it as part of the FetchContent. This means, when trying to rerun the cmake in the same build directory, sometimes errors related to not being able to apply a patch to an already patched library are seen. To get rid of these errors, add the -DFETCHCONTENT_UPDATES_DISCONNECTED=ON option to the cmake command line, which will disable the FetchContent if the content has been downloaded previously. From c6c4051d73bb7e8762cef7cf066159bbbc3ac0cd Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Mon, 20 Feb 2023 11:29:31 +0000 Subject: [PATCH 60/65] Review comments from Michael --- examples/bare-metal/aec_1_thread/README.rst | 2 +- examples/bare-metal/aec_2_threads/README.rst | 2 +- examples/bare-metal/agc/README.rst | 2 +- examples/bare-metal/ic/README.rst | 2 +- examples/bare-metal/pipeline_alt_arch/README.rst | 2 +- .../bare-metal/pipeline_multi_threaded/README.rst | 2 +- .../bare-metal/pipeline_single_threaded/README.rst | 2 +- modules/lib_ic/doc/src/getting_started.rst | 13 ++++--------- modules/lib_vnr/doc/src/getting_started.rst | 4 ++-- 9 files changed, 13 insertions(+), 18 deletions(-) diff --git a/examples/bare-metal/aec_1_thread/README.rst b/examples/bare-metal/aec_1_thread/README.rst index 661eccb66..8b9e8c7fe 100644 --- a/examples/bare-metal/aec_1_thread/README.rst +++ b/examples/bare-metal/aec_1_thread/README.rst @@ -1,6 +1,6 @@ aec_1_thread -========================= +============ This example demonstrates how AEC functions are called on a single thread to process data through the AEC stage of a pipeline. diff --git a/examples/bare-metal/aec_2_threads/README.rst b/examples/bare-metal/aec_2_threads/README.rst index e3de15b16..c4c2cb595 100644 --- a/examples/bare-metal/aec_2_threads/README.rst +++ b/examples/bare-metal/aec_2_threads/README.rst @@ -1,6 +1,6 @@ aec_2_threads -========================== +============= This example demonstrates how AEC functions are called on 2 threads to process data through the AEC stage of a pipeline. diff --git a/examples/bare-metal/agc/README.rst b/examples/bare-metal/agc/README.rst index 32d1e7e8e..11e48b1f8 100644 --- a/examples/bare-metal/agc/README.rst +++ b/examples/bare-metal/agc/README.rst @@ -1,6 +1,6 @@ agc -================ +=== This example demonstrates how AGC functions are called on a single thread to process data through the AGC stage of a pipeline. A single AGC instance is run using the profile that is tuned for communication with a human listener. diff --git a/examples/bare-metal/ic/README.rst b/examples/bare-metal/ic/README.rst index 84f57cb05..27e774abf 100644 --- a/examples/bare-metal/ic/README.rst +++ b/examples/bare-metal/ic/README.rst @@ -1,6 +1,6 @@ ic -=============== +== This example demonstrates how the IC functions are called to process data through the IC stage of a voice pipeline. diff --git a/examples/bare-metal/pipeline_alt_arch/README.rst b/examples/bare-metal/pipeline_alt_arch/README.rst index 7f6eed709..db640f672 100644 --- a/examples/bare-metal/pipeline_alt_arch/README.rst +++ b/examples/bare-metal/pipeline_alt_arch/README.rst @@ -1,6 +1,6 @@ pipeline_alt_arch -================== +================= This example demonstrates how the audio processing stages are put together in an alternate implementation of the pipeline, which is different from sequentially calling the stages one after the other. In this pipeline form, the AEC and the IC frame processing are selectively enabled and disabled based on the presence of reference input signal. Acoustic Echo Cancellation is performed only if activity is detected on the reference input channels and disabled otherwise. Interference Cancellation is performed only when AEC is disabled so in the absence of reference channel activity and disabled otherwise. diff --git a/examples/bare-metal/pipeline_multi_threaded/README.rst b/examples/bare-metal/pipeline_multi_threaded/README.rst index 955de96a5..a227b4488 100644 --- a/examples/bare-metal/pipeline_multi_threaded/README.rst +++ b/examples/bare-metal/pipeline_multi_threaded/README.rst @@ -1,6 +1,6 @@ pipeline_multi_threaded -===================================== +======================= This example demonstrates how the audio processing stages are put together in a pipeline where stages are run in parallel on separate hardware threads. diff --git a/examples/bare-metal/pipeline_single_threaded/README.rst b/examples/bare-metal/pipeline_single_threaded/README.rst index 07c16177e..bb765c0e5 100644 --- a/examples/bare-metal/pipeline_single_threaded/README.rst +++ b/examples/bare-metal/pipeline_single_threaded/README.rst @@ -1,6 +1,6 @@ pipeline_single_threaded -===================================== +======================== This example demonstrates how the audio processing stages are put together in a pipeline diff --git a/modules/lib_ic/doc/src/getting_started.rst b/modules/lib_ic/doc/src/getting_started.rst index d7cce11e2..197378d93 100644 --- a/modules/lib_ic/doc/src/getting_started.rst +++ b/modules/lib_ic/doc/src/getting_started.rst @@ -1,10 +1,5 @@ -Getting Started -=============== - -Overview --------- Repository Structure --------------------- +******************** * ``modules/lib_ic`` - The actual ``lib_ic`` library directory within ``https://github.com/xmos/fwk_voice/``. Within ``lib_ic``: @@ -15,14 +10,14 @@ Repository Structure Requirements ------------- +************ ``lib_ic`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. ``lib_ic`` is compiled as a static library as part of overall ``fwk_voice`` build. It depends on ``lib_aec`` and ``lib_xcore_math``. API Structure -------------- +************* The API is presented as three simple functions. These are initialisation, filtering and adaption. Initialisation is called once at startup and filtering and adaption is called once per frame of samples. The performance requirement is relative low (around 12MIPS) @@ -30,7 +25,7 @@ and as such is supplied as a single threaded implementation only. Getting and Building --------------------- +******************** This repo is obtained as part of the parent ``fwk_voice`` repo clone. It is compiled as a static library as part of ``fwk_voice`` compilation process. diff --git a/modules/lib_vnr/doc/src/getting_started.rst b/modules/lib_vnr/doc/src/getting_started.rst index 9bd26756c..fa331d4d1 100644 --- a/modules/lib_vnr/doc/src/getting_started.rst +++ b/modules/lib_vnr/doc/src/getting_started.rst @@ -16,8 +16,8 @@ Requirements ``lib_vnr`` is included as part of the ``fwk_voice`` github repository and all requirements for cloning and building ``fwk_voice`` apply. It depends on ``lib_xcore_math``, ``lib_tflite_micro`` and ``lib_nn``. -API -*** +API Structure +************* The API is split into 2 parts; feature extraction and inference. The feature extraction API processes an input audio frame to extract features that are input to the inference stage. The inference API has functions for running inference using the VNR TensorFlow Lite model to predict the speech to noise ratio. Both feature extraction and inference APIs have initialisation functions that are called only once at device initialisation and processing functions that are called every frame. The performance requirement is relative low, around 5 MIPS for initialisation and 3 MIPS for processing, and as such is supplied as a single threaded implementation only. From bcda0d03a29f2f52055c6fb05b9ee26d2ad757d8 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Mar 2023 11:21:33 +0000 Subject: [PATCH 61/65] Add missing info --- CHANGELOG.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4d7470523..b38f9ccd0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,8 +5,10 @@ XMOS Voice Framework Change Log ----- * ADDED: Windows documentation + * CHANGED: Improved documentation style * REMOVED: VAD module - * CHANGED: Git hash at which lib_tflite_micro is fetched during CMake FetchContent + * CHANGED: Replace lib_xs3_math with the lib_xcore_math v2.1.1 + * CHANGED: Integrate latest version of tflite-micro library in VNR module 0.5.0 ----- From 997f9a2bcbddc89c3fe694abd262c0dd535645d1 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Mar 2023 11:24:08 +0000 Subject: [PATCH 62/65] Rename lib --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index b38f9ccd0..0484c36c5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,7 +8,7 @@ XMOS Voice Framework Change Log * CHANGED: Improved documentation style * REMOVED: VAD module * CHANGED: Replace lib_xs3_math with the lib_xcore_math v2.1.1 - * CHANGED: Integrate latest version of tflite-micro library in VNR module + * CHANGED: Integrate latest version of lib_tflite_micro in VNR module 0.5.0 ----- From 557c1c33cb399cf3e85934a1bbfea42130d72135 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Mar 2023 11:26:47 +0000 Subject: [PATCH 63/65] Fix text --- CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0484c36c5..8063b3636 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -8,7 +8,7 @@ XMOS Voice Framework Change Log * CHANGED: Improved documentation style * REMOVED: VAD module * CHANGED: Replace lib_xs3_math with the lib_xcore_math v2.1.1 - * CHANGED: Integrate latest version of lib_tflite_micro in VNR module + * CHANGED: Integrate new version of lib_tflite_micro in VNR module 0.5.0 ----- From 922d9bc477444e76201a9d9405c065458f4b7df5 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Mar 2023 11:54:28 +0000 Subject: [PATCH 64/65] Add info in correct version --- CHANGELOG.rst | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8063b3636..706d1cdd6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,15 +1,20 @@ XMOS Voice Framework Change Log =============================== -0.5.1 +0.6.0 ----- - - * ADDED: Windows documentation + * CHANGED: Improved documentation style - * REMOVED: VAD module * CHANGED: Replace lib_xs3_math with the lib_xcore_math v2.1.1 * CHANGED: Integrate new version of lib_tflite_micro in VNR module +0.5.1 +----- + + * ADDED: Windows documentation + * REMOVED: VAD module + * CHANGED: Git hash at which lib_tflite_micro is fetched during CMake FetchContent + 0.5.0 ----- From fd6e3b0a48ccf1029db00b4fae2f0187086e7a07 Mon Sep 17 00:00:00 2001 From: lucianomartin Date: Fri, 17 Mar 2023 11:56:32 +0000 Subject: [PATCH 65/65] Update doc version --- settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings.json b/settings.json index d704ec5fe..b94dcfc49 100644 --- a/settings.json +++ b/settings.json @@ -1,5 +1,5 @@ { "title": "XCORE Voice Framework", "project": "fwk_voice", - "version": "0.5.1" + "version": "0.6.0" }