Skip to content

Commit

Permalink
Merge pull request #148 from analogdevicesinc/tfcollins/ad9081-test-u…
Browse files Browse the repository at this point in the history
…pdates

Tfcollins/ad9081 test updates
  • Loading branch information
tfcollins authored Aug 18, 2023
2 parents b720445 + 7e52970 commit 5c2f1c3
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 55 deletions.
19 changes: 18 additions & 1 deletion +adi/+AD9081/Base.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
matlabshared.libiio.base
%AD9081 Base Class

properties (Dependent)
%SamplingRate Sampling Rate
% Baseband sampling rate in Hz, specified as a scalar
% in samples per second. This value is only readable once
% connected to hardware
SamplingRate
end

properties (Nontunable)
%SamplesPerFrame Samples Per Frame
% Number of samples per frame, specified as an even positive
Expand Down Expand Up @@ -41,8 +49,16 @@
'', 'SamplesPerFrame');
obj.SamplesPerFrame = value;
end
% Dependent
function value = get.SamplingRate(obj)
if obj.ConnectedToDevice
value = double(obj.getAttributeLongLong('voltage0_i','sampling_frequency',obj.isOutput));
else
value = NaN;
end
end
%% Helpers
function [num_coarse, num_fine, num_data] = GetDataPathConfiguration(obj, isTx)
function [num_coarse, num_fine, num_data, sr] = GetDataPathConfiguration(obj, isTx)
if nargin < 2
isTx = isa(obj,'adi.AD9081.Tx');
end
Expand Down Expand Up @@ -74,6 +90,7 @@
end

%% Parse data path configuration
sr = obj.SamplingRate;
numChannels = obj.iio_device_get_channels_count(dev);
map = {};
paths = {};
Expand Down
18 changes: 1 addition & 17 deletions +adi/+AD9081/Rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@
% <a href="http://www.analog.com/media/en/technical-documentation/data-sheets/AD9081.pdf">AD9081 Datasheet</a>
%
% See also adi.DAQ2.Rx

properties (Dependent)
%SamplingRate Sampling Rate
% Baseband sampling rate in Hz, specified as a scalar
% in samples per second. This value is only readable once
% connected to hardware
SamplingRate
end


properties
%ChannelNCOFrequencies Channel NCO Frequencies
% Frequency of NCO in fine decimators in receive path. Property
Expand Down Expand Up @@ -116,14 +108,6 @@
obj.MainNCOPhases = zeros(1,obj.num_coarse_attr_channels);
end

function value = get.SamplingRate(obj)
if obj.ConnectedToDevice
value= obj.getAttributeLongLong('voltage0_i','sampling_frequency',false);
else
value = NaN;
end
end

% Check ChannelNCOFrequencies
function set.ChannelNCOFrequencies(obj, value)
obj.CheckAndUpdateHW(value,'ChannelNCOFrequencies',...
Expand Down
6 changes: 3 additions & 3 deletions +adi/+AD9081/Tx.m
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
% Frequency of NCO in fine decimators in transmit path. Property
% must be a [1,N] vector where each value is the frequency of an
% NCO in hertz.
ChannelNCOGainScales = [0,0,0,0];
ChannelNCOGainScales = [0.5,0.5,0.5,0.5];
%NCOEnables NCO Enables
% Vector of logicals which enabled individual NCOs in channel
% interpolators
Expand Down Expand Up @@ -96,8 +96,8 @@
obj.MainNCOFrequencies = zeros(1,obj.num_coarse_attr_channels);
obj.ChannelNCOPhases = zeros(1,obj.num_fine_attr_channels);
obj.MainNCOPhases = zeros(1,obj.num_coarse_attr_channels);
obj.ChannelNCOGainScales = zeros(1,obj.num_fine_attr_channels);
obj.NCOEnables = zeros(1,obj.num_fine_attr_channels) > 0;
obj.ChannelNCOGainScales = 0.5.*ones(1,obj.num_fine_attr_channels);
obj.NCOEnables = ones(1,obj.num_fine_attr_channels) > 0;
end
% Check ChannelNCOFrequencies
function set.ChannelNCOFrequencies(obj, value)
Expand Down
2 changes: 1 addition & 1 deletion +adi/+common
Submodule +common updated 4 files
+63 −33 Attribute.m
+68 −0 DDS.m
+11 −1 DebugAttribute.m
+1 −1 Rx.m
15 changes: 14 additions & 1 deletion JenkinsfileHW
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ lock(label: 'adgt_test_harness_boards') {
harness.set_elastic_server('192.168.10.1')
harness.set_required_hardware(["zynq-zc706-adv7511-fmcdaq2",
"zynqmp-zcu102-rev10-fmcdaq3",
"zynqmp-zcu102-rev10-ad9081-vm8-l4"])
"zynqmp-zcu102-rev10-ad9081-vm8-l4",
"zynqmp-zcu102-rev10-ad9081-vm4-l8",
"zynqmp-zcu102-rev10-ad9081-v204b-txmode9-rxmode4",
"zynqmp-zcu102-rev10-ad9081-v204c-txmode0-rxmode1",
"zynq-zc706-adv7511-fmcomms11",
"zynqmp-zcu102-rev10-ad9172-fmc-ebz-mode4"])

harness.set_docker_args(['Vivado', 'MATLAB'])
harness.set_nebula_local_fs_source_root("artifactory.analog.com")

Expand All @@ -57,6 +63,13 @@ lock(label: 'adgt_test_harness_boards') {
"pyenv('Version','/usr/bin/python3')",
"runHWTests(getenv('board'))"])
harness.add_stage(harness.stage_library("MATLABTests"),'continueWhenFail')
def saveFigures = {
stage('Save Figure') {
archiveArtifacts artifacts: '*.png', followSymlinks: false, allowEmptyArchive: true
archiveArtifacts artifacts: '*.fig', followSymlinks: false, allowEmptyArchive: true
}
}
harness.add_stage(saveFigures,'continueWhenFail')

harness.add_stage(harness.stage_library('SendResults'),'continueWhenFail')

Expand Down
Loading

0 comments on commit 5c2f1c3

Please sign in to comment.