Skip to content

Commit

Permalink
Merge pull request #78 from casper-astro/casper-astro-soak-test
Browse files Browse the repository at this point in the history
Casper astro soak test
  • Loading branch information
bjbford committed Dec 11, 2018
2 parents dc456ff + 0f70f45 commit 6f112c8
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 2 deletions.
Binary file modified casper_library/casper_library_misc.slx
Binary file not shown.
3 changes: 1 addition & 2 deletions xps_library/gen_xps_add_design_info.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ function gen_xps_add_design_info(sysname, mssge_paths, slash)
'xps:katadc', ...
'xps:qdr', ...
'xps:sw_reg', ...
'xps:tengbe', ...
'xps:tengbe_v2', ...
'xps:ten_gbe', ...
'xps:forty_gbe', ...
'xps:xsg', ...
'casper:bitsnap', ...
Expand Down
126 changes: 126 additions & 0 deletions xps_library/tengbe_callback.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
% ten_gbe_v2_callback
%
% mask callback function

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% Meerkat radio telescope project %
% www.kat.ac.za %
% Copyright (C) Andrew Martens 2011 %
% %
% This program is free software; you can redistribute it and/or modify %
% it under the terms of the GNU General Public License as published by %
% the Free Software Foundation; either version 2 of the License, or %
% (at your option) any later version. %
% %
% This program is distributed in the hope that it will be useful, %
% but WITHOUT ANY WARRANTY; without even the implied warranty of %
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %
% GNU General Public License for more details. %
% %
% You should have received a copy of the GNU General Public License along %
% with this program; if not, write to the Free Software Foundation, Inc., %
% 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function tengbe_callback()

clog('entering ten_gbe_callback', 'trace');

blk = gcb;

check_mask_type(blk, 'ten_gbe');

%search for sysgen block and get target
xps_xsg_blks = find_system(bdroot,'SearchDepth',1,'FollowLinks','on','LookUnderMasks','all','Tag','xps:xsg');
if length(xps_xsg_blks) ~= 1,
errordlg('ten_Gbe_v2 requires a single MSSGE (XSG core config) block to be instantiated at the top level');
return;
end

%get the target board for the design
hw_sys = get_param(xps_xsg_blks(1),'hw_sys');
flavour = get_param(blk,'flavour');
show_param = get_param(blk, 'show_param');
mask_names = get_param(blk, 'MaskNames');
mask_visibilities = get_param(blk, 'MaskVisibilities');

%turn everything off by default

for p = 1:length(mask_visibilities),
mask_visibilities{p} = 'off';
end

%%%%%%%%%%%%%%%%%%%%%%%%%%
%these are visible always
%%%%%%%%%%%%%%%%%%%%%%%%%%

mask_visibilities{ismember(mask_names, 'rx_dist_ram')} = 'on';
mask_visibilities{ismember(mask_names, 'large_frames')} = 'on';
mask_visibilities{ismember(mask_names, 'show_param')} = 'on';

% debug counter checkboxes
mask_visibilities{ismember(mask_names, 'debug_ctr_width')} = 'on';
mask_visibilities{ismember(mask_names, 'txctr')} = 'on';
mask_visibilities{ismember(mask_names, 'txerrctr')} = 'on';
mask_visibilities{ismember(mask_names, 'txofctr')} = 'on';
mask_visibilities{ismember(mask_names, 'txfullctr')} = 'on';
mask_visibilities{ismember(mask_names, 'txvldctr')} = 'on';
mask_visibilities{ismember(mask_names, 'txsnaplen')} = 'on';
mask_visibilities{ismember(mask_names, 'rxctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxerrctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxofctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxbadctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxvldctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxeofctr')} = 'on';
mask_visibilities{ismember(mask_names, 'rxsnaplen')} = 'on';

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%these are visible always depending on architecture
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if strcmp(hw_sys,'ROACH2:sx475t'),
mask_visibilities{ismember(mask_names, 'flavour')} = 'on';
mask_visibilities{ismember(mask_names, 'slot')} = 'on';

if strcmp(flavour,'cx4'), %CX4 mezzanine card for ROACH2 has only 3 (external) ports
mask_visibilities{ismember(mask_names, 'port_r2_cx4')} = 'on';
elseif strcmp(flavour, 'sfp+'), %SFP+ mezzanine card 4 external ports
mask_visibilities{ismember(mask_names, 'port_r2_sfpp')} = 'on';
end
else
mask_visibilities{ismember(mask_names, 'port_r1')} = 'on';
end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%these are visible if low level parameters enabled
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if strcmp(show_param, 'on'),
%these are visible regardless of target hardware
mask_visibilities{ismember(mask_names, 'fab_en')} = 'on';
mask_visibilities{ismember(mask_names, 'fab_mac')} = 'on';
mask_visibilities{ismember(mask_names, 'fab_ip')} = 'on';
mask_visibilities{ismember(mask_names, 'fab_udp')} = 'on';
mask_visibilities{ismember(mask_names, 'fab_gate')} = 'on';
mask_visibilities{ismember(mask_names, 'cpu_rx_en')} = 'on';
mask_visibilities{ismember(mask_names, 'cpu_tx_en')} = 'on';

if strcmp(hw_sys,'ROACH2:sx475t'),
mask_visibilities{ismember(mask_names, 'pre_emph_r2')} = 'on';
mask_visibilities{ismember(mask_names, 'swing_r2')} = 'on';
mask_visibilities{ismember(mask_names, 'post_emph_r2')} = 'on';
mask_visibilities{ismember(mask_names, 'rxeqmix_r2')} = 'on';
mask_visibilities{ismember(mask_names, 'ttl')} = 'on';
mask_visibilities{ismember(mask_names, 'promisc_mode')} = 'on';
else
mask_visibilities{ismember(mask_names, 'pre_emph')} = 'on';
mask_visibilities{ismember(mask_names, 'swing')} = 'on';
end
end

% enable and make visible relevant parameters
set_param(blk, 'MaskVisibilities', mask_visibilities);

clog('exiting ten_gbe_callback', 'trace');
4 changes: 4 additions & 0 deletions xps_library/tengbe_mask.m
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ function draw_rxcounter(sys, ypos, targetname, eof_tag, source_tag)
reuse_block(cursys, 'rxsnap_and', 'xbsIndex_r4/Logical', ...
'arith_type', 'Unsigned', 'logical_function', 'AND', 'inputs', '2', ...
'Position', [1070 1194 1120 1241]);
try delete_block_lines([cursys, '/', snapname], false); catch e, end
try delete_block_lines([cursys, '/rxsnap_and'], false); catch e, end
try add_line(cursys, 'rxs_fr0/1', [snapname, '/1']); catch e, end
try add_line(cursys, 'rxs_fr1/1', [snapname, '/2']); catch e, end
try add_line(cursys, 'rxs_fr2/1', [snapname, '/3']); catch e, end
Expand Down Expand Up @@ -441,6 +443,8 @@ function draw_rxcounter(sys, ypos, targetname, eof_tag, source_tag)
reuse_block(cursys, 'txsnap_and', 'xbsIndex_r4/Logical', ...
'arith_type', 'Unsigned', 'logical_function', 'AND', 'inputs', '2', ...
'Position', [1060 1479 1110 1526]);
try delete_block_lines([cursys, '/', snapname], false); catch e, end
try delete_block_lines([cursys, '/txsnap_and'], false); catch e, end
try add_line(cursys, 'txs_fr0/1', [snapname, '/1']); catch e, end
try add_line(cursys, 'txs_fr1/1', [snapname, '/2']); catch e, end
try add_line(cursys, 'txs_fr2/1', [snapname, '/3']); catch e, end
Expand Down

0 comments on commit 6f112c8

Please sign in to comment.