Functions Supported for HDL Code Generation — Alphabetical List

You can generate efficient HDL code for a subset of MATLAB® built-in functions and toolbox functions that you call from MATLAB code. These functions appear in alphabetical order in the following table.

To find supported functions by MATLAB category or toolbox, see Functions Supported for HDL Code Generation — Categorical List.

NameProductRemarks and Limitations
absFixed-Point Designer™Double and complex data types not supported.
addFixed-Point Designer
allFixed-Point DesignerDouble data type not supported.
andMATLAB
anyFixed-Point DesignerDouble data type not supported.
bitandMATLAB
bitandFixed-Point Designer
bitandreduceFixed-Point Designer
bitcmpMATLAB
bitcmpFixed-Point Designer
bitconcatFixed-Point Designer
bitgetMATLAB
bitgetFixed-Point Designer
bitorMATLAB
bitorFixed-Point Designer
bitorreduceFixed-Point Designer
bitreplicateFixed-Point Designer
bitrolFixed-Point Designer
bitrorFixed-Point Designer
bitsetMATLAB
bitsetFixed-Point Designer
bitshiftMATLAB

For efficient HDL code generation, use the Fixed-Point Designer functions bitsll, bitsrl, or bitsra instead of bitshift.

bitshiftFixed-Point Designer
bitslicegetFixed-Point Designer
bitsllFixed-Point Designer
bitsraFixed-Point Designer
bitsrlFixed-Point Designer
bitxorMATLAB
bitxorFixed-Point Designer
bitxorreduceFixed-Point Designer
ceilFixed-Point Designer
complexMATLAB
complexFixed-Point Designer
conjFixed-Point Designer
convergentFixed-Point Designer
ctransposeMATLAB
ctransposeFixed-Point Designer
divideFixed-Point Designer
  • For HDL Code generation, the divisor must be a constant and a power of two.

  • Non-fi inputs must be constant; that is, their values must be known at compile time so that they can be cast to fi objects.

  • Complex and imaginary divisors are not supported.

  • Code generation in MATLAB does not support the syntax T.divide(a,b).

endFixed-Point Designer
epsFixed-Point Designer
  • Supported for scalar fixed-point signals only.

  • Supported for scalar, vector, and matrix, fi single and fi double signals.

eqMATLAB
eqFixed-Point Designer
fiFixed-Point Designer
fimathFixed-Point Designer
fixFixed-Point Designer
floorFixed-Point Designer
forMATLAB

Do not use for loops without static bounds.

Do not use the & and | operators within conditions of a for statement. Instead, use the && and || operators.

HDL Coder™ does not support nonscalar expressions in the conditions of for statements. Instead, use the all or any functions to collapse logical vectors into scalars.

geMATLAB
geFixed-Point Designer
getlsbFixed-Point Designer
getmsbFixed-Point Designer
gtMATLAB
gtFixed-Point Designer
horzcatFixed-Point Designer
ifMATLAB

Do not use the & and | operators within conditions of an if statement. Instead, use the && and || operators.

HDL Coder does not support nonscalar expressions in the conditions of if statements. Instead, use the all or any functions to collapse logical vectors into scalars.

imagMATLAB
imagFixed-Point Designer
int8int16int32Fixed-Point Designer
iscolumnFixed-Point Designer
isemptyFixed-Point Designer
isequalFixed-Point Designer
isfiFixed-Point Designer
isfimathFixed-Point Designer
isfimathlocalFixed-Point Designer
isfiniteFixed-Point Designer
isinfFixed-Point Designer
isnanFixed-Point Designer
isnumericFixed-Point Designer
isnumerictypeFixed-Point Designer
isrealFixed-Point Designer
isrowFixed-Point Designer
isscalarFixed-Point Designer
issignedFixed-Point Designer
isvectorFixed-Point Designer
leMATLAB
leFixed-Point Designer
lengthFixed-Point Designer
logicalFixed-Point Designer
lowerboundFixed-Point Designer
lsbFixed-Point Designer
ltMATLAB
ltFixed-Point Designer
maxFixed-Point Designer
minFixed-Point Designer
minusFixed-Point Designer
mpowerMATLAB

Both inputs must be scalar, and the exponent input, k, must be an integer.

mpowerFixed-Point Designer

Both inputs must be scalar, and the exponent input, k, must be a constant integer.

mtimes(A,B)MATLAB
mtimesFixed-Point Designer
ndimsFixed-Point Designer
neMATLAB
neFixed-Point Designer
nearestFixed-Point Designer
notMATLAB
numberofelementsFixed-Point Designer
numerictypeFixed-Point Designer
onesMATLAB

Dimensions must be real, nonnegative integers.

orMATLAB
plusMATLABInputs cannot be data type logical.
plusFixed-Point DesignerInputs cannot be data type logical.
powerMATLAB

Both inputs must be scalar, and the exponent input, k, must be an integer.

powerFixed-Point Designer

Both inputs must be scalar, and the exponent input, k, must be a constant integer.

rangeFixed-Point Designer
realMATLAB
realFixed-Point Designer
realmaxFixed-Point Designer
realminFixed-Point Designer
reinterpretcastFixed-Point Designer
repmatFixed-Point Designer
rescaleFixed-Point Designer
reshapeFixed-Point Designer
roundFixed-Point Designer
sfiFixed-Point Designer
signFixed-Point Designer
sizeFixed-Point Designer
sqrtFixed-Point Designer
subFixed-Point Designer
subsasgnFixed-Point Designer

Supported data types for HDL code generation are listed in Supported Data Types.

subsrefFixed-Point Designer

Supported data types for HDL code generation are listed in Supported Data Types.

sumFixed-Point Designer
switchMATLAB

The conditional expression in a switch or case statement must use only:

  • uint8, uint16, uint32, int8, int16, or int32 data types

  • Scalar data

If multiple case statements make assignments to the same variable, the numeric type and fimath specification for that variable must be the same in every case statement.

timesMATLABInputs cannot be data type logical.
timesFixed-Point DesignerInputs cannot be data type logical.
transposeMATLAB
transposeFixed-Point Designer
ufiFixed-Point Designer
uint8uint16uint32Fixed-Point Designer
uminusFixed-Point Designer
uplusFixed-Point DesignerInputs cannot be data type logical.
upperboundFixed-Point Designer
vertcatFixed-Point Designer
xorMATLAB
zerosMATLAB

Dimensions must be real, nonnegative integers.

Was this topic helpful?