Main Content

MATLAB Language Features Supported for HLS Code Generation

You can generate HLS code from MATLAB® code using the HDL Coder™ Workflow Advisor. This page lists the supported MATLAB features, along with some restrictions, and unsupported MATLAB features.

MATLAB Features Supported for HLS Code Generation

  • 1-D, 2-D, and 3-D arrays

  • Matrix operations, including deletion of rows and columns

  • Subscripting

  • Complex numbers

  • Numeric classes

  • Double-precision, single-precision, and integer math

  • Enumerations

  • Fixed-point arithmetic

  • Program control statements if, switch, for, while, and break

  • Arithmetic, relational, and logical operators

  • Persistent variables

  • Structures

  • Characters

  • String scalars

  • Cell arrays

  • Function handles

  • Anonymous functions

  • Nested functions

  • Function argument validation

  • Function calls

  • Class aliasing

  • MATLAB value and handle classes

  • System object™

The MATLAB features listed above are subject to these restrictions when generating HLS code:

  • There must be at least one output variable in the entry point function for HLS code generation.

  • Characters, cell arrays, array of structures, and enumerations are not supported as inputs and outputs of the entry point function.

  • System object and MATLAB class objects are not supported as inputs and outputs of the entry point function.

  • Function argument validation is not supported for fixed-point conversion.

MATLAB Features Not Supported for HLS Code Generation

  • Variable-size arrays

  • Tables

  • Timetables

  • n-D arrays (where n > 3)

  • Half precision

  • Global variables

  • Arrays of type categorical, datetime, duration, and calendarDuration

  • Sparse matrices

  • Dictionaries

  • Recursive functions

  • Variable length input and output argument

  • Scripts

  • GPU arrays

  • Java

  • Map containers

  • Time series objects

  • Tall arrays

  • Try-catch statements

  • Import statements

  • Pattern arrays

See Also

|

Topics