function blockInfo = getBlockInfo(this, slbh) 
%

%   Copyright 2023-2024 The MathWorks, Inc.

blockInfo = struct;
blockInfo.Name = get_param(slbh, 'Name');
blockInfo.MatrixA = hdlslResolve('A', slbh);
blockInfo.MatrixB = hdlslResolve('B', slbh);
blockInfo.MatrixC = hdlslResolve('C', slbh);
blockInfo.MatrixD = hdlslResolve('D', slbh);

blockInfo.X0 = hdlslResolve('X0', slbh);
% check the size of X0 and make it compatible with A
if isscalar(blockInfo.X0)
    blockInfo.X0 = blockInfo.X0 * ones(1, size(blockInfo.MatrixA, 1));
end
blockInfo.SampleTime = hdlslResolve('SampleTime', slbh);

blockInfo.MatrixAType = class(blockInfo.MatrixA);
blockInfo.MatrixBType = class(blockInfo.MatrixB);
blockInfo.MatrixCType = class(blockInfo.MatrixC);
blockInfo.MatrixDType = class(blockInfo.MatrixD);
blockInfo.X0Type = class(blockInfo.X0);

% default value for sharing factor = 0. sharing factor 0 or 1 imply a fully
% parallel implementation or no sharing
blockInfo.sharingFactor = 1;
sharingFactorImpl = this.getImplParams('SharingFactor');

if ~isempty(sharingFactorImpl)
    % get the non-default value
    blockInfo.sharingFactor = sharingFactorImpl;
end

end
