- Let’s take a Simulink module compatible with HDL Coder. Run the following command in MATLAB's Command Window and open “hdlcoder_led_blinking.slx”.
- Right-click on the “led_counter” block, go to HDL Code > HDL Workflow Advisor. Refer to this MathWorks documentation for more information on HDL Workflow Advisor: https://www.mathworks.com/help/hdlcoder/ug/using-the-hdl-workflow-advisor-window.html
- The following image shows the configuration setup for a generic FPGA/ASIC. You can select the synthesis tool and family of FPGAs and explore more with different combinations that fit the need.
- In the left pane, right-click on “Generate RTL Code and Testbench” option and select “Run to Selected Task”.
- This will open a “Code Generation Report” where you can see a “High-level Resource Report” section, giving the summary of various digital circuit components used. For further information on reports generation, refer to the following link: https://www.mathworks.com/help/hdlcoder/ug/creating-and-using-code-generation-reports.html
- Run the following command to connect Vivado to MATLAB:
- Select the following configuration options. I have assumed Xilinx Vivado as the synthesis tool with the Zynq family of processing system.
- Set Target Frequency to the model’s requirement, I have assumed it to be 300 MHz.
- Follow the steps mentioned before and run till ‘Run Synthesis”.
- This will offer a more detailed and precise utilization report that you can reference to compare the FPGA's maximum limits with its current usage.
- For more information on FPGA Synthesis from Simulink, refer the following MathWorks documentation link: https://www.mathworks.com/help/hdlcoder/gs/fpga-synthesis-and-analysis-using-the-hdl-workflow-advisor.html
- https://www.mathworks.com/help/hdlcoder/ug/get-started-with-simscape-hardware-in-the-loop-workflow.html
- https://www.mathworks.com/help/simscape/ug/generate-hdl-code-using-the-simscape-hdl-workflow-advisor.html
- https://www.mathworks.com/help/hdlcoder/ug/generate-hdl-code-from-simscape-model.html