Skip to content

Commit e3bb065

Browse files
authored
Merge pull request #97 from xmos/release/v2.4.0
Merging version v2.4.0 back to main for release
2 parents d00f51f + cc4a69b commit e3bb065

55 files changed

Lines changed: 3525 additions & 2734 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/docs.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ tests/vpu_ff3_test/autogen
2929
tests/vpu_rat_test/autogen
3030
*.csv
3131
python/lib_src.egg-info
32+
**/tmp_models/
33+
*.bak
34+
make_docs.sh

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
lib_src change log
22
==================
33

4+
2.4.0
5+
-----
6+
7+
* ADDED: Support for building the core ASRC code in the C emulator as a
8+
library
9+
* ADDED: Auto-generated ASRC and SSRC performance plots in documentation
10+
* CHANGED: Documents built under Jenkins instead of Github Actions
11+
* ADDED: Documentation warning about overflow in XS3 optimized SRC components
12+
* CHANGED: Tested against fwk_core v1.0.2 updated from v1.0.0
13+
414
2.3.0
515
-----
616

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(PROJECT_IS_TOP_LEVEL)
77
FetchContent_Declare(
88
fwk_core
99
GIT_REPOSITORY https://github.com/xmos/fwk_core.git
10-
GIT_TAG v1.0.0
10+
GIT_TAG v1.0.2
1111
)
1212
FetchContent_MakeAvailable(fwk_core)
1313
endif()

Jenkinsfile

Lines changed: 113 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ def localRunPytest(String extra_args="") {
1717
getApproval()
1818

1919
pipeline {
20-
agent {
21-
label 'x86_64&&macOS' // These agents have 24 cores so good for parallel xsim runs
22-
}
20+
agent none
2321
environment {
2422
REPO = 'lib_src'
2523
VIEW = getViewName(REPO)
2624
PYTHON_VERSION = "3.10.5"
2725
VENV_DIRNAME = ".venv"
26+
XMOSDOC_VERSION = "v4.0"
2827
}
2928
options {
3029
skipDefaultCheckout()
30+
timestamps()
3131
}
3232
parameters {
3333
string(
@@ -37,119 +37,142 @@ pipeline {
3737
)
3838
}
3939
stages {
40-
stage('Get repo') {
41-
steps {
42-
sh "mkdir ${REPO}"
43-
// source checks require the directory
44-
// name to be the same as the repo name
45-
dir("${REPO}") {
46-
// checkout repo
47-
checkout scm
48-
sh 'git submodule update --init --recursive --depth 1'
49-
}
40+
stage('Build and Test') {
41+
when {
42+
expression { !env.GH_LABEL_DOC_ONLY.toBoolean() }
5043
}
51-
}
52-
stage ("Create Python environment")
53-
{
54-
steps {
55-
dir("${REPO}") {
56-
createVenv('requirements.txt')
57-
withVenv {
58-
sh 'pip install -r requirements.txt'
44+
agent {
45+
label 'x86_64&&docker' // These agents have 24 cores so good for parallel xsim runs
46+
}
47+
stages {
48+
stage('Get repo') {
49+
steps {
50+
sh "mkdir ${REPO}"
51+
// source checks require the directory
52+
// name to be the same as the repo name
53+
dir("${REPO}") {
54+
// checkout repo
55+
checkout scm
56+
sh 'git submodule update --init --recursive --depth 1'
57+
}
5958
}
6059
}
61-
}
62-
}
63-
stage('Library checks') {
64-
steps {
65-
dir("${REPO}") {
66-
sh 'git clone git@github.com:xmos/infr_apps.git'
67-
sh 'git clone git@github.com:xmos/infr_scripts_py.git'
68-
// These are needed for xmake legacy build and also changelog check
69-
sh 'git clone git@github.com:xmos/lib_logging.git'
70-
sh 'git clone git@github.com:xmos/lib_xassert.git'
71-
withVenv {
72-
sh 'pip install -e infr_scripts_py'
73-
sh 'pip install -e infr_apps'
74-
dir("tests") {
75-
withEnv(["XMOS_ROOT=.."]) {
76-
localRunPytest('-s test_lib_checks.py -vv')
60+
stage ("Create Python environment") {
61+
steps {
62+
dir("${REPO}") {
63+
createVenv('requirements.txt')
64+
withVenv {
65+
sh 'pip install -r requirements.txt'
7766
}
7867
}
7968
}
8069
}
81-
}
82-
}
83-
stage('Test xmake build') {
84-
steps {
85-
runningOn(env.NODE_NAME)
86-
dir("${REPO}") {
87-
withTools(params.TOOLS_VERSION) {
88-
withVenv {
89-
dir("tests") {
90-
localRunPytest('-k "legacy" -vv')
70+
stage('Library checks') {
71+
steps {
72+
dir("${REPO}") {
73+
sh 'git clone git@github.com:xmos/infr_apps.git'
74+
sh 'git clone git@github.com:xmos/infr_scripts_py.git'
75+
// These are needed for xmake legacy build and also changelog check
76+
sh 'git clone git@github.com:xmos/lib_logging.git'
77+
sh 'git clone git@github.com:xmos/lib_xassert.git'
78+
withVenv {
79+
sh 'pip install -e infr_scripts_py'
80+
sh 'pip install -e infr_apps'
81+
dir("tests") {
82+
withEnv(["XMOS_ROOT=.."]) {
83+
localRunPytest('-s test_lib_checks.py -vv')
84+
}
85+
}
9186
}
9287
}
9388
}
9489
}
95-
}
96-
}
97-
stage('Tests XS2') {
98-
steps {
99-
runningOn(env.NODE_NAME)
100-
dir("${REPO}") {
101-
withTools(params.TOOLS_VERSION) {
102-
withVenv {
103-
sh 'mkdir build'
104-
dir("build") {
105-
sh 'rm -rf'
106-
sh 'cmake --toolchain ../xmos_cmake_toolchain/xs2a.cmake ..'
107-
sh 'make test_ds3_voice test_us3_voice test_unity_gain_voice -j'
90+
stage('Test xmake build') {
91+
steps {
92+
runningOn(env.NODE_NAME)
93+
dir("${REPO}") {
94+
withTools(params.TOOLS_VERSION) {
95+
withVenv {
96+
dir("tests") {
97+
localRunPytest('-k "legacy" -vv')
98+
}
99+
}
108100
}
109-
dir("tests") {
110-
localRunPytest('-n auto -k "xs2" -vv')
101+
}
102+
}
103+
}
104+
stage('Run doc python') {
105+
steps {
106+
runningOn(env.NODE_NAME)
107+
dir("${REPO}") {
108+
withTools(params.TOOLS_VERSION) {
109+
withVenv {
110+
sh "sh doc/build_docs_ci.sh $XMOSDOC_VERSION"
111+
archiveArtifacts artifacts: "doc_build.zip", allowEmptyArchive: true
112+
}
111113
}
112-
dir("build") {
113-
sh 'rm -rf' // Cleanup XS2 cmake cache for next stage
114+
}
115+
}
116+
}
117+
stage('Tests XS2') {
118+
steps {
119+
runningOn(env.NODE_NAME)
120+
dir("${REPO}") {
121+
withTools(params.TOOLS_VERSION) {
122+
withVenv {
123+
sh 'mkdir -p build'
124+
dir("build") {
125+
sh 'rm CMakeCache.txt'
126+
sh 'cmake --toolchain ../xmos_cmake_toolchain/xs2a.cmake ..'
127+
sh 'make test_ds3_voice test_us3_voice test_unity_gain_voice -j'
128+
}
129+
dir("tests") {
130+
localRunPytest('-n auto -k "xs2" -vv')
131+
}
132+
dir("build") {
133+
sh 'rm CMakeCache.txt' // Cleanup XS2 cmake cache for next stage
134+
}
135+
}
114136
}
115137
}
116138
}
117139
}
118-
}
119-
}
120-
stage('Tests XS3') {
121-
steps {
122-
runningOn(env.NODE_NAME)
123-
dir("${REPO}") {
124-
withTools(params.TOOLS_VERSION) {
125-
withVenv {
126-
dir("tests") {
127-
localRunPytest('-m prepare') // Do all pre work like building and generating golden ref where needed
140+
stage('Tests XS3') {
141+
steps {
142+
runningOn(env.NODE_NAME)
143+
dir("${REPO}") {
144+
withTools(params.TOOLS_VERSION) {
145+
withVenv {
146+
dir("tests") {
147+
localRunPytest('-m prepare') // Do all pre work like building and generating golden ref where needed
128148

129-
// FF3 HiFi tests for OS3 and DS3
130-
localRunPytest('-m main -n auto -k "hifi_ff3" -vv')
149+
// FF3 HiFi tests for OS3 and DS3
150+
localRunPytest('-m main -n auto -k "hifi_ff3" -vv')
131151

132-
// ASRC and SSRC tests across all in/out freqs and deviations (asrc only)
133-
localRunPytest('-m main -n auto -k "mrhf" -vv')
134-
archiveArtifacts artifacts: "mips_report*.csv", allowEmptyArchive: true
152+
// ASRC and SSRC tests across all in/out freqs and deviations (asrc only)
153+
localRunPytest('-m main -n auto -k "mrhf" -vv')
154+
archiveArtifacts artifacts: "mips_report*.csv", allowEmptyArchive: true
135155

136-
// VPU enabled ff3 and rat tests
137-
localRunPytest('-m main -k "vpu" -vv') // xdist not working yet so no -n auto
156+
// VPU enabled ff3 and rat tests
157+
localRunPytest('-m main -k "vpu" -vv') // xdist not working yet so no -n auto
138158

139-
// Profile the ASRC
140-
localRunPytest('-m main -k "profile_asrc" -vv')
141-
sh 'tree'
142-
archiveArtifacts artifacts: "gprof_results/*.png", allowEmptyArchive: true
159+
// Profile the ASRC
160+
localRunPytest('-m main -k "profile_asrc" -vv')
161+
sh 'tree'
162+
archiveArtifacts artifacts: "gprof_results/*.png", allowEmptyArchive: true
163+
}
164+
}
143165
}
144166
}
145167
}
146168
}
147169
}
170+
post {
171+
cleanup {
172+
xcoreCleanSandbox()
173+
}
174+
}
148175
}
149-
}
150-
post {
151-
cleanup {
152-
xcoreCleanSandbox()
153-
}
176+
154177
}
155178
}

README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ There are three different component options that support fixed factor of 3 up/do
6060
#. If voice quality (65 dB SNR) is required running on xCORE-200, use ds3_voice or us3_voice.
6161
#. If voice quality (75 dB SNR) is required running xcore-ai, use ff3_96t_ds or ff3_96t_us.
6262

63+
.. warning::
64+
Synchronous fixed factor of 3 and 3/2 downsample and oversample functions for voice applications optimized for the XS3 Vector Processing Unit
65+
currently overflow rather than saturate in cases where a full scale input causes a perturbation above full scale at the output.
66+
To avoid this scenario, please ensure that the input amplitude is always 3.5 dB below full scale.
67+
The overflow behavior of these SRC components will be replaced by saturating behavior (to match all other SRC components) in a future release.
68+
6369

6470
Related Application Notes
6571
.........................

doc/build_docs_ci.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This script is designed to be run by the CI under a venv set by requirements.txt in the repo root.
2+
# Take a look at the Jenkinsfile for the general idea.
3+
# It should be run as /doc/build_docs_ci.sh from the repo root as the cwd.
4+
5+
if [ -z "$1" ]
6+
then
7+
echo "Please pass the xmosdoc version. Eg. $/doc/build_docs_ci.sh v4.0"
8+
exit -1
9+
fi
10+
11+
# Build the autogenerated section
12+
cd doc/python
13+
python doc_asrc.py
14+
cd ../..
15+
16+
# Create the docs from source
17+
docker pull ghcr.io/xmos/xmosdoc:$1
18+
docker run -u "$(id -u):$(id -g)" --rm -v `pwd`:/build ghcr.io/xmos/xmosdoc:$1 -v
19+
20+
# Leave a nice zip file for picking up as an artefact
21+
zip -r doc_build.zip doc/_build
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# The following patterns are to be excluded from the documentation build
22
tests/*
33
build/*
4+
**LICENSE*
45

56
# Do not build .md files
67

78
*.md
89
**/*.md
10+
lib_logging/**
11+
lib_xassert/**
912

1013
# We need to ensure these are not processed twice which breaks figure numbering. They are included via index.rst.
11-
**/multi_rate_hifi_src.rst
12-
**/fixed_ratio_src.rst
1314
**/resource_usage_asrc.rst
14-
**/resource_usage_ssrc.rst
15+
**/resource_usage_ssrc.rst

0 commit comments

Comments
 (0)