Fixed-Point Run-Time Library Functions

HDL code generation support for fixed-point run-time library functions from the Fixed-Point Designer™ is summarized in the following table. See Fixed-Point Function Limitations for general limitations of fixed-point run-time library functions for code generation.

FunctionRemarks and Limitations

abs

Double and complex data types not supported.

add

bitand

bitandreduce

bitcmp

bitconcat

bitget

bitor

bitorreduce

bitreplicate

bitrol

bitror

bitset

bitshift

bitsliceget

bitsll

bitsra

bitsrl

bitxor

bitxorreduce

ceil

complex

conj

convergent

ctranspose

divide

  • 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).

eps

  • Supported for scalar fixed-point signals only.

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

eq

fi

fimath

fix

floor

ge

getlsb

getmsb

gt

horzcat

int8int16int32

isequal

isfi

isfimath

isfimathlocal

isnumerictype

issigned

le

lowerbound

lsb

lt

max

min

minus

mpower

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

mtimes

nearest

numerictype

ones

Dimensions must be real, nonnegative integers.

plus

Inputs cannot be data type logical.

power

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

range

realmax

realmin

reinterpretcast

rescale

round

sfi

sign

sqrt

sub

subsasgn

Supported data types for HDL code generation are listed in Supported MATLAB Data Types, Operators, and Control Flow Statements.

subsref

Supported data types for HDL code generation are listed in Supported MATLAB Data Types, Operators, and Control Flow Statements.

sum

times

Inputs cannot be data type logical.

ufi

uint8uint16uint32

uminus

upperbound

vertcat

Fixed-Point Function Limitations

In addition to function-specific limitations listed in the table, the following general limitations apply to the use of Fixed-Point Designer functions in generated HDL code:

  • fipref and quantizer objects are not supported.

  • Slope and bias scaling are not supported.

  • Dot notation is only supported for getting the values of fimath and numerictype properties. Dot notation is not supported for fi objects, and it is not supported for setting properties.

  • Word lengths greater than 128 bits are not supported.

  • You cannot change the fimath or numerictype of a given variable after that variable has been created.

  • The boolean and ScaledDouble values of the DataTypeMode and DataType properties are not supported.

  • For all SumMode property settings other than FullPrecision, the CastBeforeSum property must be set to true.

  • The numel function returns the number of elements of fi objects in the generated code.

  • General limitations of C/C++ code generated from MATLAB apply. See MATLAB Language Features That Code Generation Does Not Support (Fixed-Point Designer) for more information.

Related Examples

More About