Skip to content

Commit

Permalink
CI migration (#189)
Browse files Browse the repository at this point in the history
* Update MATLAB path

Signed-off-by: Travis F. Collins <[email protected]>

* Change stashing mechanism

Signed-off-by: Travis F. Collins <[email protected]>

* Use docker flags for unstashing

Signed-off-by: Travis F. Collins <[email protected]>

* Update hopper build script to use renamed 2022.2 release branch

Signed-off-by: Travis F. Collins <[email protected]>

* Add workaround for new mpm installed MATLAB

Signed-off-by: Travis F. Collins <[email protected]>

* Add dependency for AGC tests

Signed-off-by: Travis F. Collins <[email protected]>

* Fix exit code propogation

Signed-off-by: Travis F. Collins <[email protected]>

* Update AGC model to R2023b

Signed-off-by: Travis F. Collins <[email protected]>

* Set EDITOR for demos tests in headless mode

Signed-off-by: Travis F. Collins <[email protected]>

* Make verbose l4 demo tests

Signed-off-by: Travis F. Collins <[email protected]>

* Fix issues with workspace variables in AGC demo

Signed-off-by: Travis F. Collins <[email protected]>

---------

Signed-off-by: Travis F. Collins <[email protected]>
  • Loading branch information
tfcollins authored Nov 26, 2024
1 parent 9b61c2f commit 1154ab1
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CI/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ MLFLAGS := $(MLFLAGS) -wait
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
MLPATH := /usr/local/MATLAB
MLPATH := /opt/MATLAB
endif
ifeq ($(UNAME_S),Darwin)
MLPATH := /Applications
Expand Down
4 changes: 3 additions & 1 deletion CI/scripts/synth_designs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ then
MLRELEASE=R2023b
fi

MLPATH=/usr/local/MATLAB
MLPATH=/opt/MATLAB

cd ../..
cp hdl/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
Expand All @@ -19,7 +19,9 @@ export DISPLAY=:77
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2022.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "cd('test');runSynthTests('$BOARD');"
EC=$?
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
exit $EC
4 changes: 3 additions & 1 deletion CI/scripts/targeting_designs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ then
fi
echo "Testing demo: $DEMO"

MLPATH=/usr/local/MATLAB
MLPATH=/opt/MATLAB

cd ../..
source /opt/Xilinx/Vivado/2022.2/settings64.sh
Expand All @@ -21,7 +21,9 @@ export DISPLAY=:77
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2022.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "addpath(genpath('test'));addpath(genpath('deps'));runDemoTests('$DEMO');"
EC=$?
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
exit $EC
20 changes: 10 additions & 10 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@Library('tfc-lib') _
@Library('tfc-lib@adef-ci') _

flags = gitParseFlags()

dockerConfig = getDockerConfig(['MATLAB','Vivado'], matlabHSPro=false)
dockerConfig = getDockerConfig(['MATLAB','Vivado','Internal'], matlabHSPro=false)
dockerConfig.add("-e MLRELEASE=R2023b")
dockerHost = 'docker'

Expand Down Expand Up @@ -32,7 +32,7 @@ stage("Build Toolbox") {
}
}
if (branchName == 'hdl_2022_r2') {
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
local_stash('builtSources')
archiveArtifacts artifacts: 'hdl/*', followSymlinks: false, allowEmptyArchive: true
}
}
Expand All @@ -55,7 +55,7 @@ cstage("HDL Tests", "", flags) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("Source", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -69,7 +69,7 @@ cstage("HDL Tests", "", flags) {
}
*/
cstage("Installer", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'rm -rf hdl'
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
Expand All @@ -96,7 +96,7 @@ for (int i=0; i < demoNames.size(); i++) {
stage(demo) {
echo "Node: ${env.NODE_NAME}"
echo "Demo: ${env.DEMO}"
unstash "builtSources"
local_unstash('builtSources', '', false)
sh 'make -C ./CI/scripts test_targeting_demos'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/*', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -117,7 +117,7 @@ parallel deployments
node('baremetal') {
stage("NonHW Tests") {
stage("NonHW") {
unstash "builtSources"
local_unstash('builtSources', '', false)
sh 'make -C ./CI/scripts run_NonHWTests'
}
}
Expand All @@ -132,7 +132,7 @@ cstage("Build Deployable Apps", "", flags) {
branchName ->
withEnv(['APP='+branchName]) {
cstage("Build DApps", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'make -C ./CI/scripts ${APP}'
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPAinstaller/*.exe', followSymlinks: false, allowEmptyArchive: true
archiveArtifacts artifacts: 'trx_examples/streaming/LTE_PA_App/LTEPAinstaller/*.install', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -149,7 +149,7 @@ cstage("Hardware Streaming Tests", "", flags) {
dockerParallelBuild(classNames, dockerHost, dockerConfig) {
branchName ->
withEnv(['HW='+branchName]) {
unstash "builtSources"
local_unstash("builtSources")
sh 'echo ${HW}'
// sh 'make -C ./CI/scripts test_streaming'
}
Expand All @@ -160,7 +160,7 @@ cstage("Hardware Streaming Tests", "", flags) {

node('baremetal || lab_b5') {
cstage('Deploy Development', "", flags) {
unstash "builtSources"
local_unstash("builtSources", '', false)
uploadArtifactory('TransceiverToolbox','*.mltbx')
}
}
Expand Down
18 changes: 18 additions & 0 deletions test/DemoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
end

methods(TestClassSetup)
function refreshCache(~)
% Weird bug sometimes when MATLAB installed by mpm
Advisor.Manager.refresh_customizations;
rehash toolboxcache

end
function addpaths(testCase)
here = mfilename('fullpath');
here = strsplit(here,'/');
Expand Down Expand Up @@ -46,6 +52,18 @@ function buildHDLFrequencyHopper(testCase)
function buildHDLTuneAGC(testCase)
testCase.setupVivado('2022.2');
cd(fullfile(testCase.root,'trx_examples/targeting/tuneAGC-ad9361'));
% Get dependent scripts from example
if ~usejava('desktop')
setenv('EDITOR', 'cat');
end
here = pwd;
matlab.internal.language.introspective.openExample('comm/WINNERVHTMUMIMOExample', 'helperNoiseEstimate');
here = mfilename('fullpath');
here = strsplit(here,filesep);
root = fullfile(filesep,here{1:end-2});
here = fullfile(root, 'trx_examples' , 'targeting', 'tuneAGC-ad9361');
copyfile("helperNoiseEstimate.m",here);
cd(here);
hdlworkflow;
if ~isempty(out)
disp(out.message);
Expand Down
2 changes: 1 addition & 1 deletion test/runDemoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


try
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',1);
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',4);
runner.addPlugin(DiagnosticsValidationPlugin)

xmlFile = 'BSPDemoTests.xml';
Expand Down
4 changes: 2 additions & 2 deletions trx_examples/targeting/frequency-hopping/build_kernel.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

# Build kernel
git clone -b 2022_r2 --depth=1 https://github.com/analogdevicesinc/linux.git
git clone -b 2022_r2_release --depth=1 https://github.com/analogdevicesinc/linux.git
cd linux
export ARCH=arm
export CROSS_COMPILE=arm-linux-gnueabihf-
source /opt/Xilinx/Vivado/2021.2/settings64.sh
source /opt/Xilinx/Vivado/2022.2/settings64.sh
cp ../hopper.patch .
git apply --reject hopper.patch
if [ "$?" != "0" ]; then
Expand Down
Binary file not shown.

0 comments on commit 1154ab1

Please sign in to comment.