Main Content

Project and Top-Level Model

An SoC application model developed using the SoC Blockset™ combines multiple subsystems and reference models. Each subsystem and reference model maps to a particular feature of an SoC device. Organization of the models and shared configuration settings requires a Simulink® project.

  1. Create a new SoC Blockset project named SampleSoCApplication. Creating a new project automatically creates a new project folder with the same name. For more information on creating projects, see Create a New Project from a Folder.

  2. Open a new Simulink model. Save the model as soc_hwsw_top.slx into the project folder.

  3. In MATLAB®, on the Project tab, in the Tools section, select Run Checks > Add Files and add the soc_hwsw_top.slx model file to the project.

  4. In Simulink, configure the soc_hwsw_top.slx model to as an SoC application. On the Apps tab, under Setup to Run on Hardware, click System on Chip (SoC).

  5. In the System on Chip (SoC) pop-up window, select Hardware Board > Xilinx Zynq ZC706 evaluation kit. Click Finish.

    Note

    You can optionally choose any of the available hardware boards based to suit your system requirements.

  6. On the System on Chip tab, click Hardware Settings. On the Configuration Parameters dialog box, in the Solver tab, set Solver selection > Type to Variable-step. Click OK.

  7. Create three box areas and label them as FPGA, Memory, and Processor. For more information on creating box areas, see Visually Organize Models Using Areas. In the following sections, these areas are populated for various aspects of your SoC application.

  8. Create a new MATLAB function to initialize variables used throughout the project.

    function soc_hwsw_init
    % Initialize the model wide variables and set them in base workspace. 
    
    SourceSTime = 1e-7; 
    
    FrameSize = 1000;
    ProcSTime = SourceSTime*FrameSize;
    FPGASTime = SourceSTime;
    FPGAFrameSize = 1;
    
    assignin('base','ProcSTime',ProcSTime);
    assignin('base','FPGASTime',FPGASTime);
    assignin('base','SourceSTime',SourceSTime);
    assignin('base','FPGAFrameSize',FPGAFrameSize);
    assignin('base','FrameSize',FrameSize);
    
    end

    In the project folder, save the file as soc_hwsw_init.m in a new subfolder, utilities and add the file to project.

See Also

Related Topics