Documentation

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

all

Double data type not supported.

any

Double data type not supported.

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

end

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

imag

int8int16int32

iscolumn

isempty

isequal

isfi

isfimath

isfimathlocal

isfinite

isinf

isnan

isnumeric

isnumerictype

isreal

isrow

isscalar

issigned

isvector

le

length

logical

lowerbound

lsb

lt

max

min

minus

mpower

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

mtimes

ndims

ne

nearest

numberofelements

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

real

realmax

realmin

reinterpretcast

repmat

rescale

reshape

round

sfi

sign

size

sqrt

sub

subsasgn

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

subsref

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

sum

times

Inputs cannot be data type logical.

transpose

ufi

uint8uint16uint32

uminus

uplus

Inputs cannot be data type logical.

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 for more information.

Related Examples

More About

Was this topic helpful?