Code Generation from Simulink Models
R2026bGenerate HDL code from Simulink® models
Implement your Simulink model or subsystem in hardware by generating HDL code and deploying that code on an Application-Specific Integrated Circuit (ASIC) or Field Programmable Gate Array (FPGA). Design the model with blocks that are compatible with HDL code generation. If the model uses floating-point data, use Fixed-Point Designer™ to convert it to a fixed-point model. Apply optimizations to generate more hardware-efficient HDL code. After you generate HDL code and verify that it matches your original algorithm, deploy the HDL code on your target hardware.
Functions
Topics
Simulink to HDL Code Generation
- Set HDL Code Generation Options
Access HDL options in the Configuration Parameters dialog box, Simulink toolstrip, block context menu, or HDL Block Properties window. - Generate HDL Code from Simulink Model Using Configuration Parameters
Use the Configuration Parameters dialog box to generate HDL code for your Simulink model. - Generate HDL Code from Simulink Model from Command Line
Use the command-line function makehdl to generate HDL code for your Simulink model. - HDL Code Generation and FPGA Synthesis from Simulink Model
Generate code and synthesize your Simulink design on the target FPGA.
Basic Code Generation Practices
- Generate DUT Ports for Tunable Parameters
Generate tunable parameters as top-level DUT ports. - Obfuscate Generated HDL Code from Simulink Models
Learn how to obfuscate the generated VHDL®, Verilog® or SystemVerilog code from your model. - Scalarization of Vector Ports in Generated VHDL Code
Flatten vector signals on entire model or at DUT level into a structure of scalar signals in generated VHDL or SystemVerilog code. - Add Comments to Generated HDL Code
Add comments to generated HDL code by using Simulink annotations, signal descriptions, DocBlock blocks, or requirement links. - Use Test Points to Debug Signals with HDL Coder
An example that shows how to add test points to signals in your model and debug these signals in the generated HDL code. - Generation of Clock Bundle Signals in HDL Coder
How HDL Coder™ generates clock, reset, and clock enable signals in the HDL code.



