Skip to content

CI migration update #165

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
30 changes: 0 additions & 30 deletions CI/scripts/genTlbx.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,36 +66,6 @@ function genTlbx(examples)
end
matlab.addons.toolbox.packageToolbox(projectFile,outputFile)

if ~usejava('desktop')
%% Update toolbox paths
mkdir other
movefile([outputFile,'.mltbx'], ['other/',outputFile,'.zip']);
cd other
unzip([outputFile,'.zip'],'out');
cd('out')
cd('metadata');
fid = fopen('configuration.xml','r');
f=fread(fid,'*char')';
fclose(fid);

s = '</matlabPaths>';
sections = strsplit(f,s);
s1 = sections{1};
s2 = sections{2};
newfile = [s1,paths,s,s2];

fid = fopen('configuration.xml','w');
fprintf(fid,'%s',newfile);
fclose(fid);

%% Repack
cd('..');
zip([outputFile,'.zip'], '*');
movefile([outputFile,'.zip'],['../../',outputFile,'.mltbx']);
cd('../..');
rmdir('other','s');
end

delete bsp.prj


Expand Down
17 changes: 10 additions & 7 deletions CI/scripts/synth_designs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -x

BOARD=$1
MLFLAGS="-nodisplay -nodesktop -nosplash"
Expand All @@ -8,18 +9,20 @@ 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
sed -i "s/hdlcoder_board_customization/hdlcoder_board_customization_local/g" test/hdlcoder_board_customization_local.m
source /opt/Xilinx/Vivado/2022.2/settings64.sh
Xvfb :77 &
export DISPLAY=:77
# Randomize DISPLAY number to avoid conflicts
export DISPLAY_ID=:$(shuf -i 10-1000 -n 1)
Xvfb $DISPLAY_ID &
XVFB_PID=$!
export DISPLAY=$DISPLAY_ID
export SWT_GTK3=0
source /opt/Xilinx/Vivado/2022.2/settings64.sh
$MLPATH/$MLRELEASE/bin/matlab $MLFLAGS -r "cd('test');runSynthTests('$BOARD');"
pidof Xvfb
if [ $? -eq 0 ]; then
kill -9 `pidof Xvfb`
fi
EC=$?
kill -9 $XVFB_PID || true
exit $EC
44 changes: 26 additions & 18 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 All @@ -14,11 +14,9 @@ stage("Build Toolbox") {
dockerParallelBuild(hdlBranches, dockerHost, dockerConfig) {
branchName ->
try {
withEnv(['HDLBRANCH='+branchName]) {
withEnv(['HDLBRANCH='+branchName,'LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
checkout scm
sh 'git submodule update --init'
sh 'pip3 install -r ./CI/gen_doc/requirements_doc.txt'
sh 'make -C ./CI/gen_doc doc_ml'
sh 'git submodule update --init'
sh 'make -C ./CI/scripts build'
sh 'make -C ./CI/scripts gen_tlbx'
}
Expand All @@ -31,8 +29,9 @@ stage("Build Toolbox") {
}
}
if (branchName == 'hdl_2022_r2') {
archiveArtifacts artifacts: '*.mltbx'
stash includes: '**', name: 'builtSources', useDefaultExcludes: false
local_stash('builtSources')
sh 'ls -lR'
archiveArtifacts artifacts: 'hdl/*', followSymlinks: false, allowEmptyArchive: true
}
}
}
Expand All @@ -47,15 +46,24 @@ 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
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
cstage("Installer", branchName, flags) {
/*
stage("Synth") {
unstash "builtSources"
sh 'make -C ./CI/scripts test_synth'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
*/
cstage("Installer", branchName, flags) {
local_unstash('builtSources')
sh 'rm -rf hdl'
sh 'make -C ./CI/scripts test_installer'
junit testResults: 'test/*.xml', allowEmptyResults: true
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
}
}
Expand All @@ -73,7 +81,7 @@ deployments[board] = { node(nodeLabel) {
try {
cstage("AD9208 HDL Test", "", flags) {
echo "Node: ${env.NODE_NAME}"
unstash "builtSources"
local_unstash('builtSources', '', false)
sh 'make -C ./CI/scripts test'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/logs/*', followSymlinks: false, allowEmptyArchive: true
Expand All @@ -97,7 +105,7 @@ cstage("NonHW Tests", "", flags) {
branchName ->
withEnv(['BOARD='+branchName]) {
cstage("NonHW", branchName, flags) {
unstash "builtSources"
local_unstash('builtSources')
sh 'make -C ./CI/scripts run_NonHWTests'
}
}
Expand All @@ -113,7 +121,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 @@ -122,14 +130,14 @@ cstage("Hardware Streaming Tests", "", flags) {

//////////////////////////////////////////////////////

node {
node('docker') {
cstage('Deploy Development', "", flags) {
unstash "builtSources"
local_unstash('builtSources', '', false)
uploadArtifactory('HighSpeedConverterToolbox','*.mltbx')
}
if (env.BRANCH_NAME == 'master') {
cstage('Deploy Production', "", flags) {
unstash "builtSources"
local_unstash('builtSources', '', false)
uploadFTP('HighSpeedConverterToolbox','*.mltbx')
}
}
Expand Down
45 changes: 25 additions & 20 deletions JenkinsfileCron
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@Library('tfc-lib') _
@Library('tfc-lib@adef-ci') _

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

Expand All @@ -27,7 +27,8 @@ 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 @@ -43,45 +44,49 @@ def deployments = [:]
for (int i=0; i < boardNames.size(); i++) {
def board = boardNames[i];
def nodeLabel = 'baremetal';
def workspaceLabel = board + '_workspace'
def bbfolder = 'bootbin_' + board
if (board.contains("zcu102") || board.contains("vcu118"))
nodeLabel = 'baremetal && high_memory';
deployments[board] = { node(nodeLabel) {
def cworkspace = env.WORKSPACE + '/' + workspaceLabel
ws(cworkspace) {
stage("Synthesis Tests") {
withEnv(['BOARD='+board,'MLRELEASE=R2023b','HDLBRANCH=hdl_2022_r2','LC_ALL=C.UTF-8','LANG=C.UTF-8']) {
try {
stage("Synth") {
echo "Node: ${env.NODE_NAME}"
unstash "builtSources"
sh 'apt install -y xvfb'
local_unstash('builtSources', '', false)
sh 'echo "BOARD:$BOARD"'
sh 'make -C ./CI/scripts test_synth'
junit testResults: 'test/*.xml', allowEmptyResults: true
archiveArtifacts artifacts: 'test/*', followSymlinks: false, allowEmptyArchive: true
}
if (!board.contains("pluto") && !board.contains("vcu118")) {
stage("Upload BOOT.BINs") {
sh 'mkdir bootbins'
sh 'mv test/*.BIN bootbins/'
uploadArtifactory('HighSpeedConverterToolbox','bootbins/*.BIN*')
}
}
if (!board.contains("pluto") && !board.contains("vcu118")) {
stage("Upload BOOT.BINs") {
sh 'rm -rf ' + bbfolder + ' || true'
sh 'mkdir ' + bbfolder
uploadArtifactory('HighSpeedConverterToolbox',bbfolder+'/*.BIN*')
}
}
}
finally {
cleanWs();
}
}
}
} // stage
} // ws
}}
}

parallel deployments


/////////////////////////////////////////////////////
node {
stage("Trigger Harness") {
echo "Node: ${env.NODE_NAME}"
unstash "builtSources"
triggerHWHarness("HighSpeedConverterToolbox")
}
}
// node {
// stage("Trigger Harness") {
// echo "Node: ${env.NODE_NAME}"
// unstash "builtSources"
// triggerHWHarness("HighSpeedConverterToolbox")
// }
// }
4 changes: 3 additions & 1 deletion test/build_design.m
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@

%% Run the workflow
try
hdlcoder.runWorkflow([mdl,'/HDL_DUT'], hWC, 'Verbosity', 'On');
hdlcoder.runWorkflow([mdl,'/HDL_DUT'], hWC, 'Verbosity', 'on');
fprintf('Build finished without exception\n');
close_system(mdl, false);
bdclose('all');
bootbin = [folder,'/vivado_ip_prj/boot/BOOT.BIN'];
Expand All @@ -82,6 +83,7 @@
end
out = [];
catch ME
fprintf('Exception occurred with message: %s\n', ME.message);
if SynthesizeDesign && exist([folder,'/vivado_ip_prj/boot/BOOT.BIN'],'file')
ME = [];
end
Expand Down
2 changes: 1 addition & 1 deletion test/runTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function runTests(board)

try

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

xmlFile = 'BSPTestResults.xml';
Expand Down
Loading