User-Defined MATLAB Functions
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 the MATLAB Function and MATLAB System blocks in the User-Defined Functions library.
To filter the Simulink Library Browser to show only HDL-supported blocks, enter
Simulink Configuration Parameters
Modeling MATLAB Functions
Design patterns that will help you to use advanced MATLAB Function block features.
Recommended option settings and procedures for MATLAB Function blocks for optimal HDL code generation.
The MATLAB Function block and its application in HDL code generation.
Generate HDL Code from MATLAB Functions
Step-by-step tutorial shows how to incorporate a MATLAB Function block into your model for code generation.
Generate Verilog® module or VHDL® entity in HDL code for functions
hdlcoderviterbi2 models a Viterbi decoder,
incorporating a MATLAB Function block for use in simulation and HDL code generation.
HDL Coder™ supports bit shift, bit rotate, bit slice operations that mimic HDL-specific operators without saturation and rounding logic.
Specialized semantics impact the way that a function initializes persistent data.