Skip to content

Commit efb840b

Browse files
CI migration update
1 parent f1b4224 commit efb840b

File tree

8 files changed

+43
-60
lines changed

8 files changed

+43
-60
lines changed

CI/scripts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ MLFLAGS := $(MLFLAGS) -wait
2121
else
2222
UNAME_S := $(shell uname -s)
2323
ifeq ($(UNAME_S),Linux)
24-
MLPATH := /usr/local/MATLAB
24+
MLPATH := /opt/MATLAB
2525
endif
2626
ifeq ($(UNAME_S),Darwin)
2727
MLPATH := /Applications

CI/scripts/genTlbx.m

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,36 +66,6 @@ function genTlbx(examples)
6666
end
6767
matlab.addons.toolbox.packageToolbox(projectFile,outputFile)
6868

69-
if ~usejava('desktop')
70-
%% Update toolbox paths
71-
mkdir other
72-
movefile([outputFile,'.mltbx'], ['other/',outputFile,'.zip']);
73-
cd other
74-
unzip([outputFile,'.zip'],'out');
75-
cd('out')
76-
cd('metadata');
77-
fid = fopen('configuration.xml','r');
78-
f=fread(fid,'*char')';
79-
fclose(fid);
80-
81-
s = '</matlabPaths>';
82-
sections = strsplit(f,s);
83-
s1 = sections{1};
84-
s2 = sections{2};
85-
newfile = [s1,paths,s,s2];
86-
87-
fid = fopen('configuration.xml','w');
88-
fprintf(fid,'%s',newfile);
89-
fclose(fid);
90-
91-
%% Repack
92-
cd('..');
93-
zip([outputFile,'.zip'], '*');
94-
movefile([outputFile,'.zip'],['../../',outputFile,'.mltbx']);
95-
cd('../..');
96-
rmdir('other','s');
97-
end
98-
9969
delete bsp.prj
10070

10171

CI/scripts/synth_designs.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
set -x
23

34
BOARD=$1
45
MLFLAGS="-nodisplay -nodesktop -nosplash"
@@ -8,18 +9,20 @@ then
89
MLRELEASE=R2023b
910
fi
1011

11-
MLPATH=/usr/local/MATLAB
12+
MLPATH=/opt/MATLAB
1213

1314
cd ../..
1415
cp hdl/vendor/AnalogDevices/hdlcoder_board_customization.m test/hdlcoder_board_customization_local.m
1516
sed -i "s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m
1617
source /opt/Xilinx/Vivado/2022.2/settings64.sh
17-
Xvfb :77 &
18-
export DISPLAY=:77
18+
# Randomize DISPLAY number to avoid conflicts
19+
export DISPLAY_ID=:$(shuf -i 10-1000 -n 1)
20+
Xvfb $DISPLAY_ID &
21+
XVFB_PID=$!
22+
export DISPLAY=$DISPLAY_ID
1923
export SWT_GTK3=0
2024
source /opt/Xilinx/Vivado/2022.2/settings64.sh
2125
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "cd('test');runSynthTests('$BOARD');"
22-
pidof Xvfb
23-
if [ $? -eq 0 ]; then
24-
kill -9 `pidof Xvfb`
25-
fi
26+
EC=$?
27+
kill -9 $XVFB_PID || true
28+
exit $EC

Jenkinsfile

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
@Library('tfc-lib') _
1+
@Library('tfc-lib@adef-ci') _
22

33
flags = gitParseFlags()
44

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

@@ -14,11 +14,9 @@ stage("Build Toolbox") {
1414
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
1515
branchName ->
1616
try {
17-
withEnv(['HDLBRANCH='+branchName]) {
17+
withEnv(['HDLBRANCH='+branchName,'LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
1818
checkout scm
19-
sh 'git submodule update --init'
20-
sh 'pip3 install -r ./CI/gen_doc/requirements_doc.txt'
21-
sh 'make -C ./CI/gen_doc doc_ml'
19+
sh 'git submodule update --init'
2220
sh 'make -C ./CI/scripts build'
2321
sh 'make -C ./CI/scripts gen_tlbx'
2422
}
@@ -31,8 +29,9 @@ stage("Build Toolbox") {
3129
}
3230
}
3331
if (branchName == 'hdl_2022_r2') {
34-
archiveArtifacts artifacts: '*.mltbx'
35-
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
32+
local_stash('builtSources')
33+
sh 'ls -lR'
34+
archiveArtifacts artifacts: 'hdl/*', followSymlinks: false, allowEmptyArchive: true
3635
}
3736
}
3837
}
@@ -47,15 +46,24 @@ cstage("HDL Tests", "", flags) {
4746
branchName ->
4847
withEnv(['BOARD='+branchName]) {
4948
cstage("Source", branchName, flags) {
50-
unstash "builtSources"
49+
local_unstash('builtSources')
5150
sh 'make -C ./CI/scripts test'
52-
junit testResults: 'test/*.xml', allowEmptyResults: true
51+
junit testResults: 'test/*.xml', allowEmptyResults: true
5352
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
5453
}
55-
cstage("Installer", branchName, flags) {
54+
/*
55+
stage("Synth") {
5656
unstash "builtSources"
57+
sh 'make -C ./CI/scripts test_synth'
58+
junit testResults: 'test/*.xml', allowEmptyResults: true
59+
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
60+
}
61+
*/
62+
cstage("Installer", branchName, flags) {
63+
local_unstash('builtSources')
64+
sh 'rm -rf hdl'
5765
sh 'make -C ./CI/scripts test_installer'
58-
junit testResults: 'test/*.xml', allowEmptyResults: true
66+
junit testResults: 'test/*.xml', allowEmptyResults: true
5967
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
6068
}
6169
}
@@ -73,7 +81,7 @@ deployments[board] = { node(nodeLabel) {
7381
try {
7482
cstage("AD9208 HDL Test", "", flags) {
7583
echo "Node: ${env.NODE_NAME}"
76-
unstash "builtSources"
84+
local_unstash('builtSources', '', false)
7785
sh 'make -C ./CI/scripts test'
7886
junit testResults: 'test/*.xml', allowEmptyResults: true
7987
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
@@ -97,7 +105,7 @@ cstage("NonHW Tests", "", flags) {
97105
branchName ->
98106
withEnv(['BOARD='+branchName]) {
99107
cstage("NonHW", branchName, flags) {
100-
unstash "builtSources"
108+
local_unstash('builtSources')
101109
sh 'make -C ./CI/scripts run_NonHWTests'
102110
}
103111
}
@@ -113,7 +121,7 @@ cstage("Hardware Streaming Tests", "", flags) {
113121
dockerParallelBuild(classNames, dockerHost, dockerConfig) {
114122
branchName ->
115123
withEnv(['HW='+branchName]) {
116-
unstash "builtSources"
124+
local_unstash("builtSources")
117125
sh 'echo ${HW}'
118126
// sh 'make -C ./CI/scripts test_streaming'
119127
}
@@ -122,14 +130,14 @@ cstage("Hardware Streaming Tests", "", flags) {
122130

123131
//////////////////////////////////////////////////////
124132

125-
node {
133+
node('docker') {
126134
cstage('Deploy Development', "", flags) {
127-
unstash "builtSources"
135+
local_unstash('builtSources', '', false)
128136
uploadArtifactory('HighSpeedConverterToolbox','*.mltbx')
129137
}
130138
if (env.BRANCH_NAME == 'master') {
131139
cstage('Deploy Production', "", flags) {
132-
unstash "builtSources"
140+
local_unstash('builtSources', '', false)
133141
uploadFTP('HighSpeedConverterToolbox','*.mltbx')
134142
}
135143
}

test/BSPInstallerTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
methods(TestClassSetup)
77
function removeinstalledbsp(~)
8-
str = 'Analog Devices';
8+
str = 'Analog Devices Board Support Packages';
99
ts = matlab.addons.toolbox.installedToolboxes;
1010
for t = ts
1111
if contains(t.Name,str)

test/BSPTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
methods(TestClassSetup)
44
function removeinstalledbsp(~)
5-
str = 'Analog Devices';
5+
str = 'Analog Devices Board Support Packages';
66
ts = matlab.addons.toolbox.installedToolboxes;
77
for t = ts
88
if contains(t.Name,str)

test/build_design.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@
6969

7070
%% Run the workflow
7171
try
72-
hdlcoder.runWorkflow([mdl,'/HDL_DUT'], hWC, 'Verbosity', 'On');
72+
hdlcoder.runWorkflow([mdl,'/HDL_DUT'], hWC, 'Verbosity', 'on');
73+
fprintf('Build finished without exception\n');
7374
close_system(mdl, false);
7475
bdclose('all');
7576
bootbin = [folder,'/vivado_ip_prj/boot/BOOT.BIN'];
@@ -82,6 +83,7 @@
8283
end
8384
out = [];
8485
catch ME
86+
fprintf('Exception occurred with message: %s\n', ME.message);
8587
if SynthesizeDesign && exist([folder,'/vivado_ip_prj/boot/BOOT.BIN'],'file')
8688
ME = [];
8789
end

test/runTests.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function runTests(board)
2323

2424
try
2525

26-
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',1);
26+
runner = matlab.unittest.TestRunner.withTextOutput('OutputDetail',4);
2727
runner.addPlugin(DiagnosticsValidationPlugin)
2828

2929
xmlFile = 'BSPTestResults.xml';

0 commit comments

Comments
 (0)