
%

%   Copyright 2017 The MathWorks, Inc.

%% Control whether to run matrix vector multiplication module
% Matrix_Multiplication_On = true: Matrix vector multiplication mode
%     Read data from DDR, do matrix vector multiplication, write result back to DDR
% Matrix_Multiplication_On = false: Data Loop Back mode
%     Read data from DDR, write to a RAM inside of the DUT, write the same data back to DDR
Matrix_Multiplication_On = true;

%% parameter initialization
Vector_Matrix_Length = Matrix_Size^2 + Matrix_Size;
Burst_Length = Vector_Matrix_Length;
DDR_Depth = (Matrix_Size^2)*2;
Duty_Cycle = 0.5;
Single_Tolerance = 10e-5;

%% read DDR Data type
maskDataType = get_param('hdlcoder_external_memory/DDR','OutDataTypeStr');

%% DDR initialization data
if strcmp(maskDataType(1:4),'uint') || strcmp(maskDataType(1:3),'int')
    ddrInitData =fi((randi([1 100],1,DDR_Depth)), numerictype(maskDataType));
elseif strcmp(maskDataType, 'single')
    ddrInitData = single((rand(1,DDR_Depth)));
else
    error('Data type %s is not supported for this example. Please try single or int32, or update hdlcoder_external_memory_init.m to provide correct DDR initialization data for this data type.', maskDataType);
end


% LocalWords:  DDR
