diff --git a/Brewfile b/Brewfile deleted file mode 100644 index 2fd6d0b8..00000000 --- a/Brewfile +++ /dev/null @@ -1,7 +0,0 @@ -tap 'homebrew/core' - -brew 'perl' -brew 'cpanm' - -brew 'python@2' -brew 'pipenv' diff --git a/CHANGELOG.rst b/CHANGELOG.rst index bcd516a1..124d0e96 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,23 @@ lib_src change log ================== +2.2.0 +----- + + * CHANGED: Made the FIR coefficient array that is used with the voice fixed + factor of 3 up and down sampling functions usable from within C files as + well as XC files. + * CHANGED: Aligned the FIR coefficient array to an 8-byte boundary. This + ensures that the voice fixed factor of 3 up and down sampling functions do + not crash with a LOAD_STORE exception. + * ADDED: Missing device attributes to the .xn file of the AN00231 app note. + + * Changes to dependencies: + + - lib_logging: 2.0.1 -> 3.1.1 + + - lib_xassert: 2.0.1 -> 4.1.0 + 2.1.0 ----- diff --git a/Jenkinsfile b/Jenkinsfile index 269489d0..7202b752 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,14 +1,14 @@ -@Library('xmos_jenkins_shared_library@v0.16.2') _ +@Library('xmos_jenkins_shared_library@v0.18.0') _ getApproval() pipeline { agent { - label 'x86_64&&brew&&macOS' + label 'x86_64&&macOS' } environment { REPO = 'lib_src' - VIEW = "${env.JOB_NAME.contains('PR-') ? REPO+'_'+env.CHANGE_TARGET : REPO+'_'+env.BRANCH_NAME}" + VIEW = getViewName(REPO) } options { skipDefaultCheckout() diff --git a/examples/AN00231_ASRC_SPDIF_TO_DAC/src/xk-audio-216-mc.xn b/examples/AN00231_ASRC_SPDIF_TO_DAC/src/xk-audio-216-mc.xn index 5e10ef9e..665724bc 100644 --- a/examples/AN00231_ASRC_SPDIF_TO_DAC/src/xk-audio-216-mc.xn +++ b/examples/AN00231_ASRC_SPDIF_TO_DAC/src/xk-audio-216-mc.xn @@ -83,10 +83,12 @@ - + - - + + + + diff --git a/lib_src/module_build_info b/lib_src/module_build_info index f83b54d9..073ffa14 100644 --- a/lib_src/module_build_info +++ b/lib_src/module_build_info @@ -1,4 +1,4 @@ -VERSION = 2.1.0 +VERSION = 2.2.0 DEPENDENT_MODULES = lib_logging(>=3.0.0) \ lib_xassert(>=4.0.0) diff --git a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.h b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.h index 9293b738..3ad213e4 100644 --- a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.h +++ b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.h @@ -21,6 +21,13 @@ extern const unsigned src_ff3v_fir_comp_q_us; extern const int32_t src_ff3v_fir_comp_us; extern int32_t src_ff3v_fir_coefs_debug[SRC_FF3V_FIR_NUM_PHASES * SRC_FF3V_FIR_TAPS_PER_PHASE]; -extern const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE]; + +#if defined(__XC__) +extern const int32_t (*src_ff3v_fir_coefs_xc)[SRC_FF3V_FIR_TAPS_PER_PHASE]; +#define src_ff3v_fir_coefs src_ff3v_fir_coefs_xc +#else +extern const int32_t (*src_ff3v_fir_coefs_c)[SRC_FF3V_FIR_TAPS_PER_PHASE]; +#define src_ff3v_fir_coefs src_ff3v_fir_coefs_c +#endif #endif // _SRC_FF3V_FIR_H_ diff --git a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.xc b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.xc index 08d2e85d..99a1f640 100644 --- a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.xc +++ b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.xc @@ -39,7 +39,7 @@ int32_t src_ff3v_fir_coefs_debug[SRC_FF3V_FIR_NUM_PHASES * SRC_FF3V_FIR_TAPS_PER }; /** Coefficients for use with src_ds3_voice and src_us3_voice functions */ -const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE] = { +static const int32_t [[aligned(8)]] src_ff3v_fir_coefs_i[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE] = { { 29412, -14619962, 2692812, -2814524, 2193307, -1338213, -123797, 2582573, -6837031, 15085431, -37235961, 320542055, @@ -59,3 +59,9 @@ const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_ -1338213, 2193307, -2814524, 2692812, -14619962, 29412, }, }; + +unsafe { + const int32_t (* unsafe src_ff3v_fir_coefs_c)[SRC_FF3V_FIR_TAPS_PER_PHASE] = src_ff3v_fir_coefs_i; +} + +const int32_t (*src_ff3v_fir_coefs_xc)[SRC_FF3V_FIR_TAPS_PER_PHASE] = src_ff3v_fir_coefs_i; diff --git a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir_generator.py b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir_generator.py index e8f5bb56..885bd413 100755 --- a/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir_generator.py +++ b/lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir_generator.py @@ -31,7 +31,7 @@ def plot_response_passband(fs, w, h, title): def generate_header_file(num_taps_per_phase, num_phases): header_template = """\ -// Copyright (c) 2016-2017, XMOS Ltd, All rights reserved +// Copyright (c) 2016-2021, XMOS Ltd, All rights reserved // // This file is generated using src_ff3v_fir_generator.py // @@ -53,7 +53,14 @@ def generate_header_file(num_taps_per_phase, num_phases): extern const int32_t src_ff3v_fir_comp_us; extern int32_t src_ff3v_fir_coefs_debug[SRC_FF3V_FIR_NUM_PHASES * SRC_FF3V_FIR_TAPS_PER_PHASE]; -extern const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE]; + +#if defined(__XC__) +extern const int32_t (*src_ff3v_fir_coefs_xc)[SRC_FF3V_FIR_TAPS_PER_PHASE]; +#define src_ff3v_fir_coefs src_ff3v_fir_coefs_xc +#else +extern const int32_t (*src_ff3v_fir_coefs_c)[SRC_FF3V_FIR_TAPS_PER_PHASE]; +#define src_ff3v_fir_coefs src_ff3v_fir_coefs_c +#endif #endif // _SRC_FF3V_FIR_H_ """ @@ -66,7 +73,7 @@ def generate_header_file(num_taps_per_phase, num_phases): def generate_xc_file(q_ds, q_us, comp_ds, comp_us, taps): xc_template = """\ -// Copyright (c) 2016-2017, XMOS Ltd, All rights reserved +// Copyright (c) 2016-2021, XMOS Ltd, All rights reserved // // This file is generated using src_ff3v_fir_generator.py // @@ -94,8 +101,14 @@ def generate_xc_file(q_ds, q_us, comp_ds, comp_us, taps): }; /** Coefficients for use with src_ds3_voice and src_us3_voice functions */ -const int32_t src_ff3v_fir_coefs[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE] = { +static const int32_t [[aligned(8)]] src_ff3v_fir_coefs_i[SRC_FF3V_FIR_NUM_PHASES][SRC_FF3V_FIR_TAPS_PER_PHASE] = { %(coefs)s}; + +unsafe { + const int32_t (* unsafe src_ff3v_fir_coefs_c)[SRC_FF3V_FIR_TAPS_PER_PHASE] = src_ff3v_fir_coefs_i; +} + +const int32_t (*src_ff3v_fir_coefs_xc)[SRC_FF3V_FIR_TAPS_PER_PHASE] = src_ff3v_fir_coefs_i; """ coefs_debug = '' diff --git a/requirements.txt b/requirements.txt index bc2eca30..f8ca1c5a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,6 +18,8 @@ # same modules should appear in the setup.py list as given below. flake8==3.8.3 +# Pin importlib-metadata to <5 due to https://github.com/python/importlib_metadata/issues/409. +importlib-metadata==4.13.0 matplotlib==3.3.1 # Pin numpy to 1.18.5 due to tensorflow v2.1.1 hard pinning it to that version.