classdef socModelBuilder< handle
%socModelBuilder Create an object to build the model
%   socModelBuilder creates an object, that controls and runs the
%   generation workflow.You can also use this object to load the
%   existing binaries onto the hardware board.
%
%   obj = socModelBuilder(modelName) returns an socModelBuilder object,
%   obj, with the ModelName property set to the string modelName
%
%   obj = socModelBuilder(modelName, Name=Value) specifies properties
%   using one or more name-value arguments
% 
%   obj = socModelBuilder returns an socModelBuilder object, obj, with
%   properties set to their default value
%
%   socModelBuilder methods:
%       socModelBuilder                 - Constructor
%       buildModel                      - Build an SoC model
%       loadBinaries                    - Load existing binaries onto
%                                         hardware board
%   socModelBuilder properties:
%       ModelName                       - Name of the model to build
%       ProjectFolder                   - Folder for generated project files
%       BuildType                       - Part of the model to build
%       ExternalMode                    - Run generated software model in external mode
%       RunExternalFPGABuild            - Run FPGA build process externally

     
    % Copyright 2022 The MathWorks, Inc.

    methods
        function out=socModelBuilder
            %socModelBuilder Create an object to build the model
            %   socModelBuilder creates an object, that controls and runs the
            %   generation workflow.You can also use this object to load the
            %   existing binaries onto the hardware board.
            %
            %   obj = socModelBuilder(modelName) returns an socModelBuilder object,
            %   obj, with the ModelName property set to the string modelName
            %
            %   obj = socModelBuilder(modelName, Name=Value) specifies properties
            %   using one or more name-value arguments
            %
            %   obj = socModelBuilder returns an socModelBuilder object, obj, with
            %   properties set to their default value
            %
            %   socModelBuilder methods:
            %       socModelBuilder                 - Constructor
            %       buildModel                      - Build an SoC model
            %       loadBinaries                    - Load existing binaries onto
            %                                         hardware board
            %   socModelBuilder properties:
            %       ModelName                       - Name of the model to build
            %       ProjectFolder                   - Folder for generated project files
            %       BuildType                       - Part of the model to build
            %       ExternalMode                    - Run generated software model in external mode
            %       RunExternalFPGABuild            - Run FPGA build process externally
        end

        function out=buildModel(~) %#ok<STOUT>
            %buildModel Build an SoC model
            %   buildModel(obj) builds the model using Xilinx® Vivado® or
            %   Intel® Quartus® tool families. The object saves all the
            %   generated project files in the folder that you specify in
            %   the 'ProjectFolder' property.
        end

        function out=loadBinaries(~) %#ok<STOUT>
            %loadBinaries Load existing binaries onto hardware board
            %   loadBinaries(obj) loads the binaries in the specified project
            %   folder to the last connected harware board.
            %   loadBinaries(obj, hardware) loads the binaries in the
            %   specified project folder to the specified harware board,
            %   hardware. Create a hardware board object, hardware, using
            %   socHardwareBoard.
        end

    end
    properties
        %BuildType Part of the model to build
        %   Part of the model that you want to build, specified as one of
        %   these text scalar values: 'Processor and FPGA', 'Processor
        %   only', or 'FPGA only'. The default value is 'Processor and
        %   FPGA'.
        BuildType;

        %ExternalMode Run generated software model in external mode
        %   Run the generated software model in the external mode,
        %   specified as a logical scalar. Set this property to true to run
        %   the generated software model in the external mode. The external
        %   mode enables you to tune parameters on the FPGA without
        %   rebuilding the FPGA design. It also enables logging data from
        %   the FPGA and displays the data on the host computer. Set this
        %   property to false to build a standalone application for the
        %   processor model. The default value is false.
        ExternalMode;

        %ModelName Name of the model to build
        %   The name of the model that you want to build, specified as a
        %   string of displayable characters. It must be a valid Simulink
        %   model name.
        ModelName;

        %ProjectFolder Folder for generated project files
        %   Folder for the generated project files, specified as a text
        %   scalar. The buildModel method places all the generated files,
        %   including reports, executables, and the bitstream, in this
        %   folder. The default value is 'soc_prj'.
        ProjectFolder;

        %RunExternalFPGABuild Run FPGA build process externally
        %   Run the FPGA build process externally, specified as a logical
        %   scalar. Set this property to true to run the FPGA build process
        %   parallel to MATLAB. Set this property to false to keep MATLAB
        %   busy until the FPGA build process completes. The default value
        %   is false.
        RunExternalFPGABuild;

    end
end
