function accelload_private(modelName)
%ACCELLOAD_PRIVATE Private Accelerator load function
%
%   This is a back-end function for use with the Real-Time Workshop
%   when loading an Accelerator MEX-file for use with the Simulink
%   Accelerator. It is not intended to be directly used or modified.
%

%
%       Copyright 2017 The MathWorks, Inc.
%

% Get building dir and file name to load
folders = Simulink.filegen.internal.FolderConfiguration(modelName);
buildDir = folders.Accelerator.absolutePath('ModelCode');
hModel = get_param(modelName,'handle');

fileName = 'amsi_serial.mat';
fullFileName = fullfile(buildDir, fileName);

if exist(fullFileName, 'file') == 2
    % Load file
    amsiTable = load(fullFileName);

    % Save into disk the serialized version of the AMSI table
    set_param(hModel,'AMSITableSerialized',  amsiTable.amsi_serial);
end

% LocalWords:  amsi
