Skip to content

Commit

Permalink
Merge pull request #68 from xmos/release/v2.2.0
Browse files Browse the repository at this point in the history
Release/v2.2.0
  • Loading branch information
xluciano authored Mar 30, 2023
2 parents 997e84e + d0a1c74 commit 3335680
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 20 deletions.
7 changes: 0 additions & 7 deletions Brewfile

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -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
-----

Expand Down
6 changes: 3 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
8 changes: 5 additions & 3 deletions examples/AN00231_ASRC_SPDIF_TO_DAC/src/xk-audio-216-mc.xn
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@
</Link>
</Links>
<ExternalDevices>
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K">
<Device NodeId="0" Tile="0" Class="SQIFlash" Name="bootFlash" Type="S25FL116K" PageSize="256" SectorSize="4096" NumPages="16384">
<Attribute Name="PORT_SQI_CS" Value="PORT_SQI_CS"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
<Attribute Name="PORT_SQI_SCLK" Value="PORT_SQI_SCLK"/>
<Attribute Name="PORT_SQI_SIO" Value="PORT_SQI_SIO"/>
<Attribute Name="QE_REGISTER" Value="flash_qe_location_status_reg_0"/>
<Attribute Name="QE_BIT" Value="flash_qe_bit_6"/>
</Device>
</ExternalDevices>
<JTAGChain>
Expand Down
2 changes: 1 addition & 1 deletion lib_src/module_build_info
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = 2.1.0
VERSION = 2.2.0

DEPENDENT_MODULES = lib_logging(>=3.0.0) \
lib_xassert(>=4.0.0)
Expand Down
9 changes: 8 additions & 1 deletion lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
8 changes: 7 additions & 1 deletion lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir.xc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
21 changes: 17 additions & 4 deletions lib_src/src/fixed_factor_of_3_voice/src_ff3v_fir_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
//
Expand All @@ -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_
"""
Expand All @@ -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
//
Expand Down Expand Up @@ -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 = ''
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 3335680

Please sign in to comment.