User-DefinedMATLABFunctions
Create HDL-ready algorithms using blocks in User-Defined Functions library
The HDL Coder block library contains many blocks that you can add to your develop your Simulink®modeling environment and develop your HDL algorithm. You can also integrate your HDL algorithm that contains MATLAB®code in the Simulink environment by using theMATLAB FunctionandMATLAB Systemblocks in the User-Defined Functions library.
To filter the Simulink Library Browser to show only HDL-supported blocks, enterhdllib
.
Functions
Model Checks
Topics
Modeling MATLAB Functions
- MATLAB Function Block Design Patterns for HDL
Design patterns that will help you to use advancedMATLAB Functionblock features. - Design Guidelines for the MATLAB Function Block
Recommended option settings and procedures forMATLAB Functionblocks for optimal HDL code generation. - HDL Applications for the MATLAB Function Block
TheMATLAB Functionblock and its application in HDL code generation.
Generate HDL Code from MATLAB Functions
- Code Generation from a MATLAB Function Block
Step-by-step tutorial shows how to incorporate aMATLAB Functionblock into your model for code generation. - Generate Instantiable Code for Functions
Generate Verilog®module or VHDL®entity in HDL code for functions. - Viterbi Decoder with the MATLAB Function Block
hdlcoderviterbi2
models a Viterbi decoder, incorporating aMATLAB Functionblock for use in simulation and HDL code generation. - Bitwise Operations in MATLAB for HDL and SystemC Code Generation
HDL Coder™ supports bit shift, bit rotate, bit slice operations that mimic HDL-specific and SystemC-specific operators without saturation and rounding logic.
Related Information
Troubleshooting
Initialize Persistent Variables in MATLAB Functions
Specialized semantics impact the way that a function initializes persistent data.