Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.
Merged
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 +adi/+AD9361/Rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -307,14 +307,14 @@ function setupInit(obj)
calllib('libad9361','ad9361_set_bb_rate',obj.iioDevPHY,int32(obj.SamplingRate));
else
obj.setAttributeLongLong('voltage0','sampling_frequency',obj.SamplingRate,true,4);
obj.setAttributeLongLong('voltage0','rf_bandwidth',obj.RFBandwidth ,strcmp(obj.Type,'Tx'));
end
if strcmp(obj.GainControlModeChannel0,'manual')
obj.setAttributeLongLong('voltage0','hardwaregain',obj.GainChannel0,false);
end
if strcmp(obj.GainControlModeChannel1,'manual') && (obj.channelCount>2)
obj.setAttributeLongLong('voltage1','hardwaregain',obj.GainChannel1,false);
end
obj.setAttributeLongLong('voltage0','rf_bandwidth',obj.RFBandwidth ,strcmp(obj.Type,'Tx'));
end

end
Expand Down
103 changes: 61 additions & 42 deletions CI/scripts/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Usage:
# make <MATLAB release version ex: R2018b> <HDL git branch ex: hdl_2018_r1>
# make <target> MLRELEASE=<MATLAB release version ex: R2018b> HDLBRANCH=<HDL git branch ex: hdl_2018_r1>
# Example
# make R2018b hdl_2018_r1
# make build MLRELEASE=R2018b HDLBRANCH=hdl_2018_r1

ifeq ($(MLRELEASE),)
MLRELEASE := R2018b
Expand All @@ -11,6 +11,19 @@ ifeq ($(HDLBRANCH),)
HDLBRANCH := hdl_2018_r1
endif

ifeq ($(OS),Windows_NT)
$(error Build system does not currently support Windows)
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
MLPATH := /usr/local/MATLAB
endif
ifeq ($(UNAME_S),Darwin)
MLPATH := /Applications
MLRELEASE := MATLAB_${MLRELEASE}.app
endif
endif

GITTAG := $(shell git describe --tags HEAD)

.ONESHELL:
Expand All @@ -19,59 +32,65 @@ build:
bash build_bsp.sh

add_libad9361:
cd ../..
mkdir deps
cd deps
# Linux
mkdir linux
cd linux
#curl --silent "https://api.github.com/repos/analogdevicesinc/libad9361-iio/releases/latest" | jq -r ".assets[] | select(.name | test(\"${spruce_type}\")) | .browser_download_url" | grep tar.gz | wget -i -
wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-trusty.tar.gz
tar xvf *.tar.gz
mv usr/local/lib/* .
mv usr/local/include ../
rm -rf usr
rm *.tar.gz
cd ..
# Windows
mkdir win
cd win
wget "https://ci.appveyor.com/api/projects/analogdevicesinc/libad9361-iio/artifacts/libad9361-win64.zip?branch=master" -O lib.zip
unzip lib.zip
mv libad9361-win64/* .
rm -rf libad9361-win64
rm *.h
cd ../.. ; \
mkdir deps ; \
cd deps ; \
mkdir linux ; \
cd linux ; \
wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-trusty.tar.gz ; \
tar xvf *.tar.gz ; \
mv usr/local/lib/* . ; \
mv usr/local/include ../ ; \
rm -rf usr ; \
rm *.tar.gz ; \
cd .. ; \
mkdir osx ; \
cd osx ; \
wget http://swdownloads.analog.com/cse/travis_builds/master_latest_libad9361-iio-osx_10.12.tar.gz ; \
tar xvf *.tar.gz ; \
cd ad9361* ; \
mv usr/local/lib/ad9361.framework/Versions/Current/ad9361 ../libad9361.dylib ; \
cd .. ; \
rm -rf ad9361-*-Darwin ; \
rm *.tar.gz ; \
cd .. ; \
mkdir win ; \
cd win ; \
wget "https://ci.appveyor.com/api/projects/analogdevicesinc/libad9361-iio/artifacts/libad9361-win64.zip?branch=master" -O lib.zip ; \
unzip lib.zip ; \
mv libad9361-win64/* . ; \
rm -rf libad9361-win64 ; \
rm *.h ; \
rm lib.zip

test_installer:
cd ../..
cp *.mltbx test/
cp hdl_wa_bsp/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
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "cd('test');runInstallerTests;"
cd ../.. ; \
cp *.mltbx test/ ; \
cp hdl_wa_bsp/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 ; \
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "cd('test');runInstallerTests;"

test:
cd ../..
cp hdl_wa_bsp/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
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "cd('test');runTests;"
cd ../.. ; \
cp hdl_wa_bsp/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 ; \
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "cd('test');runTests;"

test_streaming:
cd ../..
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "addpath(genpath('test'));addpath(genpath('deps'));hwTestRunner;"
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "addpath(genpath('test'));addpath(genpath('deps'));hwTestRunner;"

test_modem:
cd ../..
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "addpath(genpath('hdl_wa_bsp'));cd('targeting_models');addpath(genpath('modem-qpsk'))"
cd ../.. ; \
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "addpath(genpath('hdl_wa_bsp'));cd('targeting_models');addpath(genpath('modem-qpsk'))"

gen_tlbx:
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "genTlbx;exit();"
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "genTlbx;exit();"

linter:
/usr/local/MATLAB/$(MLRELEASE)/bin/matlab -nodisplay -r "linter;exit();"
${MLPATH}/$(MLRELEASE)/bin/matlab -nodisplay -r "linter;exit();"

zip:
cd ../..
mkdir zip
cd ../.. ; \
mkdir zip ; \
zip -r zip/AnalogDevicesBSP_$(GITTAG).zip deps doc hdl_wa_bsp hil_models targeting_models info.xml LICENSE README.md test/*.log

5 changes: 5 additions & 0 deletions test/perf/HardwareTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,11 @@ function LTE_R4_Pluto(testCase)

function LTE_R4_RFSOM(testCase)

if ismac
% RF SOM is not supported on OSX from MathWorks
assumeFail(testCase);
end

%% Test configs
Frequencies = (0.4:0.1:5).*1e9;
DeviceTx = @()sdrtx('ADI RF SOM');
Expand Down