User-Defined Functions

Blocks that support custom functions, such as Fcn and MATLAB Function

Blocks

MATLAB Function Include MATLAB code in models that generate embeddable C code (HDL Coder)
MATLAB System Include System object in model (HDL Coder)

Examples and How To

MATLAB Function Block Design Patterns for HDL

Design patterns that will help you to use advanced MATLAB Function block features

Code Generation from a MATLAB Function Block

Step-by-step tutorial shows how to incorporate a MATLAB Function block into your model for code generation

Distributed Pipeline Insertion for MATLAB Function Blocks

How to optimize MATLAB Function block generated code for speed by inserting internal pipeline stages

Optimize MATLAB Loops

Optimize loops for area or speed.

Pipeline MATLAB Expressions

Insert registers at output of MATLAB® expression

Map Matrices to ROM

To map a matrix constant to ROM:If your MATLAB code meets these requirements, HDL Coder™ inserts a no-reset register at the output of the matrix in the generated code.

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 an MATLAB Function block for use in simulation and HDL code generation.

Bit Shifting and Bit Rotation

HDL Coder supports shift and rotate functions that mimic HDL-specific operators without saturation and rounding logic.

Bit Slicing and Bit Concatenation

This section describes how to use the functions bitsliceget and bitconcat to access and manipulate bit slices (fields) in a fixed-point or integer word.

Concepts

Design Guidelines for the MATLAB Function Block

Recommended option settings and procedures for MATLAB Function blocks for optimal HDL code generation

HDL Applications for the MATLAB Function Block

The MATLAB Function block and its application in HDL code generation.

Was this topic helpful?