Choose to Generate HDL Code in Simulink or MATLAB
When deciding how to develop an algorithm from which you want to generate HDL code, you must choose between developing in the Simulink® or MATLAB® design environments. MATLAB has a text-based interface that is efficient for rapid algorithm development and prototyping, while Simulink has a graphical interface that enables you to use Model-Based Design to visualize complex systems and manage large designs.
When you use Simulink as your design environment, you can also combine Model-Based Design and MATLAB code by using the MATLAB Function block. For example, you can use Simulink for system-level modeling and MATLAB Function blocks for algorithmic components.
This table compares the strengths of the Simulink and MATLAB design environments. Use this table to determine which design environment meets your design requirements.
Tip
Consider prototyping part of your design in both environments to see if a Simulink or MATLAB works better for your project requirements.
| Design Requirements | Simulink Design Environment | MATLAB Design Environment |
|---|---|---|
| Example Applications |
|
|
| Ease of Use |
|
|
| Simulink Block and MATLAB Language Support | Create models using the Simulink HDL block library. For more information, see | Create functions using supported MATLAB functions and features. For more information, see Functions Supported for HDL and HLS Code Generation. |
| Integration with other MathWorks products |
| Create MATLAB algorithms that integrate HDL code generation features from the DSP HDL Toolbox, DSP System Toolbox, Vision HDL Toolbox, and Deep Learning HDL Toolbox™. |
| Optimize Generated HDL Code for Speed and Area | Use a combination of model, subsystem, and block-level speed and area optimizations. For more information, see Speed and Area Optimization. | Use the HDL Coder Optimizations settings for algorithm-level and pragmas for MATLAB statement-level speed and area optimizations. For more information, see Speed and Area Optimization. |
| Verification and Validation | Verify generated HDL code by generating HDL test benches. For more information, see Verify Generated HDL Code from Simulink Model. If you have HDL Verifier™, you can also:
| Verify generated HDL code by generating HDL test benches. For more information, see Verify Code with HDL Test Bench. If you have HDL Verifier, you can also:
|
| Hardware Deployment and Prototyping | Deploy your design to standalone FPGA boards, system-on-chip (SoC) platforms, or to Simulink Real-Time™ target machines with FPGA I/O boards. To interact with your deployed design on target hardware, use one or more of these methods:
| Deploy your design to standalone FPGA boards, system-on-chip (SoC) platforms, or to Simulink Real-Time target machines with FPGA I/O boards. To interact with your deployed design on target hardware, use one or more of these methods:
|